From df5aa3102f9d0257224ee9423afdfd42f00592ac Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 13:20:28 +0200 Subject: Refactor. Move. --- parrot_zik/indicator/base.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 parrot_zik/indicator/base.py (limited to 'parrot_zik/indicator/base.py') diff --git a/parrot_zik/indicator/base.py b/parrot_zik/indicator/base.py new file mode 100644 index 0000000..7101790 --- /dev/null +++ b/parrot_zik/indicator/base.py @@ -0,0 +1,44 @@ +class BaseIndicator(object): + def __init__(self, icon, menu, statusicon): + self.menu = menu + self.statusicon = statusicon + self.setIcon(icon) + + def setIcon(self, name): + raise NotImplementedError + + def main(self): + raise NotImplementedError + + def show_about_dialog(self, widget): + raise NotImplementedError + +class MenuItemBase(object): + def __init__(self, base_item, sensitive, visible): + self.base_item = base_item + self.set_sensitive(sensitive) + if visible: + self.show() + else: + self.hide() + + def set_sensitive(self, option): + raise NotImplementedError + + def set_active(self, option): + raise NotImplementedError + + def get_active(self): + raise NotImplementedError + + def set_label(self, option): + raise NotImplementedError + + def show(self): + self.base_item.show() + + def hide(self): + self.base_item.hide() + + def set_submenu(self, menu): + raise NotImplementedError -- cgit v1.2.1 From 3b4f022722e43d5821f4d2276018242c88cb1ed3 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 13:30:06 +0200 Subject: Fix quit wrapping. --- parrot_zik/indicator/base.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'parrot_zik/indicator/base.py') diff --git a/parrot_zik/indicator/base.py b/parrot_zik/indicator/base.py index 7101790..8204fa9 100644 --- a/parrot_zik/indicator/base.py +++ b/parrot_zik/indicator/base.py @@ -13,6 +13,9 @@ class BaseIndicator(object): def show_about_dialog(self, widget): raise NotImplementedError + def quit(self, _): + raise NotImplementedError + class MenuItemBase(object): def __init__(self, base_item, sensitive, visible): self.base_item = base_item -- cgit v1.2.1 From f291feaa8a33645850818f811ba8d7f9eb9d4c31 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Mon, 15 Jun 2015 13:41:06 +0200 Subject: Refactor. --- parrot_zik/indicator/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'parrot_zik/indicator/base.py') diff --git a/parrot_zik/indicator/base.py b/parrot_zik/indicator/base.py index 8204fa9..b29368e 100644 --- a/parrot_zik/indicator/base.py +++ b/parrot_zik/indicator/base.py @@ -7,7 +7,8 @@ class BaseIndicator(object): def setIcon(self, name): raise NotImplementedError - def main(self): + @classmethod + def main(cls): raise NotImplementedError def show_about_dialog(self, widget): -- cgit v1.2.1