diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index f4f29c36a..e09f4d164 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -109,8 +109,8 @@ def create_button_box(dialog, name, standard_buttons, custom_buttons=None): button_box.addButton(button, QtGui.QDialogButtonBox.ActionRole) else: button_box.addButton(*button) - QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), dialog.accept) - QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'), dialog.reject) + button_box.accepted.connect(dialog.accept) + button_box.rejected.connect(dialog.reject) return button_box @@ -211,7 +211,7 @@ def create_button(parent, name, **kwargs): if not kwargs.pop(u'enabled', True): button.setEnabled(False) if kwargs.get(u'click'): - QtCore.QObject.connect(button, QtCore.SIGNAL(u'clicked()'), kwargs.pop(u'click')) + button.clicked.connect(kwargs.pop(u'click')) for key in kwargs.keys(): if key not in [u'text', u'icon', u'tooltip', u'click']: log.warn(u'Parameter %s was not consumed in create_button().', key) @@ -297,8 +297,7 @@ def create_action(parent, name, **kwargs): action_list = ActionList.get_instance() action_list.add_action(action, unicode(kwargs.pop(u'category'))) if kwargs.get(u'triggers'): - QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'), - kwargs.pop(u'triggers')) + action.triggered.connect(kwargs.pop(u'triggers')) for key in kwargs.keys(): if key not in [u'text', u'icon', u'tooltip', u'statustip', u'checked', u'shortcuts', u'category', u'triggers']: log.warn(u'Parameter %s was not consumed in create_action().', key) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 23315d5e8..7762d72aa 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -142,8 +142,7 @@ class ServiceManagerDialog(object): self.service_manager_list.setHeaderHidden(True) self.service_manager_list.setExpandsOnDoubleClick(False) self.service_manager_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) - QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), - self.context_menu) + self.service_manager_list.customContextMenuRequested.connect(self.context_menu) self.service_manager_list.setObjectName(u'service_manager_list') # enable drop self.service_manager_list.__class__.dragEnterEvent = self.drag_enter_event @@ -202,14 +201,10 @@ class ServiceManagerDialog(object): triggers=self.make_live) self.layout.addWidget(self.order_toolbar) # Connect up our signals and slots - QtCore.QObject.connect(self.theme_combo_box, QtCore.SIGNAL(u'activated(int)'), - self.on_theme_combo_box_selected) - QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), - self.on_make_live) - QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL(u'itemCollapsed(QTreeWidgetItem*)'), - self.collapsed) - QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL(u'itemExpanded(QTreeWidgetItem*)'), - self.expanded) + self.theme_combo_box.activated.connect(self.on_theme_combo_box_selected) + self.service_manager_list.doubleClicked.connect(self.on_make_live) + self.service_manager_list.itemCollapsed.connect(self.collapsed) + self.service_manager_list.itemExpanded.connect(self.expanded) Registry().register_function(u'theme_update_list', self.update_theme_list) Registry().register_function(u'config_updated', self.config_updated) Registry().register_function(u'config_screen_changed', self.regenerate_service_Items) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index c58a8aefd..ed8f5c9fc 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -105,8 +105,7 @@ class ThemeManager(QtGui.QWidget): self.theme_list_widget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.theme_list_widget.setObjectName(u'theme_list_widget') self.layout.addWidget(self.theme_list_widget) - QtCore.QObject.connect(self.theme_list_widget, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), - self.context_menu) + self.theme_list_widget.customContextMenuRequested.connect(self.context_menu) # build the context menu self.menu = QtGui.QMenu() self.edit_action = create_widget_action(self.menu, @@ -130,10 +129,8 @@ class ThemeManager(QtGui.QWidget): text=translate('OpenLP.ThemeManager', '&Export Theme'), icon=u':/general/general_export.png', triggers=self.on_export_theme) # Signals - QtCore.QObject.connect(self.theme_list_widget, - QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.change_global_from_screen) - QtCore.QObject.connect(self.theme_list_widget, - QtCore.SIGNAL(u'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), self.check_list_state) + self.theme_list_widget.doubleClicked.connect(self.change_global_from_screen) + self.theme_list_widget.currentItemChanged.connect(self.check_list_state) Registry().register_function(u'theme_update_global', self.change_global_from_tab) Registry().register_function(u'config_updated', self.config_updated) # Variables