summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2019-09-25 01:23:21 +0200
committersegfault <segfault@riseup.net>2019-09-25 10:36:19 +0200
commit96e70e3d721f432b947a95e2e5a101273f3af02d (patch)
treec8a048f9688e89dc27a65eac4ab636f48b397c75
parent495690b1f6db592d88b643965a687bae5b41be29 (diff)
Remove unused time zone related code and UI elements from Greeter (refs: #17058)wip/bugfix/17058-unused-greeter-ui-elements
-rw-r--r--config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/gui.py8
-rw-r--r--config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/language.py51
-rw-r--r--config/chroot_local-includes/usr/share/tails-greeter/greeter.ui116
3 files changed, 0 insertions, 175 deletions
diff --git a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/gui.py b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/gui.py
index 13d6ff6..ef8230e 100644
--- a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/gui.py
+++ b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/gui.py
@@ -218,12 +218,6 @@ class FormatsSetting(RegionSetting):
greeter.localisationsettings.formats)
-class TimezoneSetting(RegionSetting):
- def __init__(self, greeter, builder):
- super().__init__("tz", greeter, builder,
- greeter.localisationsettings.timezone)
-
-
class AdditionalSetting(GreeterSetting):
def __init__(self, setting_id, greeter, builder):
super().__init__(setting_id)
@@ -537,7 +531,6 @@ class GreeterSettingsCollection(object):
self.text = TextSetting(greeter, builder)
self.keyboard = KeyboardSetting(greeter, builder)
self.formats = FormatsSetting(greeter, builder)
- self.timezone = TimezoneSetting(greeter, builder)
# Additional settings views
self.admin = AdminSetting(greeter, builder)
@@ -776,7 +769,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
'listboxrow_macspoof',
'listboxrow_network',
'listboxrow_text',
- 'listboxrow_tz',
'toolbutton_settings_add',
])
diff --git a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/language.py b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/language.py
index 68bb76d..f0357b4 100644
--- a/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/language.py
+++ b/config/chroot_local-includes/usr/local/lib/python3/dist-packages/tailsgreeter/language.py
@@ -718,56 +718,6 @@ class LayoutSetting(RegionSetting):
settings.set_value('sources', GLib.Variant('a(ss)', [('xkb', layout)]))
-class TimezoneSetting(RegionSetting):
-
- def get_tree(self):
- timezones = self.get_all()
- treestore = Gtk.TreeStore(GObject.TYPE_STRING, # id
- GObject.TYPE_STRING) # name
- areas = self._timezone_split_area(timezones)
- for area in sorted(areas.keys()):
- locations = sorted(
- areas[area],
- key=lambda x: self._timezone_name(x).lower())
- treeiter_area = treestore.append(parent=None)
- # we fill the title with the 1st layout of the group
- treestore.set(treeiter_area, 0, locations[0])
- treestore.set(treeiter_area, 1, area)
- if len(locations) > 1:
- for location in locations:
- treeiter_location = treestore.append(parent=treeiter_area)
- treestore.set(treeiter_location, 0, location)
- treestore.set(treeiter_location, 1,
- self._timezone_name(location))
- return treestore
-
- def get_name(self):
- return self._timezone_name(self.get_value())
-
- def get_all(self):
- """Return a list of all timezones
-
- """
- return pytz.common_timezones
-
- def _timezone_name(self, timezone):
- if '/' in timezone:
- area, s, location = timezone.partition('/')
- return location
- else:
- return timezone
-
- def _timezone_split_area(self, timezones):
- timezone_areas = {}
- for timezone in timezones:
- area, s, v = timezone.partition('/')
- if area not in timezone_areas:
- timezone_areas[area] = set([timezone])
- else:
- timezone_areas[area].add(timezone)
- return timezone_areas
-
-
class LocalisationSettings(object):
"""Controller for localisation settings
@@ -792,7 +742,6 @@ class LocalisationSettings(object):
self.text = TextSetting(self)
self.formats = FormatSetting(self)
self.layout = LayoutSetting(self)
- self.timezone = TimezoneSetting(self)
def __del__(self):
if self.__actusermanager_loadedid:
diff --git a/config/chroot_local-includes/usr/share/tails-greeter/greeter.ui b/config/chroot_local-includes/usr/share/tails-greeter/greeter.ui
index 68c3bf1..df33565 100644
--- a/config/chroot_local-includes/usr/share/tails-greeter/greeter.ui
+++ b/config/chroot_local-includes/usr/share/tails-greeter/greeter.ui
@@ -735,63 +735,6 @@
</child>
</object>
</child>
- <child>
- <object class="GtkListBoxRow" id="listboxrow_tz">
- <property name="sensitive">False</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkBox" id="box_tz">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">6</property>
- <property name="margin_right">6</property>
- <property name="margin_top">6</property>
- <property name="margin_bottom">6</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkImage" id="image_tz">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">tails-timezone</property>
- <property name="icon_size">3</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_tz_caption">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Time Zone</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">listboxrow_tz</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label_tz_value">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">UTC</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
</object>
</child>
<child type="label_item">
@@ -1803,63 +1746,4 @@
</packing>
</child>
</object>
- <object class="GtkListStore" id="liststore_tz">
- <columns>
- <!-- column-name id -->
- <column type="gchararray"/>
- <!-- column-name name -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkBox" id="box_tz_popover">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">12</property>
- <property name="margin_right">12</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkSearchEntry" id="searchentry_tz">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="primary_icon_name">edit-find-symbolic</property>
- <property name="primary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow_tz">
- <property name="width_request">400</property>
- <property name="height_request">200</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
- <child>
- <object class="GtkTreeView" id="treeview_tz">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="model">liststore_tz</property>
- <property name="headers_visible">False</property>
- <property name="activate_on_single_click">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection6"/>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
</interface>