本文整理汇总了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!")
示例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()
示例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()