2009-04-11 05:43:52 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
"""
|
|
|
|
OpenLP - Open Source Lyrics Projection
|
|
|
|
Copyright (c) 2008 Raoul Snyman
|
|
|
|
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
|
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
"""
|
|
|
|
import logging
|
2009-04-11 15:16:02 +00:00
|
|
|
import os, os.path
|
2009-04-11 05:43:52 +00:00
|
|
|
|
|
|
|
from PyQt4 import QtCore, QtGui
|
2009-05-21 05:15:51 +00:00
|
|
|
from openlp.core.lib import ThemeXML, Renderer, file_to_xml, translate
|
2009-04-11 05:43:52 +00:00
|
|
|
|
|
|
|
from amendthemedialog import Ui_AmendThemeDialog
|
|
|
|
|
|
|
|
log = logging.getLogger(u'AmendThemeForm')
|
|
|
|
|
|
|
|
class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
def __init__(self, thememanager, parent=None):
|
2009-04-11 05:43:52 +00:00
|
|
|
QtGui.QDialog.__init__(self, parent)
|
2009-04-19 19:12:18 +00:00
|
|
|
self.thememanager = thememanager
|
2009-05-22 05:14:55 +00:00
|
|
|
# Needed here as UI setup generates Events
|
|
|
|
self.path = None
|
|
|
|
self.theme = ThemeXML()
|
2009-04-11 05:43:52 +00:00
|
|
|
self.setupUi(self)
|
|
|
|
|
2009-04-11 07:33:45 +00:00
|
|
|
#define signals
|
|
|
|
#Buttons
|
|
|
|
QtCore.QObject.connect(self.Color1PushButton ,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onColor1PushButtonClicked)
|
2009-04-11 07:33:45 +00:00
|
|
|
QtCore.QObject.connect(self.Color2PushButton ,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onColor2PushButtonClicked)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainColorPushButton,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onFontMainColorPushButtonClicked)
|
2009-04-11 07:33:45 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterColorPushButton,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onFontFooterColorPushButtonClicked)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.OutlineColorPushButton,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onOutlineColorPushButtonClicked)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.ShadowColorPushButton,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onShadowColorPushButtonClicked)
|
2009-05-16 10:24:03 +00:00
|
|
|
QtCore.QObject.connect(self.ImageToolButton,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'pressed()'), self.onImageToolButtonClicked)
|
2009-04-11 07:33:45 +00:00
|
|
|
#Combo boxes
|
|
|
|
QtCore.QObject.connect(self.BackgroundComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onBackgroundComboBoxSelected)
|
2009-04-11 07:33:45 +00:00
|
|
|
QtCore.QObject.connect(self.BackgroundTypeComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onBackgroundTypeComboBoxSelected)
|
2009-04-11 07:33:45 +00:00
|
|
|
QtCore.QObject.connect(self.GradientComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onGradientComboBoxSelected)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onFontMainComboBoxSelected)
|
2009-08-01 19:25:53 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainWeightComboBox,
|
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onFontMainWeightComboBoxSelected)
|
2009-04-20 20:03:04 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onFontFooterComboBoxSelected)
|
2009-08-01 19:25:53 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterWeightComboBox,
|
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onFontFooterWeightComboBoxSelected)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.HorizontalComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onHorizontalComboBoxSelected)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.VerticalComboBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'activated(int)'), self.onVerticalComboBoxSelected)
|
2009-08-01 19:25:53 +00:00
|
|
|
#Spin boxes
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainSizeSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontMainSizeSpinBoxChanged)
|
2009-04-20 20:03:04 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterSizeSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontFooterSizeSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainDefaultCheckBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onFontMainDefaultCheckBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainXSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontMainXSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainYSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontMainYSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainWidthSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontMainWidthSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontMainHeightSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontMainHeightSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterDefaultCheckBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onFontFooterDefaultCheckBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterXSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontFooterXSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterYSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontFooterYSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterWidthSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontFooterWidthSpinBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
QtCore.QObject.connect(self.FontFooterHeightSpinBox,
|
2009-07-14 19:41:44 +00:00
|
|
|
QtCore.SIGNAL(u'editingFinished()'), self.onFontFooterHeightSpinBoxChanged)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.OutlineCheckBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onOutlineCheckBoxChanged)
|
2009-04-22 17:28:32 +00:00
|
|
|
QtCore.QObject.connect(self.ShadowCheckBox,
|
2009-06-16 18:21:24 +00:00
|
|
|
QtCore.SIGNAL(u'stateChanged(int)'), self.onShadowCheckBoxChanged)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-04-11 07:33:45 +00:00
|
|
|
def accept(self):
|
2009-04-23 18:12:36 +00:00
|
|
|
new_theme = ThemeXML()
|
2009-06-16 18:21:24 +00:00
|
|
|
theme_name = unicode(self.ThemeNameEdit.displayText())
|
2009-04-23 18:12:36 +00:00
|
|
|
new_theme.new_document(theme_name)
|
2009-05-16 19:47:30 +00:00
|
|
|
save_from = None
|
|
|
|
save_to = None
|
2009-08-07 17:19:32 +00:00
|
|
|
if self.theme.background_mode == u'transparent':
|
|
|
|
new_theme.add_background_transparent()
|
2009-05-16 19:47:30 +00:00
|
|
|
else:
|
2009-08-07 17:19:32 +00:00
|
|
|
if self.theme.background_type == u'solid':
|
|
|
|
new_theme.add_background_solid(unicode(self.theme.background_color))
|
|
|
|
elif self.theme.background_type == u'gradient':
|
|
|
|
new_theme.add_background_gradient(unicode(self.theme.background_startColor),
|
|
|
|
unicode(self.theme.background_endColor), self.theme.background_direction)
|
|
|
|
else:
|
|
|
|
(path, filename) =os.path.split(unicode(self.theme.background_filename))
|
|
|
|
new_theme.add_background_image(filename)
|
|
|
|
save_to= os.path.join(self.path, theme_name, filename )
|
|
|
|
save_from = self.theme.background_filename
|
2009-04-23 18:12:36 +00:00
|
|
|
|
2009-06-16 18:21:24 +00:00
|
|
|
new_theme.add_font(unicode(self.theme.font_main_name), unicode(self.theme.font_main_color),
|
|
|
|
unicode(self.theme.font_main_proportion), unicode(self.theme.font_main_override), u'main',
|
2009-08-01 19:25:53 +00:00
|
|
|
unicode(self.theme.font_main_weight), unicode(self.theme.font_main_italics),
|
2009-06-16 18:21:24 +00:00
|
|
|
unicode(self.theme.font_main_x), unicode(self.theme.font_main_y), unicode(self.theme.font_main_width),
|
|
|
|
unicode(self.theme.font_main_height))
|
|
|
|
new_theme.add_font(unicode(self.theme.font_footer_name), unicode(self.theme.font_footer_color),
|
|
|
|
unicode(self.theme.font_footer_proportion), unicode(self.theme.font_footer_override), u'footer',
|
2009-08-01 19:25:53 +00:00
|
|
|
unicode(self.theme.font_footer_weight), unicode(self.theme.font_footer_italics),
|
2009-06-16 18:21:24 +00:00
|
|
|
unicode(self.theme.font_footer_x), unicode(self.theme.font_footer_y), unicode(self.theme.font_footer_width),
|
|
|
|
unicode(self.theme.font_footer_height) )
|
|
|
|
new_theme.add_display(unicode(self.theme.display_shadow), unicode(self.theme.display_shadow_color),
|
|
|
|
unicode(self.theme.display_outline), unicode(self.theme.display_outline_color),
|
|
|
|
unicode(self.theme.display_horizontalAlign), unicode(self.theme.display_verticalAlign),
|
|
|
|
unicode(self.theme.display_wrapStyle))
|
2009-04-23 18:12:36 +00:00
|
|
|
theme = new_theme.extract_xml()
|
2009-05-16 19:47:30 +00:00
|
|
|
self.thememanager.saveTheme(theme_name, theme, save_from, save_to)
|
2009-04-11 07:33:45 +00:00
|
|
|
return QtGui.QDialog.accept(self)
|
|
|
|
|
2009-04-11 05:43:52 +00:00
|
|
|
def loadTheme(self, theme):
|
2009-05-20 20:17:20 +00:00
|
|
|
log.debug(u'LoadTheme %s', theme)
|
2009-04-11 05:43:52 +00:00
|
|
|
if theme == None:
|
2009-04-11 07:33:45 +00:00
|
|
|
self.theme.parse(self.baseTheme())
|
2009-04-11 05:43:52 +00:00
|
|
|
else:
|
2009-05-20 20:17:20 +00:00
|
|
|
xml_file = os.path.join(self.path, theme, theme + u'.xml')
|
2009-05-21 05:15:51 +00:00
|
|
|
xml = file_to_xml(xml_file)
|
2009-04-11 15:16:02 +00:00
|
|
|
self.theme.parse(xml)
|
2009-05-22 05:14:55 +00:00
|
|
|
self.theme.extend_image_filename(self.path)
|
2009-05-16 10:24:03 +00:00
|
|
|
self.allowPreview = False
|
2009-04-11 07:33:45 +00:00
|
|
|
self.paintUi(self.theme)
|
2009-05-16 10:24:03 +00:00
|
|
|
self.allowPreview = True
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-05-16 10:24:03 +00:00
|
|
|
def onImageToolButtonClicked(self):
|
|
|
|
filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file')
|
|
|
|
if filename != "":
|
|
|
|
self.ImageLineEdit.setText(filename)
|
|
|
|
self.theme.background_filename = filename
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
#
|
|
|
|
#Main Font Tab
|
|
|
|
#
|
2009-04-21 19:45:50 +00:00
|
|
|
def onFontMainComboBoxSelected(self):
|
|
|
|
self.theme.font_main_name = self.FontMainComboBox.currentFont().family()
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-08-01 19:25:53 +00:00
|
|
|
def onFontMainWeightComboBoxSelected(self, value):
|
|
|
|
if value ==0:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_main_weight = u'Normal'
|
|
|
|
self.theme.font_main_italics = False
|
2009-08-01 19:25:53 +00:00
|
|
|
elif value == 1:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_main_weight = u'Bold'
|
|
|
|
self.theme.font_main_italics = False
|
2009-08-01 19:25:53 +00:00
|
|
|
elif value == 2:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_main_weight = u'Normal'
|
|
|
|
self.theme.font_main_italics = True
|
2009-08-01 19:25:53 +00:00
|
|
|
else:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_main_weight = u'Bold'
|
|
|
|
self.theme.font_main_italics = True
|
2009-08-01 19:25:53 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-04-22 19:46:10 +00:00
|
|
|
def onFontMainColorPushButtonClicked(self):
|
|
|
|
self.theme.font_main_color = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.font_main_color), self).name()
|
2009-04-22 19:46:10 +00:00
|
|
|
|
|
|
|
self.FontMainColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.font_main_color))
|
2009-04-22 19:46:10 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontMainSizeSpinBoxChanged(self):
|
|
|
|
if self.theme.font_main_proportion != self.FontMainSizeSpinBox.value():
|
|
|
|
self.theme.font_main_proportion = self.FontMainSizeSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
def onFontMainDefaultCheckBoxChanged(self, value):
|
|
|
|
if value == 2: # checked
|
|
|
|
self.theme.font_main_override = False
|
|
|
|
else:
|
|
|
|
self.theme.font_main_override = True
|
2009-04-23 18:12:36 +00:00
|
|
|
|
|
|
|
if int(self.theme.font_main_x) == 0 and int(self.theme.font_main_y) == 0 and \
|
|
|
|
int(self.theme.font_main_width) == 0 and int(self.theme.font_main_height) == 0:
|
|
|
|
self.theme.font_main_x = u'10'
|
|
|
|
self.theme.font_main_y = u'10'
|
|
|
|
self.theme.font_main_width = u'1024'
|
|
|
|
self.theme.font_main_height = u'730'
|
|
|
|
self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
|
|
|
|
self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
|
|
|
|
self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
|
|
|
|
self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
|
2009-04-21 19:45:50 +00:00
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontMainXSpinBoxChanged(self):
|
|
|
|
if self.theme.font_main_x != self.FontMainXSpinBox.value():
|
|
|
|
self.theme.font_main_x = self.FontMainXSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontMainYSpinBoxChanged(self):
|
|
|
|
if self.theme.font_main_y != self.FontMainYSpinBox.value():
|
|
|
|
self.theme.font_main_y = self.FontMainYSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontMainWidthSpinBoxChanged(self):
|
|
|
|
if self.theme.font_main_width != self.FontMainWidthSpinBox.value():
|
|
|
|
self.theme.font_main_width = self.FontMainWidthSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontMainHeightSpinBoxChanged(self):
|
|
|
|
if self.theme.font_main_height != self.FontMainHeightSpinBox.value():
|
|
|
|
self.theme.font_main_height = self.FontMainHeightSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
#
|
|
|
|
#Footer Font Tab
|
|
|
|
#
|
|
|
|
def onFontFooterComboBoxSelected(self):
|
|
|
|
self.theme.font_footer_name = self.FontFooterComboBox.currentFont().family()
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-08-01 19:25:53 +00:00
|
|
|
def onFontFooterWeightComboBoxSelected(self, value):
|
|
|
|
if value == 0:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_footer_weight = u'Normal'
|
|
|
|
self.theme.font_footer_italics = False
|
2009-08-01 19:25:53 +00:00
|
|
|
elif value == 1:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_footer_weight = u'Bold'
|
|
|
|
self.theme.font_footer_italics = False
|
2009-08-01 19:25:53 +00:00
|
|
|
elif value == 2:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_footer_weight = u'Normal'
|
|
|
|
self.theme.font_footer_italics = True
|
2009-08-01 19:25:53 +00:00
|
|
|
else:
|
2009-08-03 19:49:21 +00:00
|
|
|
self.theme.font_footer_weight = u'Bold'
|
|
|
|
self.theme.font_footer_italics = True
|
2009-08-01 19:25:53 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-04-22 19:46:10 +00:00
|
|
|
def onFontFooterColorPushButtonClicked(self):
|
|
|
|
self.theme.font_footer_color = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.font_footer_color), self).name()
|
2009-04-22 19:46:10 +00:00
|
|
|
|
|
|
|
self.FontFooterColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
'background-color: %s' % unicode(self.theme.font_footer_color))
|
2009-04-22 19:46:10 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontFooterSizeSpinBoxChanged(self):
|
|
|
|
if self.theme.font_footer_proportion != self.FontFooterSizeSpinBox.value():
|
|
|
|
self.theme.font_footer_proportion = self.FontFooterSizeSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
def onFontFooterDefaultCheckBoxChanged(self, value):
|
|
|
|
if value == 2: # checked
|
|
|
|
self.theme.font_footer_override = False
|
|
|
|
else:
|
|
|
|
self.theme.font_footer_override = True
|
2009-04-23 18:12:36 +00:00
|
|
|
|
2009-04-30 21:02:28 +00:00
|
|
|
if int(self.theme.font_footer_x) == 0 and int(self.theme.font_footer_y) == 0 and \
|
|
|
|
int(self.theme.font_footer_width) == 0 and int(self.theme.font_footer_height) == 0:
|
|
|
|
self.theme.font_footer_x = u'10'
|
|
|
|
self.theme.font_footer_y = u'730'
|
|
|
|
self.theme.font_footer_width = u'1024'
|
|
|
|
self.theme.font_footer_height = u'38'
|
2009-04-23 18:12:36 +00:00
|
|
|
|
2009-04-30 21:02:28 +00:00
|
|
|
self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
|
|
|
|
self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
|
|
|
|
self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
|
|
|
|
self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
|
2009-04-23 18:12:36 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontFooterXSpinBoxChanged(self):
|
|
|
|
if self.theme.font_footer_x != self.FontFooterXSpinBox.value():
|
|
|
|
self.theme.font_footer_x = self.FontFooterXSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontFooterYSpinBoxChanged(self):
|
|
|
|
if self.theme.font_footer_y != self.FontFooterYSpinBox.value():
|
|
|
|
self.theme.font_footer_y = self.FontFooterYSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontFooterWidthSpinBoxChanged(self):
|
|
|
|
if self.theme.font_footer_width != self.FontFooterWidthSpinBox.value():
|
|
|
|
self.theme.font_footer_width = self.FontFooterWidthSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-21 19:45:50 +00:00
|
|
|
|
2009-07-14 19:41:44 +00:00
|
|
|
def onFontFooterHeightSpinBoxChanged(self):
|
|
|
|
if self.theme.font_footer_height != self.FontFooterHeightSpinBox.value():
|
|
|
|
self.theme.font_footer_height = self.FontFooterHeightSpinBox.value()
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
#
|
|
|
|
#Background Tab
|
|
|
|
#
|
|
|
|
def onGradientComboBoxSelected(self, currentIndex):
|
|
|
|
self.setBackground(self.BackgroundTypeComboBox.currentIndex(), currentIndex)
|
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
def onBackgroundComboBoxSelected(self, currentIndex):
|
|
|
|
if currentIndex == 0: # Opaque
|
2009-04-11 07:33:45 +00:00
|
|
|
self.theme.background_mode = u'opaque'
|
|
|
|
else:
|
|
|
|
self.theme.background_mode = u'transparent'
|
|
|
|
self.stateChanging(self.theme)
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
def onBackgroundTypeComboBoxSelected(self, currentIndex):
|
2009-04-20 20:03:04 +00:00
|
|
|
self.setBackground(currentIndex, self.GradientComboBox.currentIndex())
|
|
|
|
|
|
|
|
def setBackground(self, background, gradient):
|
|
|
|
if background == 0: # Solid
|
2009-04-11 07:33:45 +00:00
|
|
|
self.theme.background_type = u'solid'
|
2009-04-19 20:07:52 +00:00
|
|
|
if self.theme.background_color is None :
|
|
|
|
self.theme.background_color = u'#000000'
|
2009-04-20 20:03:04 +00:00
|
|
|
elif background == 1: # Gradient
|
2009-04-11 07:33:45 +00:00
|
|
|
self.theme.background_type = u'gradient'
|
2009-04-20 20:03:04 +00:00
|
|
|
if gradient == 0: # Horizontal
|
|
|
|
self.theme.background_direction = u'horizontal'
|
|
|
|
elif gradient == 1: # vertical
|
|
|
|
self.theme.background_direction = u'vertical'
|
|
|
|
else:
|
|
|
|
self.theme.background_direction = u'circular'
|
2009-04-15 04:58:51 +00:00
|
|
|
if self.theme.background_startColor is None :
|
|
|
|
self.theme.background_startColor = u'#000000'
|
|
|
|
if self.theme.background_endColor is None :
|
2009-04-19 20:07:52 +00:00
|
|
|
self.theme.background_endColor = u'#ff0000'
|
2009-04-11 07:33:45 +00:00
|
|
|
else:
|
|
|
|
self.theme.background_type = u'image'
|
|
|
|
self.stateChanging(self.theme)
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
|
|
|
def onColor1PushButtonClicked(self):
|
2009-04-15 04:58:51 +00:00
|
|
|
if self.theme.background_type == u'solid':
|
|
|
|
self.theme.background_color = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.background_color), self).name()
|
2009-04-15 04:58:51 +00:00
|
|
|
self.Color1PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.background_color))
|
2009-04-15 04:58:51 +00:00
|
|
|
else:
|
|
|
|
self.theme.background_startColor = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.background_startColor), self).name()
|
2009-04-15 04:58:51 +00:00
|
|
|
self.Color1PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.background_startColor))
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
|
|
|
def onColor2PushButtonClicked(self):
|
2009-04-15 04:58:51 +00:00
|
|
|
self.theme.background_endColor = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.background_endColor), self).name()
|
2009-04-11 07:33:45 +00:00
|
|
|
self.Color2PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.background_endColor))
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
self.previewTheme(self.theme)
|
2009-04-22 17:28:32 +00:00
|
|
|
#
|
|
|
|
#Other Tab
|
|
|
|
#
|
|
|
|
def onOutlineCheckBoxChanged(self, value):
|
|
|
|
if value == 2: # checked
|
|
|
|
self.theme.display_outline = True
|
|
|
|
else:
|
|
|
|
self.theme.display_outline = False
|
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
|
|
|
def onOutlineColorPushButtonClicked(self):
|
|
|
|
self.theme.display_outline_color = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.display_outline_color), self).name()
|
2009-04-22 17:28:32 +00:00
|
|
|
self.OutlineColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.display_outline_color))
|
2009-04-22 17:28:32 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
|
|
|
def onShadowCheckBoxChanged(self, value):
|
|
|
|
if value == 2: # checked
|
|
|
|
self.theme.display_shadow = True
|
|
|
|
else:
|
|
|
|
self.theme.display_shadow = False
|
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
|
|
|
def onShadowColorPushButtonClicked(self):
|
|
|
|
self.theme.display_shadow_color = QtGui.QColorDialog.getColor(
|
2009-05-20 20:17:20 +00:00
|
|
|
QtGui.QColor(self.theme.display_shadow_color), self).name()
|
2009-04-22 17:28:32 +00:00
|
|
|
self.ShadowColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(self.theme.display_shadow_color))
|
2009-04-22 17:28:32 +00:00
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
|
|
|
def onHorizontalComboBoxSelected(self, currentIndex):
|
|
|
|
self.theme.display_horizontalAlign = currentIndex
|
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
|
|
|
|
|
|
|
def onVerticalComboBoxSelected(self, currentIndex):
|
|
|
|
self.theme.display_verticalAlign = currentIndex
|
|
|
|
self.stateChanging(self.theme)
|
|
|
|
self.previewTheme(self.theme)
|
2009-04-20 20:03:04 +00:00
|
|
|
#
|
|
|
|
#Local Methods
|
|
|
|
#
|
2009-04-11 05:43:52 +00:00
|
|
|
def baseTheme(self):
|
2009-04-29 19:07:13 +00:00
|
|
|
log.debug(u'base theme created')
|
2009-04-11 05:43:52 +00:00
|
|
|
newtheme = ThemeXML()
|
|
|
|
newtheme.new_document(u'New Theme')
|
2009-06-16 18:21:24 +00:00
|
|
|
newtheme.add_background_solid(unicode(u'#000000'))
|
|
|
|
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False')
|
|
|
|
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(12), u'False', u'footer')
|
|
|
|
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False', unicode(u'#FFFFFF'),
|
|
|
|
unicode(0), unicode(0), unicode(0))
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-11 05:43:52 +00:00
|
|
|
return newtheme.extract_xml()
|
|
|
|
|
2009-04-11 07:33:45 +00:00
|
|
|
def paintUi(self, theme):
|
|
|
|
self.stateChanging(theme)
|
2009-04-22 17:28:32 +00:00
|
|
|
self.ThemeNameEdit.setText(self.theme.theme_name)
|
2009-04-20 20:03:04 +00:00
|
|
|
if self.theme.background_mode == u'opaque':
|
|
|
|
self.BackgroundComboBox.setCurrentIndex(0)
|
|
|
|
else:
|
|
|
|
self.BackgroundComboBox.setCurrentIndex(1)
|
2009-04-22 17:28:32 +00:00
|
|
|
|
2009-04-19 20:07:52 +00:00
|
|
|
if theme.background_type == u'solid':
|
|
|
|
self.BackgroundTypeComboBox.setCurrentIndex(0)
|
|
|
|
elif theme.background_type == u'gradient':
|
|
|
|
self.BackgroundTypeComboBox.setCurrentIndex(1)
|
|
|
|
else:
|
|
|
|
self.BackgroundTypeComboBox.setCurrentIndex(2)
|
2009-04-22 17:28:32 +00:00
|
|
|
|
2009-04-20 20:03:04 +00:00
|
|
|
if self.theme.background_direction == u'horizontal':
|
|
|
|
self.GradientComboBox.setCurrentIndex(0)
|
|
|
|
elif self.theme.background_direction == u'vertical':
|
|
|
|
self.GradientComboBox.setCurrentIndex(1)
|
|
|
|
else:
|
|
|
|
self.GradientComboBox.setCurrentIndex(2)
|
2009-04-19 20:07:52 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion))
|
2009-08-03 19:49:21 +00:00
|
|
|
if not self.theme.font_main_italics and self.theme.font_main_weight == u'Normal':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontMainWeightComboBox.setCurrentIndex(0)
|
2009-08-03 19:49:21 +00:00
|
|
|
elif not self.theme.font_main_italics and self.theme.font_main_weight == u'Bold':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontMainWeightComboBox.setCurrentIndex(1)
|
2009-08-03 19:49:21 +00:00
|
|
|
elif self.theme.font_main_italics and self.theme.font_main_weight == u'Normal':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontMainWeightComboBox.setCurrentIndex(2)
|
|
|
|
else:
|
|
|
|
self.FontMainWeightComboBox.setCurrentIndex(3)
|
|
|
|
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontMainXSpinBox.setValue(int(self.theme.font_main_x))
|
|
|
|
self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
|
|
|
|
self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
|
|
|
|
self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
|
|
|
|
self.FontFooterSizeSpinBox.setValue(int(self.theme.font_footer_proportion))
|
2009-08-03 19:49:21 +00:00
|
|
|
if not self.theme.font_footer_italics and self.theme.font_footer_weight == u'Normal':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontFooterWeightComboBox.setCurrentIndex(0)
|
2009-08-03 19:49:21 +00:00
|
|
|
elif not self.theme.font_footer_italics and self.theme.font_footer_weight == u'Bold':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontFooterWeightComboBox.setCurrentIndex(1)
|
2009-08-03 19:49:21 +00:00
|
|
|
elif self.theme.font_footer_italics and self.theme.font_footer_weight == u'Normal':
|
2009-08-01 19:25:53 +00:00
|
|
|
self.FontFooterWeightComboBox.setCurrentIndex(2)
|
|
|
|
else:
|
|
|
|
self.FontFooterWeightComboBox.setCurrentIndex(3)
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x))
|
|
|
|
self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y))
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width))
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontMainColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.font_main_color))
|
2009-04-11 07:33:45 +00:00
|
|
|
self.FontFooterColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.font_footer_color))
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
if self.theme.font_main_override == False:
|
|
|
|
self.FontMainDefaultCheckBox.setChecked(True)
|
2009-04-20 20:03:04 +00:00
|
|
|
else:
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontMainDefaultCheckBox.setChecked(False)
|
2009-04-22 17:28:32 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
if self.theme.font_footer_override == False:
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterDefaultCheckBox.setChecked(True)
|
|
|
|
else:
|
|
|
|
self.FontFooterDefaultCheckBox.setChecked(False)
|
|
|
|
|
2009-04-22 17:28:32 +00:00
|
|
|
self.OutlineColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.display_outline_color))
|
2009-04-22 17:28:32 +00:00
|
|
|
self.ShadowColorPushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.display_shadow_color))
|
2009-04-22 17:28:32 +00:00
|
|
|
|
|
|
|
if self.theme.display_outline:
|
|
|
|
self.OutlineCheckBox.setChecked(True)
|
|
|
|
self.OutlineColorPushButton.setEnabled(True)
|
|
|
|
else:
|
|
|
|
self.OutlineCheckBox.setChecked(False)
|
|
|
|
self.OutlineColorPushButton.setEnabled(False)
|
|
|
|
|
|
|
|
if self.theme.display_shadow:
|
|
|
|
self.ShadowCheckBox.setChecked(True)
|
|
|
|
self.ShadowColorPushButton.setEnabled(True)
|
|
|
|
else:
|
|
|
|
self.ShadowCheckBox.setChecked(False)
|
|
|
|
self.ShadowColorPushButton.setEnabled(False)
|
|
|
|
|
|
|
|
self.HorizontalComboBox.setCurrentIndex(int(self.theme.display_horizontalAlign))
|
|
|
|
self.VerticalComboBox.setCurrentIndex(int(self.theme.display_verticalAlign))
|
|
|
|
|
2009-04-11 07:33:45 +00:00
|
|
|
def stateChanging(self, theme):
|
|
|
|
if theme.background_type == u'solid':
|
|
|
|
self.Color1PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.background_color))
|
2009-04-19 20:07:52 +00:00
|
|
|
self.Color1Label.setText(translate(u'ThemeManager', u'Background Color:'))
|
2009-04-11 07:33:45 +00:00
|
|
|
self.Color1Label.setVisible(True)
|
|
|
|
self.Color1PushButton.setVisible(True)
|
|
|
|
self.Color2Label.setVisible(False)
|
|
|
|
self.Color2PushButton.setVisible(False)
|
2009-04-19 20:07:52 +00:00
|
|
|
self.ImageLabel.setVisible(False)
|
|
|
|
self.ImageLineEdit.setVisible(False)
|
|
|
|
self.ImageFilenameWidget.setVisible(False)
|
|
|
|
self.GradientLabel.setVisible(False)
|
|
|
|
self.GradientComboBox.setVisible(False)
|
2009-04-11 07:33:45 +00:00
|
|
|
elif theme.background_type == u'gradient':
|
|
|
|
self.Color1PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.background_startColor))
|
2009-04-11 07:33:45 +00:00
|
|
|
self.Color2PushButton.setStyleSheet(
|
2009-06-16 18:21:24 +00:00
|
|
|
u'background-color: %s' % unicode(theme.background_endColor))
|
2009-04-11 07:33:45 +00:00
|
|
|
self.Color1Label.setText(translate(u'ThemeManager', u'First Color:'))
|
|
|
|
self.Color2Label.setText(translate(u'ThemeManager', u'Second Color:'))
|
|
|
|
self.Color1Label.setVisible(True)
|
|
|
|
self.Color1PushButton.setVisible(True)
|
|
|
|
self.Color2Label.setVisible(True)
|
|
|
|
self.Color2PushButton.setVisible(True)
|
2009-04-19 20:07:52 +00:00
|
|
|
self.ImageLabel.setVisible(False)
|
|
|
|
self.ImageLineEdit.setVisible(False)
|
|
|
|
self.ImageFilenameWidget.setVisible(False)
|
|
|
|
self.GradientLabel.setVisible(True)
|
|
|
|
self.GradientComboBox.setVisible(True)
|
2009-04-11 07:33:45 +00:00
|
|
|
else: # must be image
|
|
|
|
self.Color1Label.setVisible(False)
|
|
|
|
self.Color1PushButton.setVisible(False)
|
|
|
|
self.Color2Label.setVisible(False)
|
|
|
|
self.Color2PushButton.setVisible(False)
|
2009-04-19 20:07:52 +00:00
|
|
|
self.ImageLabel.setVisible(True)
|
|
|
|
self.ImageLineEdit.setVisible(True)
|
|
|
|
self.ImageFilenameWidget.setVisible(True)
|
|
|
|
self.GradientLabel.setVisible(False)
|
|
|
|
self.GradientComboBox.setVisible(False)
|
2009-04-11 07:33:45 +00:00
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
if theme.font_main_override == False:
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontMainXSpinBox.setEnabled(False)
|
|
|
|
self.FontMainYSpinBox.setEnabled(False)
|
|
|
|
self.FontMainWidthSpinBox.setEnabled(False)
|
|
|
|
self.FontMainHeightSpinBox.setEnabled(False)
|
|
|
|
else:
|
|
|
|
self.FontMainXSpinBox.setEnabled(True)
|
|
|
|
self.FontMainYSpinBox.setEnabled(True)
|
|
|
|
self.FontMainWidthSpinBox.setEnabled(True)
|
|
|
|
self.FontMainHeightSpinBox.setEnabled(True)
|
|
|
|
|
2009-04-21 19:45:50 +00:00
|
|
|
if theme.font_footer_override == False:
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterXSpinBox.setEnabled(False)
|
|
|
|
self.FontFooterYSpinBox.setEnabled(False)
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontFooterWidthSpinBox.setEnabled(False)
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterHeightSpinBox.setEnabled(False)
|
|
|
|
else:
|
|
|
|
self.FontFooterXSpinBox.setEnabled(True)
|
|
|
|
self.FontFooterYSpinBox.setEnabled(True)
|
2009-04-21 19:45:50 +00:00
|
|
|
self.FontFooterWidthSpinBox.setEnabled(True)
|
2009-04-20 20:03:04 +00:00
|
|
|
self.FontFooterHeightSpinBox.setEnabled(True)
|
|
|
|
|
2009-04-22 17:28:32 +00:00
|
|
|
if self.theme.display_outline:
|
|
|
|
self.OutlineColorPushButton.setEnabled(True)
|
|
|
|
else:
|
|
|
|
self.OutlineColorPushButton.setEnabled(False)
|
|
|
|
|
|
|
|
if self.theme.display_shadow:
|
|
|
|
self.ShadowColorPushButton.setEnabled(True)
|
|
|
|
else:
|
|
|
|
self.ShadowColorPushButton.setEnabled(False)
|
|
|
|
|
2009-04-19 19:12:18 +00:00
|
|
|
def previewTheme(self, theme):
|
2009-05-16 10:24:03 +00:00
|
|
|
if self.allowPreview:
|
|
|
|
frame = self.thememanager.generateImage(theme)
|
2009-07-06 16:34:13 +00:00
|
|
|
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|