commit c5747484b2ca54a4360e7226b1174b9df7229010
parent 8a720b1629144ef43a0b5c27682668f55c3afe98
Author: ecdsa <ecdsa@github>
Date: Sun, 17 Mar 2013 11:29:01 +0100
plugin settings dialog
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gui/gui_classic.py b/gui/gui_classic.py
@@ -2015,7 +2015,9 @@ class ElectrumWindow(QMainWindow):
cb.setChecked(p.is_enabled())
cb.clicked.connect(mk_toggle(cb,p))
grid_plugins.addWidget(cb, i, 0)
- grid_plugins.addWidget(HelpButton(description), i, 1)
+ if p.requires_settings:
+ grid_plugins.addWidget(EnterButton(_('Settings'), p.settings_dialog), i, 1)
+ grid_plugins.addWidget(HelpButton(description), i, 2)
except:
print_msg("Error: cannot display plugin", p)
traceback.print_exc(file=sys.stdout)
diff --git a/gui/plugins.py b/gui/plugins.py
@@ -11,6 +11,7 @@ class BasePlugin:
self.description = description
self.gui = gui
self.config = gui.config
+ self.requires_settings = False
def toggle(self):
enabled = not self.is_enabled()
@@ -30,3 +31,5 @@ class BasePlugin:
def set_enabled(self, enabled):
self.config.set_key('use_'+self.name, enabled, True)
+ def settings_dialog(self):
+ pass