本文整理汇总了Python中Tc2Config.settingsValue方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.settingsValue方法的具体用法?Python Tc2Config.settingsValue怎么用?Python Tc2Config.settingsValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tc2Config
的用法示例。
在下文中一共展示了Tc2Config.settingsValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.layout()
self._splitter.restoreState( Tc2Config.settingsValue(self.SettingsKeySplitterState, QtCore.QByteArray()).toByteArray() )
self._listWidget.setCurrentRow( Tc2Config.settingsValue(self.SettingsKeyCurrentSettingIndex, 0).toInt()[0] )
self._listWidget.setAlternatingRowColors(globalObject.settingsGlobal.alternatingRowColors())
globalObject.settingsGlobal.alternatingRowColorsChanged.connect(self._listWidget.setAlternatingRowColors)
示例2: onInitSettings
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onInitSettings(self):
self.layout()
value = Tc2Config.settingsValue(self.SettingsKeyProxyHostName, '').toString()
self.editProxyHostName.setText(value)
self.editProxyHostName.textChanged.connect(self.setProxyHostName)
value, ok = Tc2Config.settingsValue(self.SettingsKeyProxyPort, '').toInt()
if not ok or value > Tc2Config.MaxProxyPort or value < Tc2Config.MinProxyPort:
value = Tc2Config.DefaultProxyPort
self.spinProxyPort.setValue(value)
self.spinProxyPort.valueChanged.connect(self.setProxyPort)
value = Tc2Config.settingsValue(self.SettingsKeyProxyUserName, '').toString()
self.editProxyUserName.setText(value)
self.editProxyUserName.textChanged.connect(self.setProxyUserName)
self.editProxyPassword.textChanged.connect(self.setProxyPassword)
value, ok = Tc2Config.settingsValue(self.SettingsKeyFetchTimeout, '').toDouble()
if not ok or value > Tc2Config.MaxFetchTimeout or value < Tc2Config.MinFetchTimeout:
value = Tc2Config.DefaultFetchTimeout
self.spinFetchTimeout.setValue(value)
self.spinFetchTimeout.valueChanged.connect(self.setFetchTimeout)
Tc2Config.globalObject.objectCreatedSettingsNetwork.emit(self)
示例3: fromConfig
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def fromConfig(klass, settingsKey):
id = None
key = ''
hotkeyName = ''
baseValue = None
multiplier = None
id = Tc2Config.settingsValue( (settingsKey, 'ID'), '').toString()
if id != klass.id():
return None
#TODO: rename to "Key"
key = Tc2Config.settingsValue( (settingsKey, 'Hotkey'), Tc2Config.KeyNone).toString()
if key == Tc2Config.KeyNone:
return None
hotkeyName = Tc2Config.settingsValue( (settingsKey, 'HotkeyName'), '').toString()
if klass.HasMultiplier:
multiplier, ok = Tc2Config.settingsValue( (settingsKey, 'Multiplier'), -1.0).toDouble()
if not ok:
return None
if multiplier > klass.MultiplierMax or multiplier < klass.MultiplierMin:
return None
if klass.HasBaseValue:
baseValue = Tc2Config.settingsValue( (settingsKey, 'BaseValue'), '').toString()
if baseValue not in klass.BaseValues:
return None
return klass(key=key, hotkeyName=hotkeyName, baseValue=baseValue, multiplier=multiplier)
示例4: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.layout()
vipStatus = Tc2Config.settingsValue(self.SettingsKeyVIPStatus, '').toString()
index = self.comboVIPStatus.findText(vipStatus, QtCore.Qt.MatchExactly)
if index >= 0:
self.comboVIPStatus.setCurrentIndex(index)
self.comboVIPStatus.currentIndexChanged.connect(self.onComboVIPStatusCurrentIndexChanged)
gameType = Tc2Config.settingsValue(self.SettingsKeyGameType, '').toString()
index = self.comboGameType.findText(gameType, QtCore.Qt.MatchExactly)
if index >= 0:
self.comboGameType.setCurrentIndex(index)
self.comboGameType.currentIndexChanged.connect(self.onComboGameTypeCurrentIndexChanged)
currency = Tc2Config.settingsValue(self.SettingsKeyCurrency, '').toString()
index = self.comboCurrency.findText(currency, QtCore.Qt.MatchExactly)
if index >= 0:
self.comboCurrency.setCurrentIndex(index)
self.comboCurrency.currentIndexChanged.connect(self.onComboCurrencyCurrentIndexChanged)
conversion = Tc2Config.settingsValue(self.SettingsKeyConversion, '').toString()
if conversion == 'FPPs':
self.radioFPPs.setChecked(True)
else:
self.radioCash.setChecked(True)
示例5: onInitSettings
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onInitSettings(self):
self.layout()
value = QtCore.Qt.Checked if Tc2Config.settingsValue(self.SettingsKeyAutoClosePopupNews, False).toBool() else QtCore.Qt.Unchecked
self.checkAutoClosePopupNews.setCheckState(value)
self.checkAutoClosePopupNews.stateChanged.connect(
lambda value, self=self: self.setAutoClosePopupNews(self.checkAutoClosePopupNews.checkState() == QtCore.Qt.Checked)
)
value = QtCore.Qt.Checked if Tc2Config.settingsValue(self.SettingsKeyAutoCloseTourneyRegistrationBoxes, False).toBool() else QtCore.Qt.Unchecked
self.checkAutoCloseTourneyRegistrationBoxes.setCheckState(value)
self.checkAutoCloseTourneyRegistrationBoxes.stateChanged.connect(
lambda value, self=self: self.setAutoCloseTourneyRegistrationBoxes(self.checkAutoCloseTourneyRegistrationBoxes.checkState() == QtCore.Qt.Checked)
)
value = QtCore.Qt.Checked if Tc2Config.settingsValue(self.SettingsKeyAutoCloseTableMessageBoxes, False).toBool() else QtCore.Qt.Unchecked
self.checkAutoCloseTableMessageBoxes.setCheckState(value)
self.checkAutoCloseTableMessageBoxes.stateChanged.connect(
lambda value, self=self: self.setAutoCloseTableMessageBoxes(self.checkAutoCloseTableMessageBoxes.checkState() == QtCore.Qt.Checked)
)
value = QtCore.Qt.Checked if Tc2Config.settingsValue(self.SettingsKeyAutoCloseLogin, False).toBool() else QtCore.Qt.Unchecked
self.checkAutoCloselogin.setCheckState(value)
self.checkAutoCloselogin.stateChanged.connect(
lambda value, self=self: self.setAutoCloseLogin(self.checkAutoCloselogin.checkState() == QtCore.Qt.Checked)
)
value = QtCore.Qt.Checked if Tc2Config.settingsValue(self.SettingsKeyMoveMouseToActiveTable, False).toBool() else QtCore.Qt.Unchecked
self.checkMoveMouseToActiveTable.setCheckState(value)
self.checkMoveMouseToActiveTable.stateChanged.connect(
lambda value, self=self: self.setMoveMouseToActiveTable(self.checkMoveMouseToActiveTable.checkState() == QtCore.Qt.Checked)
)
Tc2Config.globalObject.objectCreatedSettingsPokerStars.emit(self)
示例6: layout
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def layout(self):
grid = Tc2Config.GridBox(self)
grid.col(self.toolBar)
grid.row()
grid.col(self.splitterSettings)
grid.row()
grid.col(Tc2Config.HLine())
grid.row()
grid.col(self.buttonBox)
grid = Tc2Config.GridBox(self.frameSettings)
grid.col(self.checkBoxChars).col(self.editChars)
grid.row()
grid.col(self.checkBoxGraylevel).col(self.spinGrayLevel)
grid.row()
grid.col(self.checkBoxDustSize).col(self.spinDustSize)
grid.row()
grid.col(self.checkBoxWordSpacing).col(self.spinWordSpacing)
grid.row()
grid.col(self.checkBoxCertainty).col(self.spinCertainty)
grid.row()
grid.col(Tc2Config.HLine(), colspan=2)
grid.row()
grid.col(self.checkBoxInvertImage)
grid.row()
grid.col(self.checkBoxAnalyzeLayout)
grid.row()
grid.col(self.checkBoxContextCorrection)
grid.row()
grid.col(self.checkBoxCompareUnknownChars)
grid.row()
grid.col(self.checkBoxDivideOverlappingChars)
grid.row()
grid.col(self.checkBoxPackChars)
grid.row()
grid.col(Tc2Config.HLine(), colspan=2)
grid.row()
grid.col(self.checkBoxOutputType).col(self.comboOutputType)
grid.row()
grid.col(self.checkBoxOutputPattern, colspan=2)
grid.row()
grid.col(self.editOutputPattern, colspan=2)
self.restoreGeometry( Tc2Config.settingsValue(self.SettingsKeyGeometry, QtCore.QByteArray()).toByteArray())
self.splitterSettings.restoreState( Tc2Config.settingsValue(self.SettingsKeySplitterSettingsState, QtCore.QByteArray()).toByteArray() )
self.splitterImage.restoreState( Tc2Config.settingsValue(self.SettingsKeySplitterImageState, QtCore.QByteArray()).toByteArray() )
self.splitterOutput.restoreState( Tc2Config.settingsValue(self.SettingsKeySplitterOutputState, QtCore.QByteArray()).toByteArray() )
示例7: __init__
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def __init__(self, topic, parent=None):
QtGui.QDialog.__init__(self, parent)
self.setWindowTitle(Tc2Config.dialogTitle('Help') )
self.setWindowIcon( QtGui.QIcon(Tc2Config.Pixmaps.tableCrab()) )
self.buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok, QtCore.Qt.Horizontal, self)
self.buttonBox.accepted.connect(self.accept)
self.frameHelp = FrameHelp(parent=self)
self.layout()
self.frameHelp.onGlobalObjectInitSettingsFinished(Tc2Config.globalObject)
#NOTE: we do not save zoom factor on instant help. instant help settings are temporary
self.frameHelp.setSettingsPersistent(False)
self.restoreGeometry( Tc2Config.settingsValue(self.SettingsKeyGeometry, QtCore.QByteArray()).toByteArray() )
self.frameHelp.splitter.restoreState( Tc2Config.settingsValue(self.SettingsKeySplitterState, QtCore.QByteArray()).toByteArray() )
self.frameHelp.setTopic(topic)
示例8: onLabelFeedbackDoubleClicked
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [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() )
示例9: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self._tabWidget.setCurrentIndex( Tc2Config.settingsValue(self.SettingsKeyTabCurrent, QtCore.QVariant()).toInt()[0] )
position = self._tabWidget.South if globalObject.settingsGlobal.tabPosition() == Tc2Config.TabPositionBottom else self._tabWidget.North
self._tabWidget.setTabPosition(position)
globalObject.settingsGlobal.tabPositionChanged.connect(
lambda value, self=self: self._tabWidget.setTabPosition(self._tabWidget.South if value == Tc2Config.TabPositionBottom else self._tabWidget.North)
)
示例10: onButtonBackupClicked
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [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
示例11: __init__
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setWindowTitle('Card Protector')
flags = self.windowFlags()
flags |= QtCore.Qt.Tool
self.setWindowFlags(flags)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self._isInited = False
self.scrollArea = QtGui.QScrollArea(self)
#NOTE: kind of don't like the frame here. good idea or not?
self.scrollArea.setFrameShape(QtGui.QFrame.NoFrame)
layout= QtGui.QHBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.scrollArea)
self.scrollArea.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
self.label = QtGui.QLabel(self.scrollArea)
self.scrollArea.setWidget(self.label)
self.autoToggleTimer = QtCore.QTimer(self)
self.autoToggleTimer.setSingleShot(True)
self.autoToggleTimer.timeout.connect(self.onAutoToggleTimer)
Tc2Config.globalObject.closeEvent.connect(self.closeEvent)
Tc2Config.globalObject.initSettingsFinished.connect(self.onGlobalObjectInitSettingsFinished)
self.restoreGeometry( Tc2Config.settingsValue(Tc2GuiSettingsCardProtector.FrameSettings.SettingsKeyGeometry, QtCore.QByteArray()).toByteArray() )
示例12: fromConfig
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def fromConfig(klass, key):
kws = {}
id = Tc2Config.settingsValue( (key, 'ID'), '').toString()
if id != klass.id():
return None
kws['name'] = Tc2Config.settingsValue( (key, 'Name'), 'None').toString()
size = Tc2Config.settingsValue( (key, 'Size'), Tc2Config.newSizeNone() ).toSize()
if not size.isValid():
size = Tc2Config.newSizeNone()
kws['size'] = size
kws['itemIsExpanded'] = Tc2Config.settingsValue( (key, 'ItemIsExpanded'), False).toBool()
for pointName in klass.PointNames:
point = Tc2Config.settingsValue((key, pointName), Tc2Config.newPointNone()).toPoint()
if not Tc2Config.pointInSize(size, point):
point = Tc2Config.newPointNone()
kws[pointName] = point
return klass(**kws)
示例13: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.layout()
self.comboBox.currentIndexChanged.connect(self.onComboBoxCurrentIndexChanged)
self._browser.setHtml('')
#NOTE: editingFinished() is only emitted when the whole mask is filled in so we need to connect to textChanged()
self.editPayoutStructure.textChanged.connect(self.onEditPayoutStructureTextChanged)
value, ok = Tc2Config.settingsValue(self.SettingsKeyPayoutStructureCurrent, 0).toInt()
if ok:
self.comboBox.setCurrentIndex(value)
示例14: setFixedFont
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def setFixedFont(self):
font = QtGui.QFont()
settings = QtWebKit.QWebSettings.globalSettings()
# try to read QWebKit FixedFont from config, if not take it from QWebKit FixedFont
if font.fromString(Tc2Config.settingsValue(Tc2Config.SettingsKeyFontFixed, '').toString() ):
settings.setFontFamily(settings.FixedFont, font.family() )
settings.setFontSize(settings.DefaultFixedFontSize, font.pointSize() )
else:
font.setFamily( settings.fontFamily(settings.FixedFont) )
font.setPointSize( settings.fontSize(settings.DefaultFixedFontSize) )
self.buttonFixedFont.setText( QtCore.QString('%1 %2').arg(font.family()).arg(font.pointSize()) )
示例15: onComboBoxCurrentIndexChanged
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import settingsValue [as 别名]
def onComboBoxCurrentIndexChanged(self, i):
payoutStructure, mask = self.PayoutStructures[i][1], self.PayoutStructures[i][2]
if i == len(self.PayoutStructures) -1:
payoutStructure = Tc2Config.settingsValue(self.SettingsKeyCustomPayoutStructure, '').toString()
self.editPayoutStructure.setInputMask(mask)
self.editPayoutStructure.setText(payoutStructure)
self.editPayoutStructure.setEnabled(bool(mask))
self.editPayoutStructure.home(False)
hand, self.lastHand = self.lastHand, None
self.handleHandSet(hand)