From 6049e5e3a9f77f4b784eeaf90ace6905feb1afd7 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 18:55:12 +0200 Subject: Move auto connection to setttings. --- parrot_zik/interface/base.py | 15 +++++++++++---- parrot_zik/interface/version2.py | 6 ------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/parrot_zik/interface/base.py b/parrot_zik/interface/base.py index 225e53f..b93c6c0 100644 --- a/parrot_zik/interface/base.py +++ b/parrot_zik/interface/base.py @@ -1,4 +1,5 @@ from parrot_zik import resource_manager +from parrot_zik.indicator import Menu from parrot_zik.indicator import MenuItem from parrot_zik.model.base import BatteryStates @@ -15,12 +16,18 @@ class ParrotZikBaseInterface(object): visible=False) self.firmware_version = MenuItem("Firmware Version:", None, sensitive=False, visible=False) + self.settings = MenuItem("Settings", None, visible=False) + self.settings_submenu = Menu() + self.settings.set_submenu(self.settings_submenu) + self.auto_connection = MenuItem("Auto Connection", self.toggle_auto_connection, - checkitem=True, visible=False) + checkitem=True) + self.settings_submenu.append(self.auto_connection) + self.indicator.menu.append(self.battery_level) self.indicator.menu.append(self.battery_state) self.indicator.menu.append(self.firmware_version) - self.indicator.menu.append(self.auto_connection) + self.indicator.menu.append(self.settings) def activate(self, manager): self.parrot = self.parrot_class(manager) @@ -32,7 +39,7 @@ class ParrotZikBaseInterface(object): self.battery_level.show() self.battery_state.show() self.firmware_version.show() - self.auto_connection.show() + self.settings.show() self.indicator.active_interface = self self.indicator.menu.reposition() @@ -45,7 +52,7 @@ class ParrotZikBaseInterface(object): self.battery_level.hide() self.battery_state.hide() self.firmware_version.hide() - self.auto_connection.hide() + self.settings.hide() self.indicator.menu.reposition() self.indicator.active_interface = None self.indicator.setIcon("zik-audio-headset") diff --git a/parrot_zik/interface/version2.py b/parrot_zik/interface/version2.py index 74fdcc9..08af737 100644 --- a/parrot_zik/interface/version2.py +++ b/parrot_zik/interface/version2.py @@ -98,9 +98,6 @@ class ParrotZikVersion2Interface(ParrotZikBaseInterface): self.flight_mode = MenuItem("Flight Mode", self.toggle_flight_mode, checkitem=True, visible=False) - self.settings = MenuItem("Settings", None, visible=False) - self.settings_submenu = Menu() - self.settings.set_submenu(self.settings_submenu) self.head_detection = MenuItem("Head Detection", self.toggle_head_detection, checkitem=True) self.settings_submenu.append(self.head_detection) @@ -108,13 +105,11 @@ class ParrotZikVersion2Interface(ParrotZikBaseInterface): self.indicator.menu.append(self.room_sound_effect) self.indicator.menu.append(self.noise_cancelation) self.indicator.menu.append(self.flight_mode) - self.indicator.menu.append(self.settings) def activate(self, manager): self.noise_cancelation.show() self.flight_mode.show() self.room_sound_effect.show() - self.settings.show() super(ParrotZikVersion2Interface, self).activate(manager) self._read_noise_cancelation() self.flight_mode.set_active(self.parrot.flight_mode) @@ -139,7 +134,6 @@ class ParrotZikVersion2Interface(ParrotZikBaseInterface): self.noise_cancelation.hide() self.flight_mode.hide() self.room_sound_effect.hide() - self.settings.hide() super(ParrotZikVersion2Interface, self).deactivate() def toggle_flight_mode(self, widget): -- cgit v1.2.1