Commit eac209b1 authored by segfault's avatar segfault
Browse files

Remove unused camouflage related code and UI elements from Greeter (refs: #17058)

parent 92db13a9
...@@ -422,25 +422,6 @@ class NetworkSetting(AdditionalSetting): ...@@ -422,25 +422,6 @@ class NetworkSetting(AdditionalSetting):
self.infobar_network.set_visible(False) self.infobar_network.set_visible(False)
class CamouflageSetting(AdditionalSetting):
def __init__(self, greeter, builder):
super().__init__("camouflage", greeter, builder)
def build_ui(self, builder):
super().build_ui(builder)
tailsgreeter.utils.import_builder_objects(self, builder, [
'label_camouflage_value'])
def switch_active(self, switch):
state = switch.get_active()
if state:
self.greeter.camouflage.os = 'win8'
else:
self.greeter.camouflage.os = None
self.label_camouflage_value.set_label(
tailsgreeter.utils.get_on_off_string(state, default=None))
class PersistentStorage(object): class PersistentStorage(object):
def __init__(self, greeter, builder): def __init__(self, greeter, builder):
self.greeter = greeter self.greeter = greeter
...@@ -577,7 +558,6 @@ class GreeterSettingsCollection(object): ...@@ -577,7 +558,6 @@ class GreeterSettingsCollection(object):
self.admin = AdminSetting(greeter, builder) self.admin = AdminSetting(greeter, builder)
self.macspoof = MACSpoofSetting(greeter, builder) self.macspoof = MACSpoofSetting(greeter, builder)
self.network = NetworkSetting(greeter, builder) self.network = NetworkSetting(greeter, builder)
self.camouflage = CamouflageSetting(greeter, builder)
def __getitem__(self, key): def __getitem__(self, key):
return self.__getattribute__(key) return self.__getattribute__(key)
...@@ -595,13 +575,11 @@ class DialogAddSetting(Gtk.Dialog): ...@@ -595,13 +575,11 @@ class DialogAddSetting(Gtk.Dialog):
def build_ui(self, builder): def build_ui(self, builder):
tailsgreeter.utils.import_builder_objects(self, builder, [ tailsgreeter.utils.import_builder_objects(self, builder, [
'box_admin_popover', 'box_admin_popover',
'box_camouflage_popover',
'box_macspoof_popover', 'box_macspoof_popover',
'box_network_popover', 'box_network_popover',
'entry_admin_password', 'entry_admin_password',
'listbox_add_setting', 'listbox_add_setting',
'listboxrow_admin', 'listboxrow_admin',
'listboxrow_camouflage',
'listboxrow_macspoof', 'listboxrow_macspoof',
'listboxrow_network', 'listboxrow_network',
]) ])
...@@ -795,7 +773,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -795,7 +773,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
tailsgreeter.utils.import_builder_objects(self, builder, [ tailsgreeter.utils.import_builder_objects(self, builder, [
'box_admin_popover', 'box_admin_popover',
'box_camouflage_popover',
'box_language', 'box_language',
'box_language_header', 'box_language_header',
'box_macspoof_popover', 'box_macspoof_popover',
...@@ -820,12 +797,10 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -820,12 +797,10 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
'listboxrow_formats', 'listboxrow_formats',
'listboxrow_keyboard', 'listboxrow_keyboard',
'listboxrow_admin', 'listboxrow_admin',
'listboxrow_camouflage',
'listboxrow_macspoof', 'listboxrow_macspoof',
'listboxrow_network', 'listboxrow_network',
'listboxrow_text', 'listboxrow_text',
'listboxrow_tz', 'listboxrow_tz',
'switch_camouflage',
'toolbutton_settings_add', 'toolbutton_settings_add',
]) ])
...@@ -867,10 +842,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -867,10 +842,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
self.dialog_add_setting.set_transient_for(self) self.dialog_add_setting.set_transient_for(self)
self.store_translations(self.dialog_add_setting) self.store_translations(self.dialog_add_setting)
# Settings popovers
self.switch_camouflage.connect('notify::active',
self.cb_switch_camouflage_active)
def __set_focus_chain(self): def __set_focus_chain(self):
self.box_language.set_focus_chain([ self.box_language.set_focus_chain([
self.frame_language, self.frame_language,
...@@ -1112,10 +1083,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -1112,10 +1083,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
self.settings[setting_id].show_popover() self.settings[setting_id].show_popover()
return False return False
def cb_switch_camouflage_active(self, switch, pspec, user_data=None):
self.settings.camouflage.switch_active(switch)
self.settings.camouflage.close_popover_if_any()
def cb_toolbutton_settings_add_clicked(self, user_data=None): def cb_toolbutton_settings_add_clicked(self, user_data=None):
self.setting_add() self.setting_add()
return False return False
......
...@@ -143,85 +143,6 @@ ...@@ -143,85 +143,6 @@
<widget name="label_admin_verify"/> <widget name="label_admin_verify"/>
</widgets> </widgets>
</object> </object>
<object class="GtkBox" id="box_camouflage_popover">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">18</property>
<property name="margin_right">18</property>
<property name="margin_top">18</property>
<property name="margin_bottom">18</property>
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
<object class="GtkLabel" id="label_camouflage_title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="This string will never be displayed in the 1st version of the greeter.">Windows Camouflage</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="1.5"/>
</attributes>
</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_camouflage_description">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="This string will never be displayed in the 1st version of the greeter.">This option makes Tails look like Microsoft Windows 10. This can be useful to avoid attracting suspicion in public places.</property>
<property name="justify">fill</property>
<property name="wrap">True</property>
<property name="width_chars">50</property>
<property name="max_width_chars">50</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_camouflage_controls">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label_camouflage_controls">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" comments="This string will never be displayed in the 1st version of the greeter.">Microsoft Windows 10 camouflage</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="switch_camouflage">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<object class="GtkBox" id="box_macspoof_popover"> <object class="GtkBox" id="box_macspoof_popover">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -1697,63 +1618,6 @@ ...@@ -1697,63 +1618,6 @@
</child> </child>
</object> </object>
</child> </child>
<child>
<object class="GtkListBoxRow" id="listboxrow_camouflage">
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box_camouflage">
<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_camouflage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">tails-camouflage</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_camouflage_caption">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Windows Camouflage</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">listboxrow_camouflage</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_camouflage_value">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Off (default)</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> </object>
<object class="GtkListStore" id="liststore_formats"> <object class="GtkListStore" id="liststore_formats">
<columns> <columns>
...@@ -1893,10 +1757,6 @@ ...@@ -1893,10 +1757,6 @@
<col id="0">network-configuration</col> <col id="0">network-configuration</col>
<col id="1" translatable="yes">Network Configuration</col> <col id="1" translatable="yes">Network Configuration</col>
</row> </row>
<row>
<col id="0">camouflage</col>
<col id="1" translatable="yes">Windows Camouflage</col>
</row>
</data> </data>
</object> </object>
<object class="GtkListStore" id="liststore_text"> <object class="GtkListStore" id="liststore_text">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment