Browse Source

plugin settings dialog

283
ecdsa 12 years ago
parent
commit
c5747484b2
  1. 4
      gui/gui_classic.py
  2. 3
      gui/plugins.py

4
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)

3
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

Loading…
Cancel
Save