本文整理汇总了Python中PythonQt.QtCore.QSettings类的典型用法代码示例。如果您正苦于以下问题:Python QSettings类的具体用法?Python QSettings怎么用?Python QSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showEvent
def showEvent(self, event):
# Load the settings
settings = QSettings()
settings.beginGroup(DigitallyImportedServiceBase.SETTINGS_GROUP)
self.type.setCurrentIndex(int(settings.value("audio_type", 0)))
self.username.setText(settings.value("username", ""))
self.password.setText(settings.value("password", ""))
示例2: ReloadSettings
def ReloadSettings(self):
settings = QSettings()
settings.beginGroup(self.SETTINGS_GROUP)
self.audio_type = int(settings.value("audio_type", 0))
self.username = unicode(settings.value("username", ""))
self.password = unicode(settings.value("password", ""))
示例3: saveSettings
def saveSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("shell")
settings.setValue("command", self.commandFormat)
settings.endGroup()
settings.endGroup()
示例4: saveSettings
def saveSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("shell")
settings.setValue("command", self.settingsDialog.group_shell.input_command.text)
settings.endGroup()
settings.endGroup()
示例5: saveSettings
def saveSettings(self):
self.zapier_url = self.settingsDialog.group_url.widget_url.input_url.text
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("zapier")
settings.setValue("url", self.zapier_url)
settings.endGroup()
settings.endGroup()
示例6: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("shell")
self.commandFormat = settings.value("command", "")
self.outputIsUrl = settings.value("copyOutput",str(False)) == "True"
settings.endGroup()
settings.endGroup()
示例7: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("file")
self.nameFormat = settings.value("name-format", "Screenshot at %H-%M-%S")
self.folder = settings.value("folder", "")
settings.endGroup()
settings.endGroup()
示例8: startAuthenticationProcess
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!")
示例9: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("uguu.se")
self.nameFormat = settings.value("name-format", "screenshot-%H-%M-%S")
self.copyLink = settings.value("copy-link", "true") in ["true", True]
settings.endGroup()
settings.endGroup()
示例10: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("zapier")
self.zapier_url = settings.value("url", "")
settings.endGroup()
settings.endGroup()
示例11: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("shell")
self.commandFormat = settings.value("command", "")
settings.endGroup()
settings.endGroup()
示例12: accept
def accept(self):
# Save the settings
settings = QSettings()
settings.beginGroup(DigitallyImportedServiceBase.SETTINGS_GROUP)
settings.setValue("audio_type", self.type.currentIndex)
settings.setValue("username", self.username.text)
settings.setValue("password", self.password.text)
QDialog.done(self, QDialog.Accepted)
示例13: saveSettings
def saveSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("ftp")
settings.setValue("host", self.settingsDialog.group_server.input_host.text)
settings.setValue("port", int(self.settingsDialog.group_server.input_port.value))
settings.setValue("username", self.settingsDialog.group_server.input_username.text)
settings.setValue("password", self.settingsDialog.group_server.input_password.text)
settings.setValue("url", self.settingsDialog.group_server.input_url.text)
settings.setValue("folder", self.settingsDialog.group_location.input_folder.text)
settings.setValue("name-format", self.settingsDialog.group_location.input_name.text)
settings.endGroup()
settings.endGroup()
示例14: loadSettings
def loadSettings(self):
settings = QSettings()
settings.beginGroup("uploaders")
settings.beginGroup("ftp")
self.host = settings.value("host", "")
self.port = int(settings.value("port", 21))
self.username = settings.value("username", "")
self.password = settings.value("password", "")
self.url = settings.value("url", "")
self.folder = settings.value("folder", "")
self.nameFormat = settings.value("name-format", "Screenshot at %H-%M-%S")
settings.endGroup()
settings.endGroup()
示例15: getScreenshotFormat
def getScreenshotFormat():
settings = QSettings()
settings.beginGroup("main")
format = settings.value("format", "png")
settings.endGroup()
return format