def openDatabase(self): self.pdb = PDBFigaro(filename = expanduser(self.conf.options['fpm-database'])) dlg = LoginDialog(pdb = self.pdb) password = dlg['password'] try: res = dlg.run() if res != gtk.RESPONSE_OK: print "Good bye." sys.exit(1) except DatabaseNotExist: dlg.destroyDialog() newpass = self.createNewDatabase() if newpass is None: sys.exit(1) self.pdb.open(newpass)
def openDatabase(self): self.pdb = PDBFigaro( filename=expanduser(self.conf.options['fpm-database'])) dlg = LoginDialog(pdb=self.pdb) password = dlg['password'] try: res = dlg.run() if res != gtk.RESPONSE_OK: print "Good bye." sys.exit(1) except DatabaseNotExist: dlg.destroyDialog() newpass = self.createNewDatabase() if newpass is None: sys.exit(1) self.pdb.open(newpass)
def main(): app = QtGui.QApplication(sys.argv) app.setWindowIcon(QtGui.QIcon(":/icons/pydosh.png")) QtCore.QCoreApplication.setApplicationName("pydosh") QtCore.QCoreApplication.setOrganizationName("innerhippy") QtCore.QCoreApplication.setOrganizationDomain("innerhippy.com") menubar = QtGui.QMenuBar() stylesheet.setStylesheet() loginDialog = LoginDialog() loginDialog.show() loginDialog.raise_() if loginDialog.exec_(): window = PydoshWindow() window.show() return app.exec_() return -1
def show_login_dialog(self): """显示登录对话框""" login_dialog = LoginDialog(self._config) login_dialog.clicked_ok.connect(self.call_login_luncher) login_dialog.setWindowModality(Qt.ApplicationModal) login_dialog.exec()