added focus on main Window

added asterisks for password fields
This commit is contained in:
tom 2014-03-06 11:18:26 +01:00
parent 7dc4fbbfb3
commit ecc161bdb3
3 changed files with 16 additions and 3 deletions

View File

@ -212,8 +212,6 @@ class Ui_Dialog(object):
def retranslateUi(self, Dialog):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Yubico Authenticator", None, QtGui.QApplication.UnicodeUTF8))
self.progressBar.setFormat(QtGui.QApplication.translate("Dialog", "%vs", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -64,6 +64,9 @@ class Ui_Password_Change(QtGui.QDialog):
self.lineEdit_2.setPlaceholderText("New password")
self.lineEdit_3.setPlaceholderText("Confirm new password")
#defin.e echo mode
self.lineEdit_2.setEchoMode(QtGui.QLineEdit.Password)
self.lineEdit_3.setEchoMode(QtGui.QLineEdit.Password)
self.setModal(True)

View File

@ -82,8 +82,16 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
self.connect(appabout, QtCore.SIGNAL('triggered()') ,self.appShowAbout)
self.connect(appexit, QtCore.SIGNAL('triggered()'), self.appExit)
self.activated.connect(self.iconActivated)
self.show()
def iconActivated(self, reason):
if reason in (QtGui.QSystemTrayIcon.Trigger, QtGui.QSystemTrayIcon.DoubleClick):
self.appCalc()
else:
return
def appCalc(self):
#return presence and if the neo is password protected
@ -102,7 +110,9 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
#success! now run the authenticator
#time.sleep(0.5)
self.myapp = Window()
self.myapp.show()
self.myapp.show()
self.myapp.activateWindow()
self.myapp.raise_()
else:
#fail for some reasons
QtGui.QMessageBox.information(QtGui.QWidget(), self.tr("Warning!"), self.tr("Wrong password or applet is corrupted"))
@ -115,6 +125,8 @@ class SystemTrayIcon(QtGui.QSystemTrayIcon):
#time.sleep(0.5)
self.myapp = Window()
self.myapp.show()
self.myapp.activateWindow()
self.myapp.raise_()
else:
#there is no neo
QtGui.QMessageBox.information(QtGui.QWidget(), self.tr("Warning!"), self.tr("No Yubikey NEO found. Please plugin your Yubikey NEO in one of your USB port"))