本文整理汇总了Python中Tc2Config.settingsSetValue方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.settingsSetValue方法的具体用法?Python Tc2Config.settingsSetValue怎么用?Python Tc2Config.settingsSetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tc2Config
的用法示例。
在下文中一共展示了Tc2Config.settingsSetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setFixedFont
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setFixedFont(self, value):
Tc2Config.settingsSetValue(self.SettingsKeyFontFixed, value.toString())
# adjust WeKit fixed font
settings = QtWebKit.QWebSettings.globalSettings()
settings.setFontFamily(settings.FixedFont, value.family() )
settings.setFontSize(settings.DefaultFixedFontSize, value.pointSize() )
self.fixedFontChanged.emit(value)
示例2: onLabelFeedbackDoubleClicked
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onLabelFeedbackDoubleClicked(self):
lastError = self._feedbackMessages[None]
if lastError:
dlg = Tc2DialogException.DialogException(lastError, parent=self)
dlg.restoreGeometry( Tc2Config.settingsValue(self.SettingsKeyDialogExceptionGeometry, QtCore.QByteArray()).toByteArray())
dlg.exec_()
Tc2Config.settingsSetValue(self.SettingsKeyDialogExceptionGeometry, dlg.saveGeometry() )
示例3: onButtonBackupClicked
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onButtonBackupClicked(self, checked):
dlg = QtGui.QFileDialog(self)
dlg.setWindowTitle('Backup tableCrab To Config File..')
dlg.setFileMode(dlg.AnyFile)
dlg.setAcceptMode(dlg.AcceptSave)
dlg.setConfirmOverwrite(True)
filters = QtCore.QStringList()
filters << 'Config Files (*.ini *.cfg)'
filters << 'All Files (*)'
dlg.setNameFilters(filters)
dlg.restoreState( Tc2Config.settingsValue(self.SettingsKeyDialogBackupState, QtCore.QByteArray()).toByteArray() )
result = dlg.exec_()
Tc2Config.settingsSetValue(self.SettingsKeyDialogBackupState, dlg.saveState() )
if result != dlg.Accepted:
return
fileName = dlg.selectedFiles()[0]
fileInfo = QtCore.QFileInfo(fileName)
format = fileInfo.suffix().toLower()
# default save format to to ".ini"
if not format:
fileName = fileName + '.ini'
#NOTE: looks like Qt is only checking for write protect anything else may or may not pass ..and we don't get any IO errors
# so we try in advance. obv there are still loopholes
fp = None
try: fp = open(fileName, 'w').close()
except Exception, d:
Tc2Config.msgWarning(self, 'Could Not Open Config File\n\n%s' % d)
return
示例4: setStyleSheet
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setStyleSheet(self, value):
if Tc2Config.MaxHandStyleSheet >= 0:
if value.length() > Tc2Config.MaxHandStyleSheet:
Tc2Config.globalObject.feedback.emit(self, 'Style sheet too big -- maximum Is %s chars' % Tc2Config.MaxHandStyleSheet)
return
Tc2Config.globalObject.feedback.emit(self, '')
Tc2Config.settingsSetValue(self.SettingsKeyStyleSheet, value)
self.styleSheetChanged.emit(value)
示例5: toConfig
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def toConfig(self, key):
Tc2Config.settingsSetValue( (key, 'ID'), self.id() )
Tc2Config.settingsSetValue( (key, 'Name'), self.name() )
Tc2Config.settingsSetValue( (key, 'Size'), self.size)
Tc2Config.settingsSetValue( (key, 'ItemIsExpanded'), self.itemIsExpanded)
for pointName, point in self.points.items():
Tc2Config.settingsSetValue( (key, pointName), point)
return True
示例6: onCloseEvent
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onCloseEvent(self, event):
Tc2Config.settingsSetValue(self.SettingsKeySplitterState, self.splitter.saveState() )
topicsCollapsed = []
for item in Tc2Config.TreeWidgetItemIterator(self.tree):
if not item.isExpanded():
topic = item.data(0, QtCore.Qt.UserRole).toString()
topicsCollapsed.append(topic)
Tc2Config.settingsSetValue(self.SettingsKeyTopicsCollapsed, topicsCollapsed)
示例7: onEditTextChanged
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onEditTextChanged(self):
text = self.edit.toPlainText()
if Tc2Config.MaxHandStyleSheet >= 0:
if text.length() > Tc2Config.MaxHandStyleSheet:
Tc2Config.globalObject.feedback.emit(self, 'Style sheet too big -- maximum Is %s chars' % Tc2Config.MaxHandStyleSheet)
return
Tc2Config.globalObject.feedback.emit(self, '')
Tc2Config.settingsSetValue(self.SettingsKeyStyleSheet, text)
示例8: onItemSelectionChanged
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onItemSelectionChanged(self):
items = self.tree.selectedItems()
if not items: return
item = items[0]
topic = item.data(0, QtCore.Qt.UserRole).toString()
url = QtCore.QUrl('%s.html' % topic)
self.browser.setUrl(url)
if self._settingsPersistent:
Tc2Config.settingsSetValue(self.SettingsKeyHelpTopic, topic)
示例9: onActionValueChanged
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def onActionValueChanged(self, edit, text):
formatter = Tc2Config.handFormatter('HtmlTabular')
if edit.isPrefix:
formatter.setActionPrefix(edit.action, text)
settingsKey = self.HandActionsMapping[edit.action][1]
else:
formatter.setActionPostfix(edit.action, text)
settingsKey = self.HandActionsMapping[edit.action][2]
Tc2Config.settingsSetValue(settingsKey, text)
示例10: setGuiStyle
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setGuiStyle(self, value):
style = QtGui.QStyleFactory.create(value)
#TODO: we currently set no palette. QStyle docs say palette should not be set
# for styles that use system defaults, but there seems to be no way to find out
# so ..and where to find some kind of default palette.
##QtGui.qApp.setPalette(style.standardPalette())
QtGui.qApp.setStyle(style)
Tc2Config.settingsSetValue(self.SettingsKeyGuiStyle, value)
self.guiStyleChanged.emit(value)
示例11: setStyleSheet
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setStyleSheet(self, value):
if Tc2Config.MaxHandStyleSheet >= 0:
if len(value) > Tc2Config.MaxHandStyleSheet:
Tc2Config.globalObject.feedback.emit(self, 'Style sheet too big -- maximum Is %s chars' % Tc2Config.MaxHandStyleSheet)
return
Tc2Config.globalObject.feedback.emit(self, '')
Tc2Config.settingsSetValue(self.SettingsKeyStyleSheet, value)
formatter = Tc2Config.handFormatter('HtmlTabular')
formatter.setStyleSheet(value)
示例12: setTopic
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setTopic(self, topic):
for item in Tc2Config.TreeWidgetItemIterator(self.tree):
myTopic = item.data(0, QtCore.Qt.UserRole).toString()
if myTopic == topic:
self.tree.setCurrentItem(item)
break
else:
raise ValueError('no such topic: %s' % topic)
if not self._settingsPersistent:
Tc2Config.settingsSetValue(self.SettingsKeyHelpTopic, topic)
示例13: closeEvent
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def closeEvent(self, event):
self.singleApplication.close()
Tc2Config.globalObject.closeEvent.emit(event)
Tc2Config.globalObject.mouseHook.stop()
Tc2Config.globalObject.keyboardHook.stop()
Tc2Config.globalObject.windowHook.stop()
Tc2Config.settingsSetValue(self.SettingsKeyTabCurrent, self._tabWidget.currentIndex())
Tc2Config.settingsSetValue(self.SettingsKeyGeometry, self.saveGeometry() )
return QtGui.QMainWindow.closeEvent(self, event)
示例14: toConfig
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def toConfig(self, settingsKey):
Tc2Config.settingsSetValue( (settingsKey, 'ID'), self.id() )
#TODO: rename to "Key"
Tc2Config.settingsSetValue((settingsKey, 'Hotkey'), self.key() )
Tc2Config.settingsSetValue( (settingsKey, 'HotkeyName'), self.hotkeyName() )
if self.HasMultiplier:
Tc2Config.settingsSetValue( (settingsKey, 'Multiplier'), self.multiplier())
if self.HasBaseValue:
Tc2Config.settingsSetValue( (settingsKey, 'BaseValue'), self.baseValue())
return True
示例15: setGuiFont
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsSetValue [as 别名]
def setGuiFont(self, value):
Tc2Config.settingsSetValue(self.SettingsKeyGuiFont, value.toString())
QtGui.qApp.setFont(value)
#NOTE: have to re-set style to make font changes work as expected
self.setGuiStyle(self.guiStyle())
# take QWebKit StandardFont from application font
settings = QtWebKit.QWebSettings.globalSettings()
settings.setFontFamily(settings.StandardFont, value.family() )
settings.setFontSize(settings.DefaultFontSize, value.pointSize() )
self.guiFontChanged.emit(value)