From 7856465e1ab0ab69101996b12e93450c6bea160b Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Sat, 13 Jun 2015 00:37:49 +0200 Subject: Add flight mode. --- ParrotZikTray | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ParrotZikTray') diff --git a/ParrotZikTray b/ParrotZikTray index 6de9e1c..9a96b9b 100755 --- a/ParrotZikTray +++ b/ParrotZikTray @@ -268,7 +268,7 @@ class ParrotZikVersion2Interface(ParrotZikBaseInterface): self.concert_hall_mode_submenu.append(self.silent_mode) self.indicator.menu.append(self.concert_hall_mode) - self.flight_mode = MenuItem("Flight Mode", None, + self.flight_mode = MenuItem("Flight Mode", self.toggle_flight_mode, sensitive=True, checkitem=True, visible=False) self.indicator.menu.append(self.flight_mode) @@ -278,13 +278,18 @@ class ParrotZikVersion2Interface(ParrotZikBaseInterface): self.flight_mode.show() super(ParrotZikVersion2Interface, self).activate(parrot) self.noise_cancelation_enabled.set_active(self.parrot.noise_cancel) - # self.flight_mode.set_active(self.parrot.flight_mode) + self.flight_mode.set_active(self.parrot.flight_mode) def toggleANC(self, widget): if self.connected: self.parrot.noise_cancel = self.noise_cancelation.get_active() self.noise_cancelation.set_active(self.parrot.noise_cancel) + def toggle_flight_mode(self, widget): + if self.connected: + self.parrot.flight_mode = self.flight_mode.get_active() + self.flight_mode.set_active(self.parrot.flight_mode) + def toggledummy(self, widget): print(widget.get_name()) -- cgit v1.2.1