qrcode plugin fixes #1153

Merged
g1itch merged 5 commits from qrcode into v0.6 2018-03-14 14:02:39 +01:00
3 changed files with 26 additions and 14 deletions
Showing only changes of commit 08a2115412 - Show all commits

View File

@ -112,8 +112,7 @@ if __name__ == "__main__":
zip_safe=False, zip_safe=False,
entry_points={ entry_points={
'bitmessage.gui.menu': [ 'bitmessage.gui.menu': [
'popMenuYourIdentities.qrcode = ' 'address.qrcode = pybitmessage.plugins.menu_qrcode [qrcode]'
'pybitmessage.plugins.qrcodeui [qrcode]'
], ],
'bitmessage.notification.message': [ 'bitmessage.notification.message': [
'notify2 = pybitmessage.plugins.notification_notify2' 'notify2 = pybitmessage.plugins.notification_notify2'

View File

@ -255,6 +255,18 @@ class MyForm(settingsmixin.SMainWindow):
'customContextMenuRequested(const QPoint&)'), 'customContextMenuRequested(const QPoint&)'),
self.on_context_menuYourIdentities) self.on_context_menuYourIdentities)
# load all gui.menu plugins with prefix 'address'
self.menu_plugins = {'address': []}
for plugin in get_plugins('gui.menu', 'address'):
try:
handler, title = plugin(self)
except TypeError:
continue
self.menu_plugins['address'].append(
self.ui.addressContextMenuToolbarYourIdentities.addAction(
title, handler
))
def init_chan_popup_menu(self, connectSignal=True): def init_chan_popup_menu(self, connectSignal=True):
# Popup menu for the Channels tab # Popup menu for the Channels tab
self.ui.addressContextMenuToolbar = QtGui.QToolBar() self.ui.addressContextMenuToolbar = QtGui.QToolBar()
@ -3421,6 +3433,10 @@ class MyForm(settingsmixin.SMainWindow):
self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addSeparator()
self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard) self.popMenuSubscriptions.addAction(self.actionsubscriptionsClipboard)
self.popMenuSubscriptions.addSeparator() self.popMenuSubscriptions.addSeparator()
# preloaded gui.menu plugins with prefix 'address'
for plugin in self.menu_plugins['address']:
self.popMenuSubscriptions.addAction(plugin)
self.popMenuSubscriptions.addSeparator()
self.popMenuSubscriptions.addAction(self.actionMarkAllRead) self.popMenuSubscriptions.addAction(self.actionMarkAllRead)
self.popMenuSubscriptions.exec_( self.popMenuSubscriptions.exec_(
self.ui.treeWidgetSubscriptions.mapToGlobal(point)) self.ui.treeWidgetSubscriptions.mapToGlobal(point))
@ -3831,13 +3847,12 @@ class MyForm(settingsmixin.SMainWindow):
self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities) self.popMenuYourIdentities.addAction(self.actionSpecialAddressBehaviorYourIdentities)
self.popMenuYourIdentities.addAction(self.actionEmailGateway) self.popMenuYourIdentities.addAction(self.actionEmailGateway)
self.popMenuYourIdentities.addSeparator() self.popMenuYourIdentities.addSeparator()
# preloaded gui.menu plugins with prefix 'address'
for plugin in self.menu_plugins['address']:
self.popMenuYourIdentities.addAction(plugin)
self.popMenuYourIdentities.addSeparator()
self.popMenuYourIdentities.addAction(self.actionMarkAllRead) self.popMenuYourIdentities.addAction(self.actionMarkAllRead)
if get_plugins:
for plugin in get_plugins(
'gui.menu', 'popMenuYourIdentities'):
plugin(self)
self.popMenuYourIdentities.exec_( self.popMenuYourIdentities.exec_(
self.ui.treeWidgetYourIdentities.mapToGlobal(point)) self.ui.treeWidgetYourIdentities.mapToGlobal(point))
@ -3857,6 +3872,10 @@ class MyForm(settingsmixin.SMainWindow):
self.popMenu.addAction(self.actionEnable) self.popMenu.addAction(self.actionEnable)
self.popMenu.addAction(self.actionSetAvatar) self.popMenu.addAction(self.actionSetAvatar)
self.popMenu.addSeparator() self.popMenu.addSeparator()
# preloaded gui.menu plugins with prefix 'address'
for plugin in self.menu_plugins['address']:
self.popMenu.addAction(plugin)
self.popMenu.addSeparator()
self.popMenu.addAction(self.actionMarkAllRead) self.popMenu.addAction(self.actionMarkAllRead)
self.popMenu.exec_( self.popMenu.exec_(
self.ui.treeWidgetChans.mapToGlobal(point)) self.ui.treeWidgetChans.mapToGlobal(point))

View File

@ -73,10 +73,4 @@ def connect_plugin(form):
dialog.render(str(form.getCurrentAccount())) dialog.render(str(form.getCurrentAccount()))
dialog.exec_() dialog.exec_()
# return return on_action_ShowQR, _translate("MainWindow", "Show QR-code")
form.actionShowQRCode = \
form.ui.addressContextMenuToolbarYourIdentities.addAction(
_translate("MainWindow", "Show QR-code"),
on_action_ShowQR
)
form.popMenuYourIdentities.addAction(form.actionShowQRCode)