Hello! We are running our annual fundraising. Please consider making a donation if you value this freely available service or want to support people around the world working towards liberatory social change. https://riseup.net/donate.

Commit d95673ed authored by anarcat's avatar anarcat
Browse files

Merge branch 'bugfix/add-rightclick-qr-code' into '2.x'

Add right click menu with print/save to qr code

Adds a menu that appears when right clicking on the qr code. The menu
gives the options of saving the qr code to a file or printing it.

Fixes #25

See merge request !15
parents 34b32902 61dc35d4
......@@ -361,6 +361,8 @@ class MonkeysignScan(gtk.Window):
self.qrcodewidget.pack_start(label, False)
self.qrcodewidget.pack_start(swin)
self.qrcodewidget.connect("event", self.qr_code_event)
def create_secret_keys_display(self):
"""list the secret keys for selection somewhere"""
i = 0
......@@ -789,3 +791,22 @@ class MonkeysignScan(gtk.Window):
def documentation_dialog(self, widget, data=None):
webbrowser.open(monkeysign.__documentation__, autoraise=True)
def qr_code_event(self, thing, event):
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
self.qr_code_right_click_menu(event)
def qr_code_right_click_menu(self, event):
menu = gtk.Menu()
menu_items = [
(_('_Save QR code as...'), self.save_qrcode),
(_('_Print QR code...'), self.print_op),
]
for item in menu_items:
new_menu_item = gtk.MenuItem(item[0])
new_menu_item.connect('activate', item[1])
new_menu_item.show()
menu.append(new_menu_item)
menu.popup(None, None, None, event.button, event.time)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment