コード例 #1
0
    def verify_user(self, profileid=None):
        if profileid is None:
            profileid = self.current_profileid
        if len(profileid) == 0:
            return False

        try:
            username = gameslist.username_from_profile_id(profileid)
        except gameslist.NoSuchProfileError:
            return False

        if windows.desura_running(username):
            return True

        verify_dialog = QMessageBox()
        verify_dialog.setText(
            "<b>Verify your identity</b><br />Sign in to Desura to continue with account <b>{0}</b> to confirm your identity"
            .format(username))
        verify_dialog.setInformativeText(
            "<i>Waiting for Desura sign-in...</i>")
        verify_dialog.setWindowTitle("Sign into Desura to continue")
        verify_dialog.setStandardButtons(QMessageBox.Cancel)
        verify_dialog.setIcon(QMessageBox.Information)
        verify_dialog.setWindowFlags(Qt.CustomizeWindowHint
                                     | Qt.WindowTitleHint)
        desurawaiter = DesuraWaiter(username)
        desurawaiter.finished.connect(verify_dialog.close)
        desurawaiter.start()
        verify_dialog.exec_()
        if windows.desura_running(username):
            return True
        else:
            desurawaiter.terminate()
            return False
コード例 #2
0
ファイル: gui.py プロジェクト: RonnChyran/DesuraTools-py
    def verify_user(self, profileid=None):
        if profileid is None:
            profileid=self.current_profileid
        if len(profileid) == 0:
            return False

        try:
            username = gameslist.username_from_profile_id(profileid)
        except gameslist.NoSuchProfileError:
            return False

        if windows.desura_running(username):
            return True

        verify_dialog = QMessageBox()
        verify_dialog.setText("<b>Verify your identity</b><br />Sign in to Desura to continue with account <b>{0}</b> to confirm your identity".format(username))
        verify_dialog.setInformativeText("<i>Waiting for Desura sign-in...</i>")
        verify_dialog.setWindowTitle("Sign into Desura to continue")
        verify_dialog.setStandardButtons(QMessageBox.Cancel)
        verify_dialog.setIcon(QMessageBox.Information)
        verify_dialog.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowTitleHint)
        desurawaiter = DesuraWaiter(username)
        desurawaiter.finished.connect(verify_dialog.close)
        desurawaiter.start()
        verify_dialog.exec_()
        if windows.desura_running(username):
            return True
        else:
            desurawaiter.terminate()
            return False
コード例 #3
0
 def event_about(self):
     msgBox = QMessageBox()
     msgBox.setWindowTitle(APP_NAME)
     msgBox.setWindowIcon(QIcon(APP_ICON))
     msgBox.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
     msgBox.setText(
             '''
             \n%s %s programmed by Snir Turgeman\nIf you found some bugs, please report to [email protected]
             \nEnjoy!\n
             ''' % (APP_NAME, APP_VERSION)
     )
     msgBox.exec_()
コード例 #4
0
 def prompt_for_closing_apps(self, apps_string):
     ''' Function to prompt user for prompting user
     for closing the restricted apps. '''
     msg = QMessageBox()
     msg.setIcon(QMessageBox.Warning)
     msg.setInformativeText("Kindly Close The Application")
     msg.setWindowTitle("ERROR!!!")
     msg.setWindowFlags(self.windowFlags()
                        | Qt.WindowStaysOnTopHint)  #added by RSR
     #msg.setDetailedText("The details are as follows:")
     msg.setStandardButtons(QMessageBox.Ok)
     msg.setText("Looks like  application {} is Open".format(
         apps_string.upper()))
     msg.show()
     msg.exec_()
     return True
コード例 #5
0
 def check_db(self):
     try:
         self.cur.execute('''SELECT name FROM sqlite_master WHERE type='table' AND name="CLIPBOARD"''')
         table = self.cur.fetchall()
         if table.__len__() == 0:
             self.cur.execute('CREATE TABLE CLIPBOARD (ID INTEGER PRIMARY KEY ASC AUTOINCREMENT, DATE DATETIME, CONTENT VARCHAR)')
             self.cur.execute('CREATE TABLE PROPERTIES (NAME VARCHAR PRIMARY KEY, VALUE VARCHAR)')
             self.cur.execute('INSERT INTO PROPERTIES(NAME, VALUE) VALUES ("ALWAYS_ON_TOP", "Y")')
             self.cur.execute('INSERT INTO PROPERTIES(NAME, VALUE) VALUES ("BUFFER_SIZE", "200")')
             self.conn.commit()
     except lite.IntegrityError:
         print("Error occurd while trying to create CLIPBOARD table")
         msgBox = QMessageBox().about()
         msgBox.setWindowTitle(APP_NAME)
         msgBox.setWindowIcon(QIcon(APP_ICON))
         msgBox.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
         msgBox.setText("Error occurd while trying to create CLIPBOARD table, Please report to developer")
         msgBox.exec_()