Copy and close on double-click.

This commit is contained in:
Dain Nilsson 2015-06-05 13:48:06 +02:00
parent 04cdcce4b7
commit 301908457e
2 changed files with 10 additions and 2 deletions

2
vendor/yubicommon vendored

@ -1 +1 @@
Subproject commit 0691075aa90e2eb3093b2e4028bfbfdb720d87e0
Subproject commit 700bdd86e71fdbbb00d68ef57fb246095d9189e1

View File

@ -27,6 +27,7 @@
from PySide import QtGui, QtCore
from .. import messages as m
from ..controller import CredentialType
from yubioath.yubicommon.qt.utils import connect_once
from time import time
@ -158,7 +159,14 @@ class Code(QtGui.QWidget):
def mouseDoubleClickEvent(self, event):
if event.button() is QtCore.Qt.LeftButton:
print "TODO: calc, copy and close?", self.cred.code.code
if not self.cred.code.code and self.cred.cred_type in \
[CredentialType.HOTP, CredentialType.TOUCH]:
connect_once(self.cred.changed, self._copy)
self.cred.calculate()
self.window().close()
else:
self._copy() # TODO: Type code out with keyboard?
self.window().close()
event.accept()