當前位置: 首頁>>代碼示例>>Python>>正文


Python QSettings.remove方法代碼示例

本文整理匯總了Python中PythonQt.QtCore.QSettings.remove方法的典型用法代碼示例。如果您正苦於以下問題:Python QSettings.remove方法的具體用法?Python QSettings.remove怎麽用?Python QSettings.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PythonQt.QtCore.QSettings的用法示例。


在下文中一共展示了QSettings.remove方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: startAuthenticationProcess

# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
    def startAuthenticationProcess(self):
        if self.settingsDialog.group_account.input_url.text and self.settingsDialog.group_account.input_username.text and self.settingsDialog.group_account.input_password.text:
            self.saveSettings()
            self.loadSettings()
            if match(self.url, "URI"):
                try:
                    request = requests.get(self.url, timeout=3);

                    if request.status_code == 200:
                        oc = owncloud.Client(self.url)
                        oc.login(self.username, self.password)
                        self.connectStatus = "true"
                        self.saveSettings()
                        self.updateUi()
                except requests.exceptions.RequestException as e:
                    QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The specified Server URL is invalid!")
                    settings = QSettings()
                    settings.remove("connect-status")
                    self.saveSettings()
                    self.updateUi()
                except Exception as e:
                    errorMessage = self.formatConnectionError(e.message)

                    if errorMessage == "401":
                        self.settingsDialog.group_connection.widget_status.label_status.setText("Invalid")
                    else:
                        QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", errorMessage)
            else:
                QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The specified Server URL is invalid!")
        else:
            missingFields = ""
            fieldText = "field"

            if not self.settingsDialog.group_account.input_url.text:
                missingFields = "\"Server URL\""

            if not self.settingsDialog.group_account.input_username.text:
                if missingFields == "":
                    missingFields = "\"Username\""
                else:
                    missingFields = missingFields + " and \"Username\""
                    fieldText = "fields"

            if not self.settingsDialog.group_account.input_password.text:
                if missingFields == "":
                    missingFields = "\"Password\""
                else:
                    missingFields = missingFields.replace(" and", ",") + " and \"Password\""
                    fieldText = "fields"

            QMessageBox.critical(self.settingsDialog, "OwnCloud Connection Error", "The " + missingFields + " " + fieldText + " must be filled in!")
開發者ID:monokles,項目名稱:screencloud-owncloud-shoxy,代碼行數:53,代碼來源:main.py

示例2: logout

# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
	def logout(self):
		settings = QSettings()
		settings.beginGroup("uploaders")
		settings.beginGroup("dropbox")
		settings.remove("access-token")
		settings.remove("user-id")
		settings.remove("display-name")
		settings.endGroup()
		settings.endGroup()
		self.loadSettings()
		self.updateUi()
開發者ID:teryanik,項目名稱:screencloud-plugins,代碼行數:13,代碼來源:main.py

示例3: logOut

# 需要導入模塊: from PythonQt.QtCore import QSettings [as 別名]
# 或者: from PythonQt.QtCore.QSettings import remove [as 別名]
	def logOut(self):
		settings = QSettings()
		settings.beginGroup("uploaders")
		settings.beginGroup("imgur")
		settings.remove("access-token")
		settings.remove("refresh-token")
		settings.remove("username")
		settings.setValue("anonymous", "true")
		settings.endGroup()
		settings.endGroup()
		self.loadSettings()
		self.updateUi()
開發者ID:Nothing4You,項目名稱:screencloud-plugins,代碼行數:14,代碼來源:main.py


注:本文中的PythonQt.QtCore.QSettings.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。