More Signal removals

This commit is contained in:
Tim Bentley 2013-02-14 21:50:10 +00:00
parent bd0ff619a9
commit c6ad115b10
3 changed files with 12 additions and 21 deletions

View File

@ -109,8 +109,8 @@ def create_button_box(dialog, name, standard_buttons, custom_buttons=None):
button_box.addButton(button, QtGui.QDialogButtonBox.ActionRole) button_box.addButton(button, QtGui.QDialogButtonBox.ActionRole)
else: else:
button_box.addButton(*button) button_box.addButton(*button)
QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'accepted()'), dialog.accept) button_box.accepted.connect(dialog.accept)
QtCore.QObject.connect(button_box, QtCore.SIGNAL(u'rejected()'), dialog.reject) button_box.rejected.connect(dialog.reject)
return button_box return button_box
@ -211,7 +211,7 @@ def create_button(parent, name, **kwargs):
if not kwargs.pop(u'enabled', True): if not kwargs.pop(u'enabled', True):
button.setEnabled(False) button.setEnabled(False)
if kwargs.get(u'click'): 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(): for key in kwargs.keys():
if key not in [u'text', u'icon', u'tooltip', u'click']: if key not in [u'text', u'icon', u'tooltip', u'click']:
log.warn(u'Parameter %s was not consumed in create_button().', key) 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 = ActionList.get_instance()
action_list.add_action(action, unicode(kwargs.pop(u'category'))) action_list.add_action(action, unicode(kwargs.pop(u'category')))
if kwargs.get(u'triggers'): if kwargs.get(u'triggers'):
QtCore.QObject.connect(action, QtCore.SIGNAL(u'triggered(bool)'), action.triggered.connect(kwargs.pop(u'triggers'))
kwargs.pop(u'triggers'))
for key in kwargs.keys(): 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']: 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) log.warn(u'Parameter %s was not consumed in create_action().', key)

View File

@ -142,8 +142,7 @@ class ServiceManagerDialog(object):
self.service_manager_list.setHeaderHidden(True) self.service_manager_list.setHeaderHidden(True)
self.service_manager_list.setExpandsOnDoubleClick(False) self.service_manager_list.setExpandsOnDoubleClick(False)
self.service_manager_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.service_manager_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.service_manager_list.customContextMenuRequested.connect(self.context_menu)
self.context_menu)
self.service_manager_list.setObjectName(u'service_manager_list') self.service_manager_list.setObjectName(u'service_manager_list')
# enable drop # enable drop
self.service_manager_list.__class__.dragEnterEvent = self.drag_enter_event self.service_manager_list.__class__.dragEnterEvent = self.drag_enter_event
@ -202,14 +201,10 @@ class ServiceManagerDialog(object):
triggers=self.make_live) triggers=self.make_live)
self.layout.addWidget(self.order_toolbar) self.layout.addWidget(self.order_toolbar)
# Connect up our signals and slots # Connect up our signals and slots
QtCore.QObject.connect(self.theme_combo_box, QtCore.SIGNAL(u'activated(int)'), self.theme_combo_box.activated.connect(self.on_theme_combo_box_selected)
self.on_theme_combo_box_selected) self.service_manager_list.doubleClicked.connect(self.on_make_live)
QtCore.QObject.connect(self.service_manager_list, QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.service_manager_list.itemCollapsed.connect(self.collapsed)
self.on_make_live) self.service_manager_list.itemExpanded.connect(self.expanded)
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)
Registry().register_function(u'theme_update_list', self.update_theme_list) 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_updated', self.config_updated)
Registry().register_function(u'config_screen_changed', self.regenerate_service_Items) Registry().register_function(u'config_screen_changed', self.regenerate_service_Items)

View File

@ -105,8 +105,7 @@ class ThemeManager(QtGui.QWidget):
self.theme_list_widget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.theme_list_widget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.theme_list_widget.setObjectName(u'theme_list_widget') self.theme_list_widget.setObjectName(u'theme_list_widget')
self.layout.addWidget(self.theme_list_widget) self.layout.addWidget(self.theme_list_widget)
QtCore.QObject.connect(self.theme_list_widget, QtCore.SIGNAL('customContextMenuRequested(QPoint)'), self.theme_list_widget.customContextMenuRequested.connect(self.context_menu)
self.context_menu)
# build the context menu # build the context menu
self.menu = QtGui.QMenu() self.menu = QtGui.QMenu()
self.edit_action = create_widget_action(self.menu, self.edit_action = create_widget_action(self.menu,
@ -130,10 +129,8 @@ class ThemeManager(QtGui.QWidget):
text=translate('OpenLP.ThemeManager', '&Export Theme'), text=translate('OpenLP.ThemeManager', '&Export Theme'),
icon=u':/general/general_export.png', triggers=self.on_export_theme) icon=u':/general/general_export.png', triggers=self.on_export_theme)
# Signals # Signals
QtCore.QObject.connect(self.theme_list_widget, self.theme_list_widget.doubleClicked.connect(self.change_global_from_screen)
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.change_global_from_screen) self.theme_list_widget.currentItemChanged.connect(self.check_list_state)
QtCore.QObject.connect(self.theme_list_widget,
QtCore.SIGNAL(u'currentItemChanged(QListWidgetItem *, QListWidgetItem *)'), self.check_list_state)
Registry().register_function(u'theme_update_global', self.change_global_from_tab) Registry().register_function(u'theme_update_global', self.change_global_from_tab)
Registry().register_function(u'config_updated', self.config_updated) Registry().register_function(u'config_updated', self.config_updated)
# Variables # Variables