- changed instance varaibles to camelCase

bzr-revno: 1715
This commit is contained in:
Andreas Preikschat 2011-08-20 10:24:17 +02:00
commit d668f2d87c

View File

@ -44,85 +44,85 @@ class AlertsTab(SettingsTab):
self.fontGroupBox.setObjectName(u'fontGroupBox') self.fontGroupBox.setObjectName(u'fontGroupBox')
self.fontLayout = QtGui.QFormLayout(self.fontGroupBox) self.fontLayout = QtGui.QFormLayout(self.fontGroupBox)
self.fontLayout.setObjectName(u'fontLayout') self.fontLayout.setObjectName(u'fontLayout')
self.FontLabel = QtGui.QLabel(self.fontGroupBox) self.fontLabel = QtGui.QLabel(self.fontGroupBox)
self.FontLabel.setObjectName(u'FontLabel') self.fontLabel.setObjectName(u'fontLabel')
self.FontComboBox = QtGui.QFontComboBox(self.fontGroupBox) self.fontComboBox = QtGui.QFontComboBox(self.fontGroupBox)
self.FontComboBox.setObjectName(u'FontComboBox') self.fontComboBox.setObjectName(u'fontComboBox')
self.fontLayout.addRow(self.FontLabel, self.FontComboBox) self.fontLayout.addRow(self.fontLabel, self.fontComboBox)
self.FontColorLabel = QtGui.QLabel(self.fontGroupBox) self.fontColorLabel = QtGui.QLabel(self.fontGroupBox)
self.FontColorLabel.setObjectName(u'FontColorLabel') self.fontColorLabel.setObjectName(u'fontColorLabel')
self.ColorLayout = QtGui.QHBoxLayout() self.colorLayout = QtGui.QHBoxLayout()
self.ColorLayout.setObjectName(u'ColorLayout') self.colorLayout.setObjectName(u'colorLayout')
self.FontColorButton = QtGui.QPushButton(self.fontGroupBox) self.fontColorButton = QtGui.QPushButton(self.fontGroupBox)
self.FontColorButton.setObjectName(u'FontColorButton') self.fontColorButton.setObjectName(u'fontColorButton')
self.ColorLayout.addWidget(self.FontColorButton) self.colorLayout.addWidget(self.fontColorButton)
self.ColorLayout.addSpacing(20) self.colorLayout.addSpacing(20)
self.BackgroundColorLabel = QtGui.QLabel(self.fontGroupBox) self.backgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel') self.backgroundColorLabel.setObjectName(u'backgroundColorLabel')
self.ColorLayout.addWidget(self.BackgroundColorLabel) self.colorLayout.addWidget(self.backgroundColorLabel)
self.BackgroundColorButton = QtGui.QPushButton(self.fontGroupBox) self.backgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
self.BackgroundColorButton.setObjectName(u'BackgroundColorButton') self.backgroundColorButton.setObjectName(u'backgroundColorButton')
self.ColorLayout.addWidget(self.BackgroundColorButton) self.colorLayout.addWidget(self.backgroundColorButton)
self.fontLayout.addRow(self.FontColorLabel, self.ColorLayout) self.fontLayout.addRow(self.fontColorLabel, self.colorLayout)
self.FontSizeLabel = QtGui.QLabel(self.fontGroupBox) self.fontSizeLabel = QtGui.QLabel(self.fontGroupBox)
self.FontSizeLabel.setObjectName(u'FontSizeLabel') self.fontSizeLabel.setObjectName(u'fontSizeLabel')
self.FontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox) self.fontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox') self.fontSizeSpinBox.setObjectName(u'fontSizeSpinBox')
self.fontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox) self.fontLayout.addRow(self.fontSizeLabel, self.fontSizeSpinBox)
self.TimeoutLabel = QtGui.QLabel(self.fontGroupBox) self.timeoutLabel = QtGui.QLabel(self.fontGroupBox)
self.TimeoutLabel.setObjectName(u'TimeoutLabel') self.timeoutLabel.setObjectName(u'timeoutLabel')
self.TimeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox) self.timeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.TimeoutSpinBox.setMaximum(180) self.timeoutSpinBox.setMaximum(180)
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox) self.fontLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
create_valign_combo(self, self.fontGroupBox, self.fontLayout) create_valign_combo(self, self.fontGroupBox, self.fontLayout)
self.leftLayout.addWidget(self.fontGroupBox) self.leftLayout.addWidget(self.fontGroupBox)
self.leftLayout.addStretch() self.leftLayout.addStretch()
self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn) self.previewGroupBox = QtGui.QGroupBox(self.rightColumn)
self.PreviewGroupBox.setObjectName(u'PreviewGroupBox') self.previewGroupBox.setObjectName(u'previewGroupBox')
self.PreviewLayout = QtGui.QVBoxLayout(self.PreviewGroupBox) self.previewLayout = QtGui.QVBoxLayout(self.previewGroupBox)
self.PreviewLayout.setObjectName(u'PreviewLayout') self.previewLayout.setObjectName(u'previewLayout')
self.FontPreview = QtGui.QLineEdit(self.PreviewGroupBox) self.fontPreview = QtGui.QLineEdit(self.previewGroupBox)
self.FontPreview.setObjectName(u'FontPreview') self.fontPreview.setObjectName(u'fontPreview')
self.PreviewLayout.addWidget(self.FontPreview) self.previewLayout.addWidget(self.fontPreview)
self.rightLayout.addWidget(self.PreviewGroupBox) self.rightLayout.addWidget(self.previewGroupBox)
self.rightLayout.addStretch() self.rightLayout.addStretch()
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.BackgroundColorButton, QtCore.QObject.connect(self.backgroundColorButton,
QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked) QtCore.SIGNAL(u'pressed()'), self.onBackgroundColorButtonClicked)
QtCore.QObject.connect(self.FontColorButton, QtCore.QObject.connect(self.fontColorButton,
QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked) QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
QtCore.QObject.connect(self.FontComboBox, QtCore.QObject.connect(self.fontComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked) QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
QtCore.QObject.connect(self.TimeoutSpinBox, QtCore.QObject.connect(self.timeoutSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
QtCore.QObject.connect(self.FontSizeSpinBox, QtCore.QObject.connect(self.fontSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.fontGroupBox.setTitle( self.fontGroupBox.setTitle(
translate('AlertsPlugin.AlertsTab', 'Font')) translate('AlertsPlugin.AlertsTab', 'Font'))
self.FontLabel.setText( self.fontLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Font name:')) translate('AlertsPlugin.AlertsTab', 'Font name:'))
self.FontColorLabel.setText( self.fontColorLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Font color:')) translate('AlertsPlugin.AlertsTab', 'Font color:'))
self.BackgroundColorLabel.setText( self.backgroundColorLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Background color:')) translate('AlertsPlugin.AlertsTab', 'Background color:'))
self.FontSizeLabel.setText( self.fontSizeLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Font size:')) translate('AlertsPlugin.AlertsTab', 'Font size:'))
self.FontSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit) self.fontSizeSpinBox.setSuffix(UiStrings().FontSizePtUnit)
self.TimeoutLabel.setText( self.timeoutLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.TimeoutSpinBox.setSuffix(UiStrings().Seconds) self.timeoutSpinBox.setSuffix(UiStrings().Seconds)
self.PreviewGroupBox.setTitle(UiStrings().Preview) self.previewGroupBox.setTitle(UiStrings().Preview)
self.FontPreview.setText(UiStrings().OLPV2) self.fontPreview.setText(UiStrings().OLPV2)
def onBackgroundColorButtonClicked(self): def onBackgroundColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor( new_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.bg_color), self) QtGui.QColor(self.bg_color), self)
if new_color.isValid(): if new_color.isValid():
self.bg_color = new_color.name() self.bg_color = new_color.name()
self.BackgroundColorButton.setStyleSheet( self.backgroundColorButton.setStyleSheet(
u'background-color: %s' % self.bg_color) u'background-color: %s' % self.bg_color)
self.updateDisplay() self.updateDisplay()
@ -134,15 +134,15 @@ class AlertsTab(SettingsTab):
QtGui.QColor(self.font_color), self) QtGui.QColor(self.font_color), self)
if new_color.isValid(): if new_color.isValid():
self.font_color = new_color.name() self.font_color = new_color.name()
self.FontColorButton.setStyleSheet( self.fontColorButton.setStyleSheet(
u'background-color: %s' % self.font_color) u'background-color: %s' % self.font_color)
self.updateDisplay() self.updateDisplay()
def onTimeoutSpinBoxChanged(self): def onTimeoutSpinBoxChanged(self):
self.timeout = self.TimeoutSpinBox.value() self.timeout = self.timeoutSpinBox.value()
def onFontSizeSpinBoxChanged(self): def onFontSizeSpinBoxChanged(self):
self.font_size = self.FontSizeSpinBox.value() self.font_size = self.fontSizeSpinBox.value()
self.updateDisplay() self.updateDisplay()
def load(self): def load(self):
@ -160,16 +160,16 @@ class AlertsTab(SettingsTab):
self.location = settings.value( self.location = settings.value(
u'location', QtCore.QVariant(1)).toInt()[0] u'location', QtCore.QVariant(1)).toInt()[0]
settings.endGroup() settings.endGroup()
self.FontSizeSpinBox.setValue(self.font_size) self.fontSizeSpinBox.setValue(self.font_size)
self.TimeoutSpinBox.setValue(self.timeout) self.timeoutSpinBox.setValue(self.timeout)
self.FontColorButton.setStyleSheet( self.fontColorButton.setStyleSheet(
u'background-color: %s' % self.font_color) u'background-color: %s' % self.font_color)
self.BackgroundColorButton.setStyleSheet( self.backgroundColorButton.setStyleSheet(
u'background-color: %s' % self.bg_color) u'background-color: %s' % self.bg_color)
self.verticalComboBox.setCurrentIndex(self.location) self.verticalComboBox.setCurrentIndex(self.location)
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily(self.font_face) font.setFamily(self.font_face)
self.FontComboBox.setCurrentFont(font) self.fontComboBox.setCurrentFont(font)
self.updateDisplay() self.updateDisplay()
def save(self): def save(self):
@ -178,7 +178,7 @@ class AlertsTab(SettingsTab):
settings.setValue(u'background color', QtCore.QVariant(self.bg_color)) settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
settings.setValue(u'font color', QtCore.QVariant(self.font_color)) settings.setValue(u'font color', QtCore.QVariant(self.font_color))
settings.setValue(u'font size', QtCore.QVariant(self.font_size)) settings.setValue(u'font size', QtCore.QVariant(self.font_size))
self.font_face = self.FontComboBox.currentFont().family() self.font_face = self.fontComboBox.currentFont().family()
settings.setValue(u'font face', QtCore.QVariant(self.font_face)) settings.setValue(u'font face', QtCore.QVariant(self.font_face))
settings.setValue(u'timeout', QtCore.QVariant(self.timeout)) settings.setValue(u'timeout', QtCore.QVariant(self.timeout))
self.location = self.verticalComboBox.currentIndex() self.location = self.verticalComboBox.currentIndex()
@ -187,10 +187,10 @@ class AlertsTab(SettingsTab):
def updateDisplay(self): def updateDisplay(self):
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily(self.FontComboBox.currentFont().family()) font.setFamily(self.fontComboBox.currentFont().family())
font.setBold(True) font.setBold(True)
font.setPointSize(self.font_size) font.setPointSize(self.font_size)
self.FontPreview.setFont(font) self.fontPreview.setFont(font)
self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' % self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' %
(self.bg_color, self.font_color)) (self.bg_color, self.font_color))