aboutsummaryrefslogtreecommitdiff
path: root/parrot_zik
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-05-10 22:46:44 +0200
committerneodarz <neodarz@neodarz.net>2019-05-10 22:46:44 +0200
commitdec49f55a15622b5489ba06ad7492796c7d65672 (patch)
tree3dcbd5a34d2b3580be82cd78bddc2a2e702b3ea3 /parrot_zik
parent12c9474218f835a9443def9b685241db5454ef40 (diff)
downloadpyParrotZikTCP-dec49f55a15622b5489ba06ad7492796c7d65672.tar.xz
pyParrotZikTCP-dec49f55a15622b5489ba06ad7492796c7d65672.zip
Update parrot zik version1
Diffstat (limited to 'parrot_zik')
-rw-r--r--parrot_zik/interface/version1.py50
1 files changed, 15 insertions, 35 deletions
diff --git a/parrot_zik/interface/version1.py b/parrot_zik/interface/version1.py
index d0a1b2b..1d8f385 100644
--- a/parrot_zik/interface/version1.py
+++ b/parrot_zik/interface/version1.py
@@ -1,5 +1,4 @@
from parrot_zik import resource_manager
-from parrot_zik.indicator import MenuItem
from parrot_zik.interface.base import ParrotZikBaseInterface
from parrot_zik.model.version1 import ParrotZikVersion1
@@ -9,55 +8,36 @@ class ParrotZikVersion1Interface(ParrotZikBaseInterface):
def __init__(self, indicator):
super(ParrotZikVersion1Interface, self).__init__(indicator)
- self.noise_cancelation = MenuItem(
- "Noise Cancellation", self.toggle_noise_cancelation,
- checkitem=True, visible=False)
- self.lou_reed_mode = MenuItem("Lou Reed Mode", self.toggle_lou_reed_mode,
- checkitem=True, visible=False)
- self.concert_hall_mode = MenuItem(
- "Concert Hall Mode", self.toggle_parrot_concert_hall,
- checkitem=True, visible=False)
- self.indicator.menu.append(self.noise_cancelation)
- self.indicator.menu.append(self.lou_reed_mode)
- self.indicator.menu.append(self.concert_hall_mode)
def activate(self, manager):
super(ParrotZikVersion1Interface, self).activate(manager)
- self.noise_cancelation.set_active(self.parrot.cancel_noise)
- self.lou_reed_mode.set_active(self.parrot.lou_reed_mode)
- self.concert_hall_mode.set_active(self.parrot.concert_hall)
-
- self.noise_cancelation.show()
- self.lou_reed_mode.show()
- self.concert_hall_mode.show()
- self.indicator.menu.reposition()
def deactivate(self):
- self.noise_cancelation.hide()
- self.lou_reed_mode.hide()
- self.concert_hall_mode.hide()
super(ParrotZikVersion1Interface, self).deactivate()
- def toggle_noise_cancelation(self, widget):
+ def toggle_noise_cancelation(self, noise_cancelation):
+ """
+ Define noise cancelation mode.
+ """
try:
- self.parrot.cancel_noise = self.noise_cancelation.get_active()
- self.noise_cancelation.set_active(self.parrot.cancel_noise)
+ self.parrot.cancel_noise = noise_cancelation
except resource_manager.DeviceDisconnected:
self.deactivate()
- def toggle_lou_reed_mode(self, widget):
+ def toggle_lou_reed_mode(self, lou_reed_mode):
+ """
+ Define lou reed mode.
+ """
try:
- self.parrot.lou_reed_mode = self.lou_reed_mode.get_active()
- self.lou_reed_mode.set_active(self.parrot.lou_reed_mode)
- self.concert_hall_mode.set_active(self.parrot.concert_hall)
- self.concert_hall_mode.set_sensitive(
- not self.lou_reed_mode.get_active())
+ self.parrot.lou_reed_mode = lou_reed_mode
except resource_manager.DeviceDisconnected:
self.deactivate()
- def toggle_parrot_concert_hall(self, widget):
+ def toggle_parrot_concert_hall(self, parrot_concert_hall):
+ """
+ Define parrot concert hall
+ """
try:
- self.parrot.concert_hall = self.concert_hall_mode.get_active()
- self.concert_hall_mode.set_active(self.parrot.concert_hall)
+ self.parrot.concert_hall = parrot_concert_hall
except resource_manager.DeviceDisconnected:
self.deactivate()