当前位置: 首页>>代码示例>>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;未经允许,请勿转载。