From 29088db51633403762ca8cd0a55387b551e25fbd Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 15:35:52 +0000 Subject: [PATCH 1/7] Start to move DisplayTag dialog --- openlp/core/ui/__init__.py | 1 + openlp/core/ui/displaytagdialog.py | 51 +++++++++++++++++++ .../{displaytagtab.py => displaytagform.py} | 7 +-- openlp/core/ui/mainwindow.py | 18 ++++++- openlp/core/ui/settingsform.py | 22 ++++---- 5 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 openlp/core/ui/displaytagdialog.py rename openlp/core/ui/{displaytagtab.py => displaytagform.py} (98%) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 45218802e..5763b3470 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -67,6 +67,7 @@ from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm +from displaytagform import DisplayTagForm from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py new file mode 100644 index 000000000..f7d4b5175 --- /dev/null +++ b/openlp/core/ui/displaytagdialog.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2011 Raoul Snyman # +# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian # +# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, # +# Carsten Tinggaard, Frode Woldsund # +# --------------------------------------------------------------------------- # +# 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 # +############################################################################### + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import translate, build_icon +from openlp.core.lib.ui import create_accept_reject_button_box + +class Ui_DisplayTagDialog(object): + def setupUi(self, settingsDialog): + settingsDialog.setObjectName(u'settingsDialog') + settingsDialog.resize(700, 500) + settingsDialog.setWindowIcon( + build_icon(u':/system/system_settings.png')) + self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) + self.settingsLayout.setObjectName(u'settingsLayout') + self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) + self.settingsTabWidget.setObjectName(u'settingsTabWidget') + self.settingsLayout.addWidget(self.settingsTabWidget) + + self.buttonBox = create_accept_reject_button_box(settingsDialog, True) + self.settingsLayout.addWidget(self.buttonBox) + self.retranslateUi(settingsDialog) + QtCore.QMetaObject.connectSlotsByName(settingsDialog) + + def retranslateUi(self, settingsDialog): + settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', + 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagtab.py b/openlp/core/ui/displaytagform.py similarity index 98% rename from openlp/core/ui/displaytagtab.py rename to openlp/core/ui/displaytagform.py index 30c593d36..5216fcd61 100644 --- a/openlp/core/ui/displaytagtab.py +++ b/openlp/core/ui/displaytagform.py @@ -33,10 +33,11 @@ import cPickle from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate, DisplayTags +from openlp.core.lib import translate, DisplayTags from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.ui.displaytagdialog import Ui_DisplayTagDialog -class DisplayTagTab(SettingsTab): +class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ @@ -44,7 +45,7 @@ class DisplayTagTab(SettingsTab): """ Initialise the settings tab """ - SettingsTab.__init__(self, u'Display Tags') + #SettingsTab.__init__(self, u'Display Tags') def resizeEvent(self, event=None): pass diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index aedd9cf4f..82d95dd40 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -34,7 +34,7 @@ from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \ icon_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \ - ShortcutListForm + ShortcutListForm, DisplayTagForm from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ ActionList @@ -242,6 +242,8 @@ class Ui_MainWindow(object): self.SettingsShortcutsItem = icon_action(mainWindow, u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') + self.DisplayTagItem = icon_action(mainWindow, + u'DisplayTagItem', u':/system/system_settings.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, @@ -277,7 +279,8 @@ class Ui_MainWindow(object): add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) add_actions(self.SettingsMenu, (self.settingsPluginListItem, self.SettingsLanguageMenu.menuAction(), None, - self.SettingsShortcutsItem, self.SettingsConfigureItem)) + self.SettingsShortcutsItem, self.DisplayTagItem, + self.SettingsConfigureItem)) add_actions(self.ToolsMenu, (self.ToolsAddToolItem, None)) add_actions(self.ToolsMenu, (self.ToolsOpenDataFolder, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, @@ -361,6 +364,8 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', '&Language')) self.SettingsShortcutsItem.setText( translate('OpenLP.MainWindow', 'Configure &Shortcuts...')) + self.DisplayTagItem.setText( + translate('OpenLP.MainWindow', '&Configure Display Tags')) self.SettingsConfigureItem.setText( translate('OpenLP.MainWindow', '&Configure OpenLP...')) self.ViewMediaManagerItem.setText( @@ -476,6 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) + self.displayTagForm = DisplayTagForm() self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins @@ -523,6 +529,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onToolsOpenDataFolderClicked) QtCore.QObject.connect(self.settingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) + QtCore.QObject.connect(self.DisplayTagItem, + QtCore.SIGNAL(u'triggered()'), self.onDisplayTagItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onSettingsConfigureItemClicked) QtCore.QObject.connect(self.SettingsShortcutsItem, @@ -716,6 +724,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): path = AppLocation.get_data_path() QtGui.QDesktopServices.openUrl(QtCore.QUrl("file:///" + path)) + def onDisplayTagItemClicked(self): + """ + Show the Settings dialog + """ + self.displayTagForm.exec_() + def onSettingsConfigureItemClicked(self): """ Show the Settings dialog diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index afea928b6..3fd640acd 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -47,17 +47,17 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): QtGui.QDialog.__init__(self, parent) self.setupUi(self) # General tab - self.generalTab = GeneralTab(screens) - self.addTab(u'General', self.generalTab) + generalTab = GeneralTab(screens) + self.addTab(u'General', generalTab) # Themes tab - self.themesTab = ThemesTab(mainWindow) - self.addTab(u'Themes', self.themesTab) + themesTab = ThemesTab(mainWindow) + self.addTab(u'Themes', themesTab) # Advanced tab - self.advancedTab = AdvancedTab() - self.addTab(u'Advanced', self.advancedTab) - # Edit Display Tags tab - self.displayTagTab = DisplayTagTab() - self.addTab(u'Display Tags', self.displayTagTab) + advancedTab = AdvancedTab() + self.addTab(u'Advanced', advancedTab) + ## Edit Display Tags tab + #self.displayTagTab = DisplayTagTab() + #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ @@ -71,9 +71,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): Add a tab to the form at a specific location """ log.debug(u'Inserting %s tab' % tab.tabTitle) - # 15 : There are 4 tables currently and locations starts at -10 + # 14 : There are 3 tables currently and locations starts at -10 self.settingsTabWidget.insertTab( - location + 15, tab, tab.tabTitleVisible) + location + 14, tab, tab.tabTitleVisible) def removeTab(self, tab): """ From 338efdc54372f3cb803dbc8eefc8f71efa9aee5f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 17:06:58 +0000 Subject: [PATCH 2/7] DisplayTag Updates --- openlp/core/ui/displaytagdialog.py | 245 ++++++++++++++++-- openlp/core/ui/displaytagform.py | 155 ++--------- openlp/core/ui/mainwindow.py | 2 +- ...aytabeditdialog.ui => displaytabdialog.ui} | 56 ++-- 4 files changed, 287 insertions(+), 171 deletions(-) rename resources/forms/{displaytabeditdialog.ui => displaytabdialog.ui} (86%) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index f7d4b5175..3e76b39d2 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -27,25 +27,234 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon -from openlp.core.lib.ui import create_accept_reject_button_box +from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s class Ui_DisplayTagDialog(object): - def setupUi(self, settingsDialog): - settingsDialog.setObjectName(u'settingsDialog') - settingsDialog.resize(700, 500) - settingsDialog.setWindowIcon( - build_icon(u':/system/system_settings.png')) - self.settingsLayout = QtGui.QVBoxLayout(settingsDialog) - self.settingsLayout.setObjectName(u'settingsLayout') - self.settingsTabWidget = QtGui.QTabWidget(settingsDialog) - self.settingsTabWidget.setObjectName(u'settingsTabWidget') - self.settingsLayout.addWidget(self.settingsTabWidget) - self.buttonBox = create_accept_reject_button_box(settingsDialog, True) - self.settingsLayout.addWidget(self.buttonBox) - self.retranslateUi(settingsDialog) - QtCore.QMetaObject.connectSlotsByName(settingsDialog) + def setupUi(self, displayTagDialog): +# displayTagDialog.setObjectName(u'displayTagDialog') +# displayTagDialog.resize(700, 500) +# displayTagDialog.setWindowIcon( +# build_icon(u':/system/system_settings.png')) +# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) +# self.settingsLayout.setObjectName(u'settingsLayout') +# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) +# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) +# self.editGroupBox.setObjectName(u'editGroupBox') +# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) +# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) +# self.updatePushButton.setObjectName(u'updatePushButton') +# self.layoutWidget = QtGui.QWidget(self.editGroupBox) +# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) +# self.layoutWidget.setObjectName(u'layoutWidget') +# self.formLayout = QtGui.QFormLayout(self.layoutWidget) +# self.formLayout.setObjectName(u'formLayout') +# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) +# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.descriptionLabel.setObjectName(u'descriptionLabel') +# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, +# self.descriptionLabel) +# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') +# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, +# self.descriptionLineEdit) +# self.tagLabel = QtGui.QLabel(self.layoutWidget) +# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.tagLabel.setObjectName(u'tagLabel') +# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) +# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) +# self.tagLineEdit.setMaxLength(5) +# self.tagLineEdit.setObjectName(u'tagLineEdit') +# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, +# self.tagLineEdit) +# self.startTagLabel = QtGui.QLabel(self.layoutWidget) +# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.startTagLabel.setObjectName(u'startTagLabel') +# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, +# self.startTagLabel) +# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.startTagLineEdit.setObjectName(u'startTagLineEdit') +# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, +# self.startTagLineEdit) +# self.endTagLabel = QtGui.QLabel(self.layoutWidget) +# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) +# self.endTagLabel.setObjectName(u'endTagLabel') +# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, +# self.endTagLabel) +# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) +# self.endTagLineEdit.setObjectName(u'endTagLineEdit') +# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, +# self.endTagLineEdit) +# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) +# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) +# self.defaultPushButton.setObjectName(u'updatePushButton') +# self.deletePushButton = QtGui.QPushButton(displayTagDialog) +# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) +# self.deletePushButton.setObjectName(u'deletePushButton') +# self.newPushButton = QtGui.QPushButton(displayTagDialog) +# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) +# self.newPushButton.setObjectName(u'newPushButton') +# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) +# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) +# self.tagTableWidget.setHorizontalScrollBarPolicy( +# QtCore.Qt.ScrollBarAlwaysOff) +# self.tagTableWidget.setEditTriggers( +# QtGui.QAbstractItemView.NoEditTriggers) +# self.tagTableWidget.setAlternatingRowColors(True) +# self.tagTableWidget.setSelectionMode( +# QtGui.QAbstractItemView.SingleSelection) +# self.tagTableWidget.setSelectionBehavior( +# QtGui.QAbstractItemView.SelectRows) +# self.tagTableWidget.setCornerButtonEnabled(False) +# self.tagTableWidget.setObjectName(u'tagTableWidget') +# self.tagTableWidget.setColumnCount(4) +# self.tagTableWidget.setRowCount(0) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(0, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(1, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(2, item) +# item = QtGui.QTableWidgetItem() +# self.tagTableWidget.setHorizontalHeaderItem(3, item) +# +# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) +# self.settingsLayout.addWidget(self.buttonBox) +# self.retranslateUi(displayTagDialog) +# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) + displayTagDialog.resize(717, 554) + self.editGroupBox = QtGui.QGroupBox(displayTagDialog) + self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.layoutWidget = QtGui.QWidget(self.editGroupBox) + self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) + self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) + self.formLayout = QtGui.QFormLayout(self.layoutWidget) + self.formLayout.setMargin(0) + self.formLayout.setObjectName(_fromUtf8("formLayout")) + self.descriptionLabel = QtGui.QLabel(self.layoutWidget) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) + self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) + self.tagLabel = QtGui.QLabel(self.layoutWidget) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) + self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) + self.startTagLabel = QtGui.QLabel(self.layoutWidget) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) + self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) + self.endTagLabel = QtGui.QLabel(self.layoutWidget) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) + self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) + self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.deletePushButton = QtGui.QPushButton(displayTagDialog) + self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) + self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.defaultPushButton = QtGui.QPushButton(displayTagDialog) + self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + + self.retranslateUi(displayTagDialog) + QtCore.QMetaObject.connectSlotsByName(displayTagDialog) + + def retranslateUi(self, displayTagDialog): + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + 'Configure Display Tags')) + self.editGroupBox.setTitle( + translate('OpenLP.DisplayTagTab', 'Edit Selection')) + self.updatePushButton.setText( + translate('OpenLP.DisplayTagTab', 'Update')) + self.descriptionLabel.setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + self.startTagLabel.setText( + translate('OpenLP.DisplayTagTab', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + self.deletePushButton.setText(UiStrings.Delete) + self.defaultPushButton.setText( + translate('OpenLP.DisplayTagTab', 'Default')) + self.newPushButton.setText(UiStrings.New) + self.tagTableWidget.horizontalHeaderItem(0)\ + .setText(translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1)\ + .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2)\ + .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3)\ + .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.setColumnWidth(0, 120) + self.tagTableWidget.setColumnWidth(1, 40) + self.tagTableWidget.setColumnWidth(2, 240) + self.tagTableWidget.setColumnWidth(3, 200) + + displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) + - def retranslateUi(self, settingsDialog): - settingsDialog.setWindowTitle(translate('OpenLP.SettingsForm', - 'Configure OpenLP')) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 5216fcd61..491c60693 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -41,18 +41,26 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ The :class:`DisplayTagTab` manages the settings tab . """ - def __init__(self): + def __init__(self, parent): """ - Initialise the settings tab + Constructor """ - #SettingsTab.__init__(self, u'Display Tags') + QtGui.QDialog.__init__(self, parent) + self.setupUi(self) + QtCore.QObject.connect(self.tagTableWidget, + QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) + QtCore.QObject.connect(self.defaultPushButton, + QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) + QtCore.QObject.connect(self.newPushButton, + QtCore.SIGNAL(u'pressed()'), self.onNewPushed) + QtCore.QObject.connect(self.updatePushButton, + QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) + QtCore.QObject.connect(self.deletePushButton, + QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) - def resizeEvent(self, event=None): - pass - - def preLoad(self): + def exec_(self): """ - Initialise values before the Load takes place + Load Display and set field state. """ # Create initial copy from master DisplayTags.reset_html_tags() @@ -66,137 +74,10 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): for t in user_tags: DisplayTags.add_html_tag(t) self.selected = -1 - - def setupUi(self): - """ - Configure the UI elements for the tab. - """ - self.setObjectName(u'DisplayTagTab') - self.tabTitleVisible = \ - translate(u'OpenLP.DisplayTagTab', 'Display Tags') - self.displayTagEdit = QtGui.QWidget(self) - self.editGroupBox = QtGui.QGroupBox(self.displayTagEdit) - self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) - self.editGroupBox.setObjectName(u'editGroupBox') - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) - self.updatePushButton.setObjectName(u'updatePushButton') - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) - self.layoutWidget.setObjectName(u'layoutWidget') - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setObjectName(u'formLayout') - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(u'descriptionLabel') - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(u'tagLabel') - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(u'tagLineEdit') - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(u'startTagLabel') - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(u'startTagLineEdit') - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, - self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(u'endTagLabel') - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, - self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(u'endTagLineEdit') - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, - self.endTagLineEdit) - self.defaultPushButton = QtGui.QPushButton(self.displayTagEdit) - self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) - self.defaultPushButton.setObjectName(u'updatePushButton') - self.deletePushButton = QtGui.QPushButton(self.displayTagEdit) - self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) - self.deletePushButton.setObjectName(u'deletePushButton') - self.newPushButton = QtGui.QPushButton(self.displayTagEdit) - self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) - self.newPushButton.setObjectName(u'newPushButton') - self.tagTableWidget = QtGui.QTableWidget(self.displayTagEdit) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) - self.tagTableWidget.setHorizontalScrollBarPolicy( - QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers( - QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode( - QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior( - QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(u'tagTableWidget') - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) - self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) - self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) - self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) - self.deletePushButton.setText(UiStrings.Delete) - self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) - self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) - QtCore.QMetaObject.connectSlotsByName(self.displayTagEdit) - self.tagTableWidget.setColumnWidth(0, 120) - self.tagTableWidget.setColumnWidth(1, 40) - self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - QtCore.QObject.connect(self.tagTableWidget, - QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) - QtCore.QObject.connect(self.defaultPushButton, - QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed) - QtCore.QObject.connect(self.newPushButton, - QtCore.SIGNAL(u'pressed()'), self.onNewPushed) - QtCore.QObject.connect(self.updatePushButton, - QtCore.SIGNAL(u'pressed()'), self.onUpdatePushed) - QtCore.QObject.connect(self.deletePushButton, - QtCore.SIGNAL(u'pressed()'), self.onDeletePushed) + self.load() + return QtGui.QDialog.exec_(self) def load(self): - """ - Load Display and set field state. - """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 82d95dd40..f899a23ce 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -481,7 +481,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager = SettingsManager(screens) self.aboutForm = AboutForm(self, applicationVersion) self.settingsForm = SettingsForm(self.screens, self, self) - self.displayTagForm = DisplayTagForm() + self.displayTagForm = DisplayTagForm(self) self.shortcutForm = ShortcutListForm(self) self.recentFiles = QtCore.QStringList() # Set up the path with plugins diff --git a/resources/forms/displaytabeditdialog.ui b/resources/forms/displaytabdialog.ui similarity index 86% rename from resources/forms/displaytabeditdialog.ui rename to resources/forms/displaytabdialog.ui index 3c748594f..2e9c09c01 100644 --- a/resources/forms/displaytabeditdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -112,6 +112,32 @@ + + + + 600 + 40 + 71 + 26 + + + + Add + + + + + + 600 + 70 + 71 + 26 + + + + New + + @@ -123,13 +149,13 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Save - 530 + 630 280 71 26 @@ -139,19 +165,6 @@ Delete - - - - 610 - 280 - 71 - 26 - - - - Add - - @@ -203,6 +216,19 @@ + + + + 550 + 280 + 71 + 26 + + + + Default + + From 7e4b644f781612d9c21fcfdbc514ac3aab11deef Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:23:33 +0000 Subject: [PATCH 3/7] Finished moving Display Tags --- openlp/core/ui/displaytagdialog.py | 265 ++++++------------- openlp/core/ui/displaytagform.py | 10 +- openlp/core/ui/mainwindow.py | 2 +- resources/forms/displaytabdialog.ui | 393 +++++++++++++--------------- resources/images/openlp-2.qrc | 1 + 5 files changed, 269 insertions(+), 402 deletions(-) diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 3e76b39d2..5da529302 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -29,171 +29,29 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import translate, build_icon from openlp.core.lib.ui import UiStrings, create_accept_reject_button_box -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - class Ui_DisplayTagDialog(object): def setupUi(self, displayTagDialog): -# displayTagDialog.setObjectName(u'displayTagDialog') -# displayTagDialog.resize(700, 500) -# displayTagDialog.setWindowIcon( -# build_icon(u':/system/system_settings.png')) -# self.settingsLayout = QtGui.QVBoxLayout(displayTagDialog) -# self.settingsLayout.setObjectName(u'settingsLayout') -# self.editGroupBox = QtGui.QGroupBox(displayTagDialog) -# self.editGroupBox.setGeometry(QtCore.QRect(10, 220, 650, 181)) -# self.editGroupBox.setObjectName(u'editGroupBox') -# self.updatePushButton = QtGui.QPushButton(self.editGroupBox) -# self.updatePushButton.setGeometry(QtCore.QRect(550, 140, 71, 26)) -# self.updatePushButton.setObjectName(u'updatePushButton') -# self.layoutWidget = QtGui.QWidget(self.editGroupBox) -# self.layoutWidget.setGeometry(QtCore.QRect(5, 20, 571, 114)) -# self.layoutWidget.setObjectName(u'layoutWidget') -# self.formLayout = QtGui.QFormLayout(self.layoutWidget) -# self.formLayout.setObjectName(u'formLayout') -# self.descriptionLabel = QtGui.QLabel(self.layoutWidget) -# self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.descriptionLabel.setObjectName(u'descriptionLabel') -# self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, -# self.descriptionLabel) -# self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') -# self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, -# self.descriptionLineEdit) -# self.tagLabel = QtGui.QLabel(self.layoutWidget) -# self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.tagLabel.setObjectName(u'tagLabel') -# self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) -# self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) -# self.tagLineEdit.setMaxLength(5) -# self.tagLineEdit.setObjectName(u'tagLineEdit') -# self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, -# self.tagLineEdit) -# self.startTagLabel = QtGui.QLabel(self.layoutWidget) -# self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.startTagLabel.setObjectName(u'startTagLabel') -# self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, -# self.startTagLabel) -# self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.startTagLineEdit.setObjectName(u'startTagLineEdit') -# self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, -# self.startTagLineEdit) -# self.endTagLabel = QtGui.QLabel(self.layoutWidget) -# self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) -# self.endTagLabel.setObjectName(u'endTagLabel') -# self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, -# self.endTagLabel) -# self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) -# self.endTagLineEdit.setObjectName(u'endTagLineEdit') -# self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, -# self.endTagLineEdit) -# self.defaultPushButton = QtGui.QPushButton(displayTagDialog) -# self.defaultPushButton.setGeometry(QtCore.QRect(430, 188, 71, 26)) -# self.defaultPushButton.setObjectName(u'updatePushButton') -# self.deletePushButton = QtGui.QPushButton(displayTagDialog) -# self.deletePushButton.setGeometry(QtCore.QRect(510, 188, 71, 26)) -# self.deletePushButton.setObjectName(u'deletePushButton') -# self.newPushButton = QtGui.QPushButton(displayTagDialog) -# self.newPushButton.setGeometry(QtCore.QRect(600, 188, 71, 26)) -# self.newPushButton.setObjectName(u'newPushButton') -# self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) -# self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 650, 171)) -# self.tagTableWidget.setHorizontalScrollBarPolicy( -# QtCore.Qt.ScrollBarAlwaysOff) -# self.tagTableWidget.setEditTriggers( -# QtGui.QAbstractItemView.NoEditTriggers) -# self.tagTableWidget.setAlternatingRowColors(True) -# self.tagTableWidget.setSelectionMode( -# QtGui.QAbstractItemView.SingleSelection) -# self.tagTableWidget.setSelectionBehavior( -# QtGui.QAbstractItemView.SelectRows) -# self.tagTableWidget.setCornerButtonEnabled(False) -# self.tagTableWidget.setObjectName(u'tagTableWidget') -# self.tagTableWidget.setColumnCount(4) -# self.tagTableWidget.setRowCount(0) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(0, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(1, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(2, item) -# item = QtGui.QTableWidgetItem() -# self.tagTableWidget.setHorizontalHeaderItem(3, item) -# -# self.buttonBox = create_accept_reject_button_box(displayTagDialog, True) -# self.settingsLayout.addWidget(self.buttonBox) -# self.retranslateUi(displayTagDialog) -# QtCore.QMetaObject.connectSlotsByName(displayTagDialog) - displayTagDialog.setObjectName(_fromUtf8("displayTagDialog")) - displayTagDialog.resize(717, 554) - self.editGroupBox = QtGui.QGroupBox(displayTagDialog) - self.editGroupBox.setGeometry(QtCore.QRect(10, 320, 691, 181)) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setGeometry(QtCore.QRect(600, 140, 73, 26)) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.layoutWidget = QtGui.QWidget(self.editGroupBox) - self.layoutWidget.setGeometry(QtCore.QRect(20, 50, 571, 114)) - self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) - self.formLayout = QtGui.QFormLayout(self.layoutWidget) - self.formLayout.setMargin(0) - self.formLayout.setObjectName(_fromUtf8("formLayout")) - self.descriptionLabel = QtGui.QLabel(self.layoutWidget) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.descriptionLabel) - self.descriptionLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.descriptionLineEdit) - self.tagLabel = QtGui.QLabel(self.layoutWidget) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.tagLabel) - self.tagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.tagLineEdit) - self.startTagLabel = QtGui.QLabel(self.layoutWidget) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.startTagLabel) - self.startTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.startTagLineEdit) - self.endTagLabel = QtGui.QLabel(self.layoutWidget) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.endTagLabel) - self.endTagLineEdit = QtGui.QLineEdit(self.layoutWidget) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.endTagLineEdit) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setGeometry(QtCore.QRect(600, 40, 71, 26)) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setGeometry(QtCore.QRect(600, 70, 71, 26)) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.buttonBox = QtGui.QDialogButtonBox(displayTagDialog) - self.buttonBox.setGeometry(QtCore.QRect(540, 510, 162, 26)) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.deletePushButton = QtGui.QPushButton(displayTagDialog) - self.deletePushButton.setGeometry(QtCore.QRect(630, 280, 71, 26)) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.tagTableWidget = QtGui.QTableWidget(displayTagDialog) - self.tagTableWidget.setGeometry(QtCore.QRect(10, 10, 691, 271)) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + displayTagDialog.setObjectName(u'displayTagDialog') + displayTagDialog.resize(725, 548) + self.widget = QtGui.QWidget(displayTagDialog) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(u'widget') + self.listdataGridLayout = QtGui.QGridLayout(self.widget) + self.listdataGridLayout.setMargin(0) + self.listdataGridLayout.setObjectName(u'listdataGridLayout') + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy( + QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers( + QtGui.QAbstractItemView.NoEditTriggers) self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setSelectionMode( + QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior( + QtGui.QAbstractItemView.SelectRows) self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setObjectName(u'tagTableWidget') self.tagTableWidget.setColumnCount(4) self.tagTableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() @@ -204,9 +62,62 @@ class Ui_DisplayTagDialog(object): self.tagTableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.defaultPushButton = QtGui.QPushButton(displayTagDialog) - self.defaultPushButton.setGeometry(QtCore.QRect(550, 280, 71, 26)) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.listdataGridLayout.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(u'horizontalLayout') + spacerItem = QtGui.QSpacerItem(40, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(u'defaultPushButton') + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(u'deletePushButton') + self.horizontalLayout.addWidget(self.deletePushButton) + self.listdataGridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(u'editGroupBox') + self.dataGridLayout = QtGui.QGridLayout(self.editGroupBox) + self.dataGridLayout.setObjectName(u'dataGridLayout') + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(u'descriptionLabel') + self.dataGridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(u'descriptionLineEdit') + self.dataGridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(u'newPushButton') + self.dataGridLayout.addWidget(self.newPushButton, 0, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(u'tagLabel') + self.dataGridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(u'tagLineEdit') + self.dataGridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(u'startTagLabel') + self.dataGridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(u'startTagLineEdit') + self.dataGridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(u'endTagLabel') + self.dataGridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(u'endTagLineEdit') + self.dataGridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(u'updatePushButton') + self.dataGridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.listdataGridLayout.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = create_accept_reject_button_box(displayTagDialog) + self.listdataGridLayout.addWidget(self.buttonBox, 3, 0, 1, 1) self.retranslateUi(displayTagDialog) QtCore.QMetaObject.connectSlotsByName(displayTagDialog) @@ -228,33 +139,15 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0)\ + self.tagTableWidget.horizontalHeaderItem(0) \ .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1)\ + self.tagTableWidget.horizontalHeaderItem(1) \ .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2)\ + self.tagTableWidget.horizontalHeaderItem(2) \ .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3)\ + self.tagTableWidget.horizontalHeaderItem(3) \ .setText(translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) - self.tagTableWidget.setColumnWidth(3, 200) - - displayTagDialog.setWindowTitle(QtGui.QApplication.translate("displayTagDialog", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagDialog", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Update", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagDialog", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagDialog", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagDialog", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagDialog", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagDialog", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagDialog", "Default", None, QtGui.QApplication.UnicodeUTF8)) - - + self.tagTableWidget.setColumnWidth(3, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 491c60693..48924759f 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -63,6 +63,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self._resetTable() DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -102,7 +103,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self.startTagLineEdit.setEnabled(False) self.endTagLineEdit.setEnabled(False) - def save(self): + def accept(self): """ Save Custom tags in a pickle . """ @@ -117,13 +118,14 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): else: QtCore.QSettings().setValue(u'displayTags/html_tags', QtCore.QVariant(u'')) + return QtGui.QDialog.accept(self) - def cancel(self): + def reject(self): """ Reset Custom tags from Settings. """ - self.preLoad() self._resetTable() + return QtGui.QDialog.reject(self) def onRowSelected(self): """ @@ -170,6 +172,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): self._resetTable() # Highlight new row self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1) + self.onRowSelected() def onDefaultPushed(self): """ @@ -217,7 +220,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) - self.load() def _strip(self, tag): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index f899a23ce..9071016e8 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -243,7 +243,7 @@ class Ui_MainWindow(object): u'SettingsShortcutsItem', u':/system/system_configure_shortcuts.png') self.DisplayTagItem = icon_action(mainWindow, - u'DisplayTagItem', u':/system/system_settings.png') + u'DisplayTagItem', u':/system/tag_editor.png') self.SettingsConfigureItem = icon_action(mainWindow, u'SettingsConfigureItem', u':/system/system_settings.png') mainWindow.actionList.add_action(self.SettingsShortcutsItem, diff --git a/resources/forms/displaytabdialog.ui b/resources/forms/displaytabdialog.ui index 2e9c09c01..b181635be 100644 --- a/resources/forms/displaytabdialog.ui +++ b/resources/forms/displaytabdialog.ui @@ -6,228 +6,199 @@ 0 0 - 717 - 554 + 725 + 548 Form - - - - 10 - 320 - 691 - 181 - - - - Edit Selection - - - - - 600 - 140 - 73 - 26 - - - - Update - - - - - - 20 - 50 - 571 - 114 - - - - - - - Description - - - Qt::AlignCenter - - - - - - - - - - Tag - - - Qt::AlignCenter - - - - - - - - 50 - 16777215 - - - - 5 - - - - - - - Start tag - - - Qt::AlignCenter - - - - - - - - - - End tag - - - Qt::AlignCenter - - - - - - - - - - - - 600 - 40 - 71 - 26 - - - - Add - - - - - - 600 - 70 - 71 - 26 - - - - New - - - - - - - 540 - 510 - 162 - 26 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Save - - - - - - 630 - 280 - 71 - 26 - - - - Delete - - - + 10 10 - 691 - 271 + 701 + 521 - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - Description - - - - - Key - - - AlignHCenter|AlignVCenter|AlignCenter - - - - - Start Tag - - - - - End Tag - - - - - - - 550 - 280 - 71 - 26 - - - - Default - + + + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + false + + + + Description + + + + + Key + + + AlignHCenter|AlignVCenter|AlignCenter + + + + + Start Tag + + + + + End Tag + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Default + + + + + + + Delete + + + + + + + + + Edit Selection + + + + + + Description + + + Qt::AlignCenter + + + + + + + + + + Add + + + + + + + New + + + + + + + Tag + + + Qt::AlignCenter + + + + + + + + 50 + 16777215 + + + + 5 + + + + + + + Start tag + + + Qt::AlignCenter + + + + + + + + + + End tag + + + Qt::AlignCenter + + + + + + + + + + Update + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Save + + + + diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 745f20ebf..794e006d9 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -116,6 +116,7 @@ system_exit.png settings_plugin_list.png system_settings.png + tag_editor.png system_configure.png system_edit_copy.png system_configure_shortcuts.png From 69bfe2ab9ccb84e425d035b1b44ae40b81254461 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 20 Feb 2011 20:34:33 +0000 Subject: [PATCH 4/7] Post merge request fixes --- openlp/core/ui/settingsform.py | 5 +- resources/forms/displaytabdialog.py | 125 ++++++++++++++++++++++++++++ resources/images/tag_editor.png | Bin 0 -> 1131 bytes 3 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 resources/forms/displaytabdialog.py create mode 100644 resources/images/tag_editor.png diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 3fd640acd..8ea9b0dea 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtGui from openlp.core.lib import Receiver -from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab, DisplayTagTab +from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab from settingsdialog import Ui_SettingsDialog log = logging.getLogger(__name__) @@ -55,9 +55,6 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): # Advanced tab advancedTab = AdvancedTab() self.addTab(u'Advanced', advancedTab) - ## Edit Display Tags tab - #self.displayTagTab = DisplayTagTab() - #self.addTab(u'Display Tags', self.displayTagTab) def addTab(self, name, tab): """ diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py new file mode 100644 index 000000000..7e3be55cd --- /dev/null +++ b/resources/forms/displaytabdialog.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'displaytabdialog.ui' +# +# Created: Sun Feb 20 17:37:30 2011 +# by: PyQt4 UI code generator 4.8.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +try: + _fromUtf8 = QtCore.QString.fromUtf8 +except AttributeError: + _fromUtf8 = lambda s: s + +class Ui_displayTagEdit(object): + def setupUi(self, displayTagEdit): + displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) + displayTagEdit.resize(725, 548) + self.widget = QtGui.QWidget(displayTagEdit) + self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) + self.widget.setObjectName(_fromUtf8("widget")) + self.gridLayout_2 = QtGui.QGridLayout(self.widget) + self.gridLayout_2.setMargin(0) + self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) + self.tagTableWidget = QtGui.QTableWidget(self.widget) + self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) + self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + self.tagTableWidget.setAlternatingRowColors(True) + self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.tagTableWidget.setCornerButtonEnabled(False) + self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) + self.tagTableWidget.setColumnCount(4) + self.tagTableWidget.setRowCount(0) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(0, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(1, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(2, item) + item = QtGui.QTableWidgetItem() + self.tagTableWidget.setHorizontalHeaderItem(3, item) + self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) + spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.defaultPushButton = QtGui.QPushButton(self.widget) + self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) + self.horizontalLayout.addWidget(self.defaultPushButton) + self.deletePushButton = QtGui.QPushButton(self.widget) + self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) + self.horizontalLayout.addWidget(self.deletePushButton) + self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) + self.editGroupBox = QtGui.QGroupBox(self.widget) + self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) + self.gridLayout = QtGui.QGridLayout(self.editGroupBox) + self.gridLayout.setObjectName(_fromUtf8("gridLayout")) + self.descriptionLabel = QtGui.QLabel(self.editGroupBox) + self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) + self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) + self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) + self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) + self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) + self.addPushButton = QtGui.QPushButton(self.editGroupBox) + self.addPushButton.setObjectName(_fromUtf8("addPushButton")) + self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) + self.newPushButton = QtGui.QPushButton(self.editGroupBox) + self.newPushButton.setObjectName(_fromUtf8("newPushButton")) + self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) + self.tagLabel = QtGui.QLabel(self.editGroupBox) + self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.tagLabel.setObjectName(_fromUtf8("tagLabel")) + self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) + self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) + self.tagLineEdit.setMaxLength(5) + self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) + self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) + self.startTagLabel = QtGui.QLabel(self.editGroupBox) + self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) + self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) + self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) + self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) + self.endTagLabel = QtGui.QLabel(self.editGroupBox) + self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) + self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) + self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) + self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) + self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) + self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) + self.updatePushButton = QtGui.QPushButton(self.editGroupBox) + self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) + self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) + self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(self.widget) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setObjectName(_fromUtf8("buttonBox")) + self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) + + self.retranslateUi(displayTagEdit) + QtCore.QMetaObject.connectSlotsByName(displayTagEdit) + + def retranslateUi(self, displayTagEdit): + displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) + self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) + self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) + self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) + self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) + self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) + self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) + self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) + self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/resources/images/tag_editor.png b/resources/images/tag_editor.png new file mode 100644 index 0000000000000000000000000000000000000000..d03963448a44afac47fb33551416dad2ba58168a GIT binary patch literal 1131 zcmV-x1eE)UP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXS| z0U#KwC`vg100ZkuL_t(|+MSbsXjNqx$3O4AclUVjox`y$&8BUxbQOe^TKQ{+=&BWr z7Fn<*nL+<#2~s4Hgb-F%N~ckVsE?m17# zgV#&zI;#)7yyrdd^E`a{p6^jC2ljA@_V#x10idO&MR6J0+S&v_DMfR0bG~jFuon~n zbu@*H&=T*AXUVVftn0dj!(r6T>PlR`Fs+6 zBD%^xX4AX4S4`Jbv7%ymJ-JEM*Dsf#KMUWX{v^X&*0CZIO(vt3)&*EB38W zkur^Yf4*nm_6N5vZ5`O*Dgfs3v1(QiM?wllJrcf($#IPtv&t!nYLvt@;zdPRuFIHV zk+LmLo=BpnEp*qxD}k4WVr<-Mu;BIu?&3v@t0Uxa!SjT8sXt^=l(?p0nJxxd6d_F8 z#q|Wk&SF|w5@j*m;xLY3(K>YlQ@ov&m3wmN(9zJr0|&c9v~@_P2=3MV5$9Hk*}y!|16#kzdxy{VQ*g z>6NqO{mnPYpWi$rz+GGQ&`3V@0QVIm3oMOdw{XF&BFo%B{Wlckf`UMW< z^LGLrCVBFTZQGWKuro>VzF#g|H`e(|tL4!LX3HO6-Y4gN|1P)(?kuP{5{VR49EkPc z?#eB+_oaB_LyH@$!o2ci5#Cjg`O%w8j)ICU%aY4s99$@STC3%nnYD7;-0NlNi&_~z z`ay7Kn&y=icXxLa3Wf5%hT_z!O&I3~S^aV;G0mfGqsfmWOR(K(e0#i$#>U2p6&r>j z;~6~CBPTkGrKYAvW>(FX{qL5^;ht5JC+NGf;;yc)U?(^i5q8g!8rwiB-Nrl5jBwtW zPByfLq0f5&!Sg&C8X6dnBCmMB_Xkw4jt&3-002ovPDHLkV1m$-7>ED> literal 0 HcmV?d00001 From e2699eab3cadc2fd719a853a1586d69fe64618a2 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 17:12:36 +0000 Subject: [PATCH 5/7] Review Fixes --- openlp/core/ui/displaytagdialog.py | 16 ++-- openlp/core/ui/displaytagform.py | 3 + resources/forms/displaytabdialog.py | 125 ---------------------------- 3 files changed, 11 insertions(+), 133 deletions(-) delete mode 100644 resources/forms/displaytabdialog.py diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index 5da529302..ab3363058 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -139,14 +139,14 @@ class Ui_DisplayTagDialog(object): self.defaultPushButton.setText( translate('OpenLP.DisplayTagTab', 'Default')) self.newPushButton.setText(UiStrings.New) - self.tagTableWidget.horizontalHeaderItem(0) \ - .setText(translate('OpenLP.DisplayTagTab', 'Description')) - self.tagTableWidget.horizontalHeaderItem(1) \ - .setText(translate('OpenLP.DisplayTagTab', 'Tag id')) - self.tagTableWidget.horizontalHeaderItem(2) \ - .setText(translate('OpenLP.DisplayTagTab', 'Start Html')) - self.tagTableWidget.horizontalHeaderItem(3) \ - .setText(translate('OpenLP.DisplayTagTab', 'End Html')) + self.tagTableWidget.horizontalHeaderItem(0).setText( + translate('OpenLP.DisplayTagTab', 'Description')) + self.tagTableWidget.horizontalHeaderItem(1).setText( + translate('OpenLP.DisplayTagTab', 'Tag id')) + self.tagTableWidget.horizontalHeaderItem(2).setText( + translate('OpenLP.DisplayTagTab', 'Start Html')) + self.tagTableWidget.horizontalHeaderItem(3).setText( + translate('OpenLP.DisplayTagTab', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index 48924759f..f7a8e7740 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -79,6 +79,9 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): return QtGui.QDialog.exec_(self) def load(self): + """ + Load the form with data and set the initial state of the buttons + """ self.newPushButton.setEnabled(True) self.updatePushButton.setEnabled(False) self.deletePushButton.setEnabled(False) diff --git a/resources/forms/displaytabdialog.py b/resources/forms/displaytabdialog.py deleted file mode 100644 index 7e3be55cd..000000000 --- a/resources/forms/displaytabdialog.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'displaytabdialog.ui' -# -# Created: Sun Feb 20 17:37:30 2011 -# by: PyQt4 UI code generator 4.8.3 -# -# WARNING! All changes made in this file will be lost! - -from PyQt4 import QtCore, QtGui - -try: - _fromUtf8 = QtCore.QString.fromUtf8 -except AttributeError: - _fromUtf8 = lambda s: s - -class Ui_displayTagEdit(object): - def setupUi(self, displayTagEdit): - displayTagEdit.setObjectName(_fromUtf8("displayTagEdit")) - displayTagEdit.resize(725, 548) - self.widget = QtGui.QWidget(displayTagEdit) - self.widget.setGeometry(QtCore.QRect(10, 10, 701, 521)) - self.widget.setObjectName(_fromUtf8("widget")) - self.gridLayout_2 = QtGui.QGridLayout(self.widget) - self.gridLayout_2.setMargin(0) - self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) - self.tagTableWidget = QtGui.QTableWidget(self.widget) - self.tagTableWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.tagTableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) - self.tagTableWidget.setAlternatingRowColors(True) - self.tagTableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) - self.tagTableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) - self.tagTableWidget.setCornerButtonEnabled(False) - self.tagTableWidget.setObjectName(_fromUtf8("tagTableWidget")) - self.tagTableWidget.setColumnCount(4) - self.tagTableWidget.setRowCount(0) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(0, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(1, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(2, item) - item = QtGui.QTableWidgetItem() - self.tagTableWidget.setHorizontalHeaderItem(3, item) - self.gridLayout_2.addWidget(self.tagTableWidget, 0, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) - spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) - self.defaultPushButton = QtGui.QPushButton(self.widget) - self.defaultPushButton.setObjectName(_fromUtf8("defaultPushButton")) - self.horizontalLayout.addWidget(self.defaultPushButton) - self.deletePushButton = QtGui.QPushButton(self.widget) - self.deletePushButton.setObjectName(_fromUtf8("deletePushButton")) - self.horizontalLayout.addWidget(self.deletePushButton) - self.gridLayout_2.addLayout(self.horizontalLayout, 1, 0, 1, 1) - self.editGroupBox = QtGui.QGroupBox(self.widget) - self.editGroupBox.setObjectName(_fromUtf8("editGroupBox")) - self.gridLayout = QtGui.QGridLayout(self.editGroupBox) - self.gridLayout.setObjectName(_fromUtf8("gridLayout")) - self.descriptionLabel = QtGui.QLabel(self.editGroupBox) - self.descriptionLabel.setAlignment(QtCore.Qt.AlignCenter) - self.descriptionLabel.setObjectName(_fromUtf8("descriptionLabel")) - self.gridLayout.addWidget(self.descriptionLabel, 0, 0, 1, 1) - self.descriptionLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.descriptionLineEdit.setObjectName(_fromUtf8("descriptionLineEdit")) - self.gridLayout.addWidget(self.descriptionLineEdit, 0, 1, 2, 1) - self.addPushButton = QtGui.QPushButton(self.editGroupBox) - self.addPushButton.setObjectName(_fromUtf8("addPushButton")) - self.gridLayout.addWidget(self.addPushButton, 0, 2, 1, 1) - self.newPushButton = QtGui.QPushButton(self.editGroupBox) - self.newPushButton.setObjectName(_fromUtf8("newPushButton")) - self.gridLayout.addWidget(self.newPushButton, 1, 2, 2, 1) - self.tagLabel = QtGui.QLabel(self.editGroupBox) - self.tagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.tagLabel.setObjectName(_fromUtf8("tagLabel")) - self.gridLayout.addWidget(self.tagLabel, 2, 0, 1, 1) - self.tagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.tagLineEdit.setMaximumSize(QtCore.QSize(50, 16777215)) - self.tagLineEdit.setMaxLength(5) - self.tagLineEdit.setObjectName(_fromUtf8("tagLineEdit")) - self.gridLayout.addWidget(self.tagLineEdit, 2, 1, 1, 1) - self.startTagLabel = QtGui.QLabel(self.editGroupBox) - self.startTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.startTagLabel.setObjectName(_fromUtf8("startTagLabel")) - self.gridLayout.addWidget(self.startTagLabel, 3, 0, 1, 1) - self.startTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.startTagLineEdit.setObjectName(_fromUtf8("startTagLineEdit")) - self.gridLayout.addWidget(self.startTagLineEdit, 3, 1, 1, 1) - self.endTagLabel = QtGui.QLabel(self.editGroupBox) - self.endTagLabel.setAlignment(QtCore.Qt.AlignCenter) - self.endTagLabel.setObjectName(_fromUtf8("endTagLabel")) - self.gridLayout.addWidget(self.endTagLabel, 4, 0, 1, 1) - self.endTagLineEdit = QtGui.QLineEdit(self.editGroupBox) - self.endTagLineEdit.setObjectName(_fromUtf8("endTagLineEdit")) - self.gridLayout.addWidget(self.endTagLineEdit, 4, 1, 1, 1) - self.updatePushButton = QtGui.QPushButton(self.editGroupBox) - self.updatePushButton.setObjectName(_fromUtf8("updatePushButton")) - self.gridLayout.addWidget(self.updatePushButton, 4, 2, 1, 1) - self.gridLayout_2.addWidget(self.editGroupBox, 2, 0, 1, 1) - self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) - self.buttonBox.setObjectName(_fromUtf8("buttonBox")) - self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 1) - - self.retranslateUi(displayTagEdit) - QtCore.QMetaObject.connectSlotsByName(displayTagEdit) - - def retranslateUi(self, displayTagEdit): - displayTagEdit.setWindowTitle(QtGui.QApplication.translate("displayTagEdit", "Form", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("displayTagEdit", "Key", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("displayTagEdit", "Start Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.tagTableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("displayTagEdit", "End Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.defaultPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Default", None, QtGui.QApplication.UnicodeUTF8)) - self.deletePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Delete", None, QtGui.QApplication.UnicodeUTF8)) - self.editGroupBox.setTitle(QtGui.QApplication.translate("displayTagEdit", "Edit Selection", None, QtGui.QApplication.UnicodeUTF8)) - self.descriptionLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Description", None, QtGui.QApplication.UnicodeUTF8)) - self.addPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Add", None, QtGui.QApplication.UnicodeUTF8)) - self.newPushButton.setText(QtGui.QApplication.translate("displayTagEdit", "New", None, QtGui.QApplication.UnicodeUTF8)) - self.tagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Tag", None, QtGui.QApplication.UnicodeUTF8)) - self.startTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "Start tag", None, QtGui.QApplication.UnicodeUTF8)) - self.endTagLabel.setText(QtGui.QApplication.translate("displayTagEdit", "End tag", None, QtGui.QApplication.UnicodeUTF8)) - self.updatePushButton.setText(QtGui.QApplication.translate("displayTagEdit", "Update", None, QtGui.QApplication.UnicodeUTF8)) - From d486547abd5cfa3e248e471fe86cf62d58eb5c2f Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 21 Feb 2011 20:06:55 +0000 Subject: [PATCH 6/7] Fixes from last merge --- openlp/core/ui/__init__.py | 1 - openlp/core/ui/displaytagdialog.py | 24 +++++------ openlp/core/ui/displaytagform.py | 66 ++++++++++++++++-------------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 5763b3470..0f62a6dcf 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -63,7 +63,6 @@ from splashscreen import SplashScreen from generaltab import GeneralTab from themestab import ThemesTab from advancedtab import AdvancedTab -from displaytagtab import DisplayTagTab from aboutform import AboutForm from pluginform import PluginForm from settingsform import SettingsForm diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py index ab3363058..edb8567cf 100644 --- a/openlp/core/ui/displaytagdialog.py +++ b/openlp/core/ui/displaytagdialog.py @@ -123,30 +123,30 @@ class Ui_DisplayTagDialog(object): QtCore.QMetaObject.connectSlotsByName(displayTagDialog) def retranslateUi(self, displayTagDialog): - displayTagDialog.setWindowTitle(translate('OpenLP.displayTagForm', + displayTagDialog.setWindowTitle(translate('OpenLP.displayTagDialog', 'Configure Display Tags')) self.editGroupBox.setTitle( - translate('OpenLP.DisplayTagTab', 'Edit Selection')) + translate('OpenLP.DisplayTagDialog', 'Edit Selection')) self.updatePushButton.setText( - translate('OpenLP.DisplayTagTab', 'Update')) + translate('OpenLP.DisplayTagDialog', 'Update')) self.descriptionLabel.setText( - translate('OpenLP.DisplayTagTab', 'Description')) - self.tagLabel.setText(translate('OpenLP.DisplayTagTab', 'Tag')) + translate('OpenLP.DisplayTagDialog', 'Description')) + self.tagLabel.setText(translate('OpenLP.DisplayTagDialog', 'Tag')) self.startTagLabel.setText( - translate('OpenLP.DisplayTagTab', 'Start tag')) - self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) + translate('OpenLP.DisplayTagDialog', 'Start tag')) + self.endTagLabel.setText(translate('OpenLP.DisplayTagDialog', 'End tag')) self.deletePushButton.setText(UiStrings.Delete) self.defaultPushButton.setText( - translate('OpenLP.DisplayTagTab', 'Default')) + translate('OpenLP.DisplayTagDialog', 'Default')) self.newPushButton.setText(UiStrings.New) self.tagTableWidget.horizontalHeaderItem(0).setText( - translate('OpenLP.DisplayTagTab', 'Description')) + translate('OpenLP.DisplayTagDialog', 'Description')) self.tagTableWidget.horizontalHeaderItem(1).setText( - translate('OpenLP.DisplayTagTab', 'Tag id')) + translate('OpenLP.DisplayTagDialog', 'Tag id')) self.tagTableWidget.horizontalHeaderItem(2).setText( - translate('OpenLP.DisplayTagTab', 'Start Html')) + translate('OpenLP.DisplayTagDialog', 'Start Html')) self.tagTableWidget.horizontalHeaderItem(3).setText( - translate('OpenLP.DisplayTagTab', 'End Html')) + translate('OpenLP.DisplayTagDialog', 'End Html')) self.tagTableWidget.setColumnWidth(0, 120) self.tagTableWidget.setColumnWidth(1, 40) self.tagTableWidget.setColumnWidth(2, 240) diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py index f7a8e7740..fa05c578a 100644 --- a/openlp/core/ui/displaytagform.py +++ b/openlp/core/ui/displaytagform.py @@ -47,6 +47,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) + self.preLoad() QtCore.QObject.connect(self.tagTableWidget, QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected) QtCore.QObject.connect(self.defaultPushButton, @@ -63,7 +64,18 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): Load Display and set field state. """ # Create initial copy from master + self.preLoad() self._resetTable() + self.selected = -1 + return QtGui.QDialog.exec_(self) + + def preLoad(self): + """ + Load the Tags from store so can be used in the system or used to + update the display. If Cancel was selected this is needed to reset the + dsiplay to the correct version. + """ + # Initial Load of the Tags DisplayTags.reset_html_tags() user_expands = QtCore.QSettings().value(u'displayTags/html_tags', QtCore.QVariant(u'')).toString() @@ -74,37 +86,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): # If we have some user ones added them as well for t in user_tags: DisplayTags.add_html_tag(t) - self.selected = -1 - self.load() - return QtGui.QDialog.exec_(self) - - def load(self): - """ - Load the form with data and set the initial state of the buttons - """ - self.newPushButton.setEnabled(True) - self.updatePushButton.setEnabled(False) - self.deletePushButton.setEnabled(False) - for linenumber, html in enumerate(DisplayTags.get_html_tags()): - self.tagTableWidget.setRowCount( - self.tagTableWidget.rowCount() + 1) - self.tagTableWidget.setItem(linenumber, 0, - QtGui.QTableWidgetItem(html[u'desc'])) - self.tagTableWidget.setItem(linenumber, 1, - QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) - self.tagTableWidget.setItem(linenumber, 2, - QtGui.QTableWidgetItem(html[u'start html'])) - self.tagTableWidget.setItem(linenumber, 3, - QtGui.QTableWidgetItem(html[u'end html'])) - self.tagTableWidget.resizeRowsToContents() - self.descriptionLineEdit.setText(u'') - self.tagLineEdit.setText(u'') - self.startTagLineEdit.setText(u'') - self.endTagLineEdit.setText(u'') - self.descriptionLineEdit.setEnabled(False) - self.tagLineEdit.setEnabled(False) - self.startTagLineEdit.setEnabled(False) - self.endTagLineEdit.setEnabled(False) def accept(self): """ @@ -223,6 +204,29 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog): """ self.tagTableWidget.clearContents() self.tagTableWidget.setRowCount(0) + self.newPushButton.setEnabled(True) + self.updatePushButton.setEnabled(False) + self.deletePushButton.setEnabled(False) + for linenumber, html in enumerate(DisplayTags.get_html_tags()): + self.tagTableWidget.setRowCount( + self.tagTableWidget.rowCount() + 1) + self.tagTableWidget.setItem(linenumber, 0, + QtGui.QTableWidgetItem(html[u'desc'])) + self.tagTableWidget.setItem(linenumber, 1, + QtGui.QTableWidgetItem(self._strip(html[u'start tag']))) + self.tagTableWidget.setItem(linenumber, 2, + QtGui.QTableWidgetItem(html[u'start html'])) + self.tagTableWidget.setItem(linenumber, 3, + QtGui.QTableWidgetItem(html[u'end html'])) + self.tagTableWidget.resizeRowsToContents() + self.descriptionLineEdit.setText(u'') + self.tagLineEdit.setText(u'') + self.startTagLineEdit.setText(u'') + self.endTagLineEdit.setText(u'') + self.descriptionLineEdit.setEnabled(False) + self.tagLineEdit.setEnabled(False) + self.startTagLineEdit.setEnabled(False) + self.endTagLineEdit.setEnabled(False) def _strip(self, tag): """ From 642934a999f7dfc8a0d0e272de3ad50782e51530 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 22 Feb 2011 20:41:35 +0200 Subject: [PATCH 7/7] Fixed a bug where the settings for the remotes plugin were not actually used. --- openlp/plugins/remotes/lib/httpserver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/remotes/lib/httpserver.py b/openlp/plugins/remotes/lib/httpserver.py index 6ec9476a8..7ced66103 100644 --- a/openlp/plugins/remotes/lib/httpserver.py +++ b/openlp/plugins/remotes/lib/httpserver.py @@ -68,11 +68,13 @@ class HttpServer(object): """ log.debug(u'Start TCP server') port = QtCore.QSettings().value( - self.parent.settingsSection + u'/remote port', + self.parent.settingsSection + u'/port', QtCore.QVariant(4316)).toInt()[0] + address = QtCore.QSettings().value( + self.parent.settingsSection + u'/ip address', + QtCore.QVariant(u'0.0.0.0')).toString() self.server = QtNetwork.QTcpServer() - self.server.listen(QtNetwork.QHostAddress(QtNetwork.QHostAddress.Any), - port) + self.server.listen(QtNetwork.QHostAddress(address), port) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'slidecontroller_live_changed'), self.slide_change) @@ -347,4 +349,4 @@ class HttpConnection(object): log.debug(u'close socket') self.socket.close() self.socket = None - self.parent.close_connection(self) \ No newline at end of file + self.parent.close_connection(self)