本文整理汇总了Python中Core.Universals.setMySetting方法的典型用法代码示例。如果您正苦于以下问题:Python Universals.setMySetting方法的具体用法?Python Universals.setMySetting怎么用?Python Universals.setMySetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Universals
的用法示例。
在下文中一共展示了Universals.setMySetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: installKDE4Languages
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def installKDE4Languages():
if uni.isAvailableKDE4():
for langCode in uni.getInstalledLanguagesCodes():
installKDE4Language(langCode)
uni.setMySetting("isInstalledKDE4Language", True)
return True
return False
示例2: getTagger
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def getTagger(_isAlertIfNotExist=False, _isReloadAgain=False):
global loaddedTagger
try:
if not _isReloadAgain and loaddedTagger is not None:
return loaddedTagger
preferedTaggerModule = uni.MySettings["preferedTaggerModule"]
taggerModule = __import__("Taggers." + preferedTaggerModule, globals(), locals(), ["isAvailable", "Tagger", preferedTaggerModule], 0)
if taggerModule.isAvailable:
loaddedTagger = taggerModule.Tagger()
return loaddedTagger
taggersNames = uni.getTaggersMachineNames()
for tagger in taggersNames:
taggerModule = __import__("Taggers." + tagger, globals(), locals(), ["isAvailable", "Tagger", tagger], 0)
if taggerModule.isAvailable:
uni.setMySetting("preferedTaggerModule", tagger)
loaddedTagger = taggerModule.Tagger()
return loaddedTagger
if _isAlertIfNotExist:
Dialogs.show(translate("Taggers", "You Have Not Any Tagger"),
translate("Taggers", "Not found any tagger in your system. "
"Please install a tagger module. "
"Now supporting only eyeD3 module (python-eyed3)."))
return None
except:
ReportBug.ReportBug()
示例3: closeEvent
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def closeEvent(self, _event):
try:
self.player.stop()
uni.setMySetting("isPlayNow", self.isPlayNow.isChecked())
except:
pass
self.closeCurrenctImageDialogs()
示例4: cckbMStateChanged
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def cckbMStateChanged(self, _index=None):
if self.settingKey is not None:
if self.checkState() == Mt.Checked:
uni.setMySetting(self.settingKey, True)
else:
uni.setMySetting(self.settingKey, False)
if self.stateChanged is not None:
self.stateChanged()
示例5: subDirectoryDeepChanged
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def subDirectoryDeepChanged(self, _action=None):
try:
selectedDeep = str(self.SubDirectoryDeeps[_action])
if self.checkUnSavedValues():
uni.setMySetting("subDirectoryDeep", int(selectedDeep))
self.refreshForColumns()
getMainWindow().SpecialTools.refreshForColumns()
self.refresh(getMainWindow().FileManager.getCurrentDirectoryPath())
self.cbSubDirectoryDeep.setCurrentIndex(
self.cbSubDirectoryDeep.findText(str(uni.MySettings["subDirectoryDeep"])))
except:
ReportBug.ReportBug()
示例6: cbTaggerChanged
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def cbTaggerChanged(self, _action=None):
try:
tagger = self.cbTagger.currentData()
if self.checkUnSavedValues():
uni.setMySetting("preferedTaggerModule", tagger)
t = Taggers.getTagger(True, True)
self.refreshForColumns()
getMainWindow().SpecialTools.refreshForColumns()
self.refresh(getMainWindow().FileManager.getCurrentDirectoryPath())
self.cbTagger.setCurrentIndex(
self.cbTagger.findText(Taggers.getTaggerName(uni.MySettings["preferedTaggerModule"])))
except:
ReportBug.ReportBug()
示例7: changeReNamerType
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def changeReNamerType(_action):
try:
if getMainTable().checkUnSavedValues() is False:
_action.setChecked(False)
for x, typeName in enumerate(uni.fileReNamerTypeNamesKeys):
if typeName == uni.MySettings["fileReNamerType"]:
getMainWindow().TableToolsBar.actsFileReNamerTypes[x].setChecked(True)
return False
for x, typeName in enumerate(uni.fileReNamerTypeNamesKeys):
if getMainWindow().TableToolsBar.actsFileReNamerTypes[x].isChecked():
uni.setMySetting("fileReNamerType", typeName)
getMainWindow().FileManager.makeRefresh()
MApplication.processEvents()
except:
ReportBug.ReportBug()
示例8: tabChanged
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def tabChanged(self, _index):
uni.setMySetting("activeTabNoOfSpecialTools", str(_index))
self.pbtnApply.setEnabled(True)
self.tbAddToBefore.setEnabled(True)
self.tbAddToAfter.setEnabled(True)
if _index == 0:
self.cbInformationSection.setCurrentIndex(0)
self.cbInformationSection.setEnabled(False)
elif _index == 1:
self.cbInformationSection.setEnabled(True)
self.clearChangeTypes()
self.btChange.setChecked(True)
elif _index == 2:
self.cbInformationSection.setCurrentIndex(0)
self.cbInformationSection.setEnabled(False)
elif _index == 3:
self.cbInformationSection.setEnabled(True)
self.clearChangeTypes()
self.btChange.setChecked(True)
self.tbAddToBefore.setEnabled(False)
self.tbAddToAfter.setEnabled(False)
elif _index == 4:
self.cbInformationSection.setEnabled(True)
self.clearChangeTypes()
self.btChange.setChecked(True)
self.tbAddToBefore.setEnabled(False)
self.tbAddToAfter.setEnabled(False)
elif _index == 5:
self.cbInformationSection.setCurrentIndex(0)
self.cbInformationSection.setEnabled(False)
self.clearChangeTypes()
self.btChange.setChecked(True)
self.tbAddToBefore.setEnabled(False)
self.tbAddToAfter.setEnabled(False)
elif _index == 6:
self.cbInformationSection.setCurrentIndex(0)
self.cbInformationSection.setEnabled(False)
self.pbtnApply.setEnabled(False)
示例9: valueChanged
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def valueChanged(self, _action=None):
try:
senderAction = self.sender()
if senderAction.parent().objectName() in self.keysOfSettings:
indexNo = self.keysOfSettings.index(senderAction.parent().objectName())
else:
indexNo = self.keysOfSettings.index(senderAction.objectName())
selectedValue = None
if self.typesOfValues[indexNo] == "Yes/No":
if senderAction.isChecked():
selectedValue = True
else:
selectedValue = False
elif self.typesOfValues[indexNo][0] == "options":
valueIndex = int(_action.objectName().split(";")[1])
selectedValue = self.valuesOfOptionsKeys[self.typesOfValues[indexNo][1]][valueIndex]
uni.setMySetting(self.keysOfSettings[indexNo], selectedValue)
self.checkEnableStates()
getMainWindow().StatusBar.fillSelectionInfo()
if getMainTable() is not None:
getMainTable().fillSelectionInfo()
except:
ReportBug.ReportBug()
示例10: checkAmarok
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def checkAmarok(_isAlertIfNotAvailable=True, _isUseReadOnly=True):
global isAskEmbeddedDBConfiguration
if isLoadedMysql and uni.isAvailableKDE4():
if uni.getBoolValue("amarokIsUseHost"):
if _isUseReadOnly or uni.getBoolValue("isReadOnlyAmarokDBHost") is False:
return True
else:
if _isAlertIfNotAvailable:
answer = Dialogs.ask(translate("Amarok", "This Feature Is Not Usable"),
translate("Amarok",
"This feature is not usable with read only Amarok database. <br>Are you want to give permission to read and write for Amarok database?"))
if answer == Dialogs.Yes:
uni.setMySetting("isReadOnlyAmarokDBHost", False)
return True
else:
isAskEmbeddedDBConfiguration = True
return checkEmbeddedDB()
else:
if _isAlertIfNotAvailable:
Dialogs.showError(translate("Amarok", "Amarok Module Is Not Usable"),
translate("Amarok", "Please run Amarok once."))
return False
return False
示例11: changeTableTypeByType
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def changeTableTypeByType(_tableType):
try:
if uni.tableType != _tableType:
if getMainTable().checkUnSavedValues() is False:
return False
uni.setMySetting(getMainTable().hiddenTableColumnsSettingKey,
getMainTable().hiddenTableColumns)
if uni.tableType in ["2", "6", "8", "9"]:
getMainWindow().removeToolBar(getMainWindow().PlayerBar)
getMainWindow().PlayerBar.deleteLater()
getMainWindow().PlayerBar = None
try: getMainWindow().removeDockWidget(getMainWindow().dckSpecialTools)
except: pass
getMainWindow().resetCentralWidget()
uni.tableType = _tableType
refreshBars()
getMainWindow().FileManager.makeRefresh()
MApplication.processEvents()
return True
else:
return False
except:
ReportBug.ReportBug()
return False
示例12: doAfterRunProcessesStep1
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def doAfterRunProcessesStep1(self):
if str(fu.defaultFileSystemEncoding) != str(uni.MySettings["fileSystemEncoding"]):
answer = Dialogs.ask(
translate("HamsiManager", "Your System's \"File System Encoding\" Type Different"),
translate("HamsiManager",
"Your system's \"File System Encoding\" type different from the settings you select. Are you sure you want to continue?If you are not sure press the \"No\"."),
False, "Your System's \"File System Encoding\" Type Different")
if answer == Dialogs.No:
OptionsForm.OptionsForm(self, _focusTo="fileSystemEncoding")
if uni.getBoolValue("isMakeAutoDesign"):
self.TableToolsBar.setVisible(False)
self.ToolsBar.setVisible(False)
if isActivePyKDE4:
self.Browser.setVisible(False)
self.TreeBrowser.setVisible(False)
self.FileManager.urlNavigator.setMinimumWidth(150)
self.FileManager.tbarBrowserToolsFull.setVisible(False)
self.tabifyDockWidget(self.Browser, self.Places)
self.tabifyDockWidget(self.Browser, self.TreeBrowser)
self.tabifyDockWidget(self.Browser, self.DirOperator)
geometries = uni.getListValue("MainWindowGeometries")
self.setGeometry(int(geometries[0]), int(geometries[1]), 900, 600)
uni.setMySetting("isMakeAutoDesign", "False")
if uni.isShowVerifySettings and (uni.changedDefaultValuesKeys != [] or uni.newSettingsKeys != []):
answer = Dialogs.ask(translate("HamsiManager", "Added New Options And New Features"),
translate("HamsiManager",
"New options and new features added to Hamsi Manager. Are you want to change or verify new options?"),
False, "Added New Options And New Features")
if answer == Dialogs.Yes:
newOrChangedKeys = uni.newSettingsKeys + uni.changedDefaultValuesKeys
OptionsForm.OptionsForm(self, "Normal", None, newOrChangedKeys)
elif uni.getBoolValue("isShowReconfigureWizard") and uni.isBuilt() is False:
from Tools import Configurator
Configurator.Configurator()
uni.setMySetting("isShowReconfigureWizard", "False")
示例13: setAllBarsStyleToMySettings
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def setAllBarsStyleToMySettings():
uni.setMySetting("TableToolsBarButtonStyle", getMainWindow().TableToolsBar.toolButtonStyle())
uni.setMySetting("ToolsBarButtonStyle", getMainWindow().ToolsBar.toolButtonStyle())
if uni.tableType in ["2", "6", "8", "9"]:
uni.setMySetting("PlayerBarButtonStyle", getMainWindow().PlayerBar.toolButtonStyle())
示例14: closeEvent
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def closeEvent(self, _event):
try:
if uni.isRaisedAnError is False:
if uni.isContinueThreadAction():
uni.cancelThreadAction()
_event.ignore()
uni.isStartedCloseProcess = True
uni.printForDevelopers("Started closeEvent")
MApplication.setQuitOnLastWindowClosed(True)
try:
self.PlayerBar.MusicPlayer.stop()
except:
pass
Details.closeAllDialogs()
uni.printForDevelopers("Closed Dialogs")
if uni.isRaisedAnError is False:
if self.Table.checkUnSavedValues() is False:
uni.isStartedCloseProcess = False
uni.printForDevelopers("Close ignored")
_event.ignore()
uni.printForDevelopers("Before self.doBeforeCloseProcesses")
if self.doBeforeCloseProcesses() is False:
_event.ignore()
return None
uni.printForDevelopers("After self.doBeforeCloseProcesses")
if isActivePyKDE4:
uni.printForDevelopers("Before Save KDE Configs")
kconf = MGlobal.config()
kconfGroup = MConfigGroup(kconf, "DirectoryOperator")
self.FileManager.dirOperator.writeConfig(kconfGroup)
self.FileManager.actCollection.writeSettings(kconfGroup)
uni.printForDevelopers("After Save KDE Configs")
uni.printForDevelopers("Before Save Configs")
uni.setMySetting(self.Table.hiddenTableColumnsSettingKey,
self.Table.hiddenTableColumns)
Bars.setAllBarsStyleToMySettings()
Records.setRecordType(1)
fu.writeToBinaryFile(
fu.joinPath(fu.pathOfSettingsDirectory, "LastState"), self.saveState())
Records.restoreRecordType()
geometry = [self.geometry().x(), self.geometry().y(), self.geometry().width(),
self.geometry().height()]
uni.setMySetting("MainWindowGeometries", geometry)
uni.setMySetting("lastDirectory", self.FileManager.currentDirectory)
uni.setMySetting("isMainWindowMaximized", self.isMaximized())
uni.setMySetting("isShowAdvancedSelections", self.SpecialTools.isShowAdvancedSelections)
uni.setMySetting("tableType", uni.tableType)
uni.setMySetting("activeTabNoOfSpecialTools", self.SpecialTools.tabwTabs.currentIndex())
uni.saveSettings()
Settings.saveUniversalSettings()
if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
import Amarok
uni.printForDevelopers("Before Amarok.stopEmbeddedDB")
Amarok.stopEmbeddedDB()
uni.printForDevelopers("After Amarok.stopEmbeddedDB")
uni.printForDevelopers("After Save Configs")
uni.printForDevelopers("Before self.doAfterCloseProcesses")
self.doAfterCloseProcesses()
uni.printForDevelopers("After self.doAfterCloseProcesses")
except:
if ReportBug.isClose is False:
ReportBug.ReportBug()
_event.ignore()
示例15: loadFinished
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import setMySetting [as 别名]
def loadFinished(self, _bitti):
try:
if (_bitti):
if self.isDownloading is False:
self.setFixedHeight(170)
self.prgbState.setVisible(False)
self.lblInfo.setVisible(True)
self.updateInformations = str(self.wvWeb.page().mainFrame().toPlainText()).split("\n")
if len(self.updateInformations) != 0:
if self.updateInformations[0][0] == "V":
self.pbtnRemindMeLater.setVisible(False)
self.cbRemindMeLater.setVisible(False)
self.pbtnDownloadAndInstall.setVisible(False)
self.pbtnCheckForDeveloperVersion.setVisible(False)
uni.setMySetting("remindMeLaterForUpdate", "-1")
uni.setMySetting("remindMeLaterShowDateForUpdate",
datetime.now().strftime("%Y %m %d %H %M %S"))
uni.saveSettings()
try:
lastVersion = int(self.updateInformations[0].replace("V", "").replace(".", ""))
except:
lastVersion = uni.intversion - 1
if lastVersion > uni.intversion:
self.pbtnDownloadAndInstall.setVisible(True)
self.pbtnRemindMeLater.setVisible(True)
self.cbRemindMeLater.setVisible(True)
details = ""
for detail in self.updateInformations[4:]:
details += detail + "<br>"
self.lblInfo.setText(str(translate("UpdateControl",
"Version %s is available. Please download and install the new release.<br>" +
"%s For detailed information: <a href='%s' target='_blank'>Hamsi Manager</a><br>You can download from <a href='%s' target='_blank'>Hamsi Manager %s</a>")) % (
self.updateInformations[0] + self.updateInformations[3],
details,
self.updateInformations[2], self.updateInformations[1],
self.updateInformations[0]))
self.setFixedHeight(330)
elif lastVersion < uni.intversion:
self.pbtnDownloadAndInstall.setVisible(True)
if self.isNotInstall is False:
self.pbtnDownloadAndInstall.setText(
translate("UpdateControl", "Download and Install") + " (!)")
else:
self.pbtnDownloadAndInstall.setText(translate("UpdateControl", "Download") + " (!)")
self.pbtnRemindMeLater.setVisible(True)
self.cbRemindMeLater.setVisible(True)
details = ""
for detail in self.updateInformations[4:]:
details += detail + "<br>"
self.lblInfo.setText(str(str(translate("UpdateControl",
"Lastest stable version is %s. You currently are using the version for developers.You can continue to use the current version.<br>If you want a more accurate version, please download and install this version.<br>%s For detailed information: <a href='%s' target='_blank'>Hamsi Manager</a><br>You can download from <a href='%s' target='_blank'>Hamsi Manager %s</a>")) % (
self.updateInformations[0] + self.updateInformations[3],
details, self.updateInformations[2],
self.updateInformations[1], self.updateInformations[0])))
self.pbtnCancel.setText(translate("UpdateControl", "Ok"))
self.pbtnCheckForDeveloperVersion.setVisible(True)
self.setFixedHeight(330)
else:
self.lblInfo.setText(str(translate("UpdateControl",
"You are already using the latest release.<br>For detailed information: <a href='%s' target='_blank'>Hamsi Manager</a>")) % (
self.updateInformations[2]))
self.pbtnCancel.setText(translate("UpdateControl", "Ok"))
uni.setMySetting("lastUpdateControlDate", datetime.now().strftime("%Y %m %d %H %M %S"))
else:
uni.setMySetting("lastUpdateControlDate", datetime.now().strftime("%Y %m %d %H %M %S"))
Dialogs.showError(translate("UpdateControl", "Cannot Fetch Release Information"),
translate("UpdateControl",
"Cannot fetch release information. Please retry later.<br>If you are constantly receiving this error, please visit \"http://hamsiapps.com/HamsiManager\"."))
self.close()
else:
uni.setMySetting("lastUpdateControlDate", datetime.now().strftime("%Y %m %d %H %M %S"))
Dialogs.showError(translate("UpdateControl", "Cannot Fetch Release Information"),
translate("UpdateControl",
"Cannot fetch release information. Please retry later.<br>If you are constantly receiving this error, please visit \"http://hamsiapps.com/HamsiManager\"."))
self.close()
else:
self.lblInfo.setText(translate("UpdateControl", "Download complete."))
else:
uni.setMySetting("lastUpdateControlDate", datetime.now().strftime("%Y %m %d %H %M %S"))
Dialogs.showError(translate("UpdateControl", "Cannot Fetch Release Information"),
translate("UpdateControl",
"Cannot fetch release information. Please retry later.<br>If you are constantly receiving this error, please visit \"http://hamsiapps.com/HamsiManager\"."))
self.close()
except:
ReportBug.ReportBug()