diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index f07d7c78d..33280f83b 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -319,20 +319,6 @@ def check_directory_exists(dir): if not os.path.exists(dir): os.makedirs(dir) -def save_cancel_button_box(parent): - """ - Return a standard dialog button box with save and cancel buttons. - """ - button_box = QtGui.QDialogButtonBox(parent) - button_box.setStandardButtons(QtGui.QDialogButtonBox.Save | - QtGui.QDialogButtonBox.Cancel) - button_box.setObjectName(u'%sButtonBox' % parent) - QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), - parent.accept) - QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'), - parent.reject) - return button_box - from theme import ThemeLevel, ThemeXML, BackgroundGradientType, \ BackgroundType, HorizontalType, VerticalType from displaytags import DisplayTags diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 1b4ed206c..faca42119 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -55,3 +55,17 @@ def add_welcome_page(parent, image): parent.welcomeLayout.addWidget(parent.informationLabel) parent.welcomeLayout.addStretch() parent.addPage(parent.welcomePage) + +def save_cancel_button_box(parent): + """ + Return a standard dialog button box with save and cancel buttons. + """ + button_box = QtGui.QDialogButtonBox(parent) + button_box.setStandardButtons( + QtGui.QDialogButtonBox.Save | QtGui.QDialogButtonBox.Cancel) + button_box.setObjectName(u'%sButtonBox' % parent) + QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), + parent.accept) + QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'), + parent.reject) + return button_box diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 0993c48b2..d4c86fa61 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, build_icon, save_cancel_button_box +from openlp.core.lib import translate, build_icon +from openlp.core.lib.ui import save_cancel_button_box class Ui_ServiceItemEditDialog(object): def setupUi(self, serviceItemEditDialog): diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index 5cb68d03f..e659e50db 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import save_cancel_button_box, translate +from openlp.core.lib import translate +from openlp.core.lib.ui import save_cancel_button_box class ServiceNoteForm(QtGui.QDialog): """ diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 3d5e3a3f7..75717c082 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate, save_cancel_button_box +from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import save_cancel_button_box class Ui_CustomEditDialog(object): def setupUi(self, customEditDialog): diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index 1325590d9..93bff68b8 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, SpellTextEdit, save_cancel_button_box +from openlp.core.lib import translate, SpellTextEdit +from openlp.core.lib.ui import save_cancel_button_box class Ui_CustomSlideEditDialog(object): def setupUi(self, customSlideEditDialog): diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index daae83525..3fd3c5fef 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, save_cancel_button_box +from openlp.core.lib import translate +from openlp.core.lib.ui import save_cancel_button_box class Ui_AuthorsDialog(object): def setupUi(self, authorsDialog): diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index b9b6e5baf..c44b42d46 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate, save_cancel_button_box +from openlp.core.lib import build_icon, translate +from openlp.core.lib.ui import save_cancel_button_box class Ui_EditSongDialog(object): def setupUi(self, editSongDialog): diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index d74da50d1..deaf952e2 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -26,8 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, save_cancel_button_box, translate, \ - SpellTextEdit +from openlp.core.lib import build_icon, translate, SpellTextEdit +from openlp.core.lib.ui import save_cancel_button_box from openlp.plugins.songs.lib import VerseType class Ui_EditVerseDialog(object): diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 757a629ab..fcd6bd364 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, save_cancel_button_box +from openlp.core.lib import translate +from openlp.core.lib.ui import save_cancel_button_box class Ui_SongBookDialog(object): def setupUi(self, songBookDialog): diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 38c45407f..f2c9fdeba 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -26,7 +26,8 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate, save_cancel_button_box +from openlp.core.lib import translate +from openlp.core.lib.ui import save_cancel_button_box class Ui_TopicsDialog(object): def setupUi(self, topicsDialog):