def copy_code(self, *args):
"""
Copy code shows the code box for a while (10s by default)
"""
self.timer = 0
code = self.account.get_code()
try:
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
self.window.notification.set_message(
_('Code "{0}" copied to clipboard'.format(str(code))))
self.window.notification.show()
clipboard.clear()
clipboard.set_text(code, len(code))
logging.debug("Secret code copied to clipboard")
except Exception as e:
logging.error(str(e))
self.revealer.set_reveal_child(True)
GLib.timeout_add_seconds(1, self.update_timer)
account_row.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录