def readSettings(self): ''' ''' settings = QtCore.QSettings() settings.beginGroup("LeginonUI") val = settings.value('leginonDB') if val: self.ui.leginonHostnameLineEdit.setText(val) val = settings.value('leginonPath') if val: self.ui.leginonDBNameLineEdit.setText(val) val = settings.value('projectDB') if val: self.ui.projectHostnameLineEdit.setText(val) val = settings.value('projectPath') if val: self.ui.projectDBNameLineEdit.setText(val) self.ui.usernameLineEdit.setText(settings.value('targetuser')) self.ui.passwordLineEdit.setText(settings.value('targetpass')) val = settings.value('username') if val: self.ui.dbUsernameLineEdit.setText(val) val = settings.value('password') if val: self.ui.dbPasswordLineEdit.setText(base64.b64decode(val)) #self.ui.alternateUserLineEdit.setText(settings.value('alternate-user')) settings.endGroup() if self.ui.usernameLineEdit.text() == "": self.ui.usernameLineEdit.setText(getpass.getuser())
def getSettings(self): ''' Get the settings object ''' ''' return QtCore.QSettings(QtCore.QSettings.IniFormat, QtCore.QSettings.UserScope, "Arachnid", "ImageScreen") ''' if self.inifile == "": return None return QtCore.QSettings(self.inifile, QtCore.QSettings.IniFormat)
def writeSettings(self): ''' ''' settings = QtCore.QSettings() settings.beginGroup("ProjectUI") settings.setValue('spiderExecutable', self.ui.spiderExecutableLineEdit.text()) settings.endGroup()
def readSettings(self): ''' ''' settings = QtCore.QSettings() settings.beginGroup("ProjectUI") val = settings.value('spiderExecutable') if val: self.ui.spiderExecutableLineEdit.setText(val) settings.endGroup()
def writeSettings(self): ''' ''' settings = QtCore.QSettings() settings.beginGroup("LeginonUI") settings.setValue('leginonDB', self.ui.leginonHostnameLineEdit.text()) settings.setValue('leginonPath', self.ui.leginonDBNameLineEdit.text()) settings.setValue('projectDB', self.ui.projectHostnameLineEdit.text()) settings.setValue('projectPath', self.ui.projectDBNameLineEdit.text()) settings.setValue('targetuser', self.ui.usernameLineEdit.text()) settings.setValue('targetpass', self.ui.passwordLineEdit.text()) settings.setValue('username', self.ui.dbUsernameLineEdit.text()) settings.setValue('password', base64.b64encode(self.ui.dbPasswordLineEdit.text())) #settings.setValue('alternate-user', self.ui.alternateUserLineEdit.text()) settings.endGroup()