forked from openlp/openlp
Change Combobox to Checkbox for plugin states
This commit is contained in:
parent
607371a6d7
commit
6d0e006b09
@ -53,10 +53,9 @@ class Ui_PluginViewDialog(object):
|
|||||||
self.plugin_info_layout.setObjectName('plugin_info_layout')
|
self.plugin_info_layout.setObjectName('plugin_info_layout')
|
||||||
self.status_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
self.status_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
||||||
self.status_label.setObjectName('status_label')
|
self.status_label.setObjectName('status_label')
|
||||||
self.status_combo_box = QtWidgets.QComboBox(self.plugin_info_group_box)
|
self.status_checkbox = QtWidgets.QCheckBox(self.plugin_info_group_box)
|
||||||
self.status_combo_box.addItems(('', ''))
|
self.status_checkbox.setObjectName('status_checkbox')
|
||||||
self.status_combo_box.setObjectName('status_combo_box')
|
self.plugin_info_layout.addRow(self.status_label, self.status_checkbox)
|
||||||
self.plugin_info_layout.addRow(self.status_label, self.status_combo_box)
|
|
||||||
self.version_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
self.version_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
||||||
self.version_label.setObjectName('version_label')
|
self.version_label.setObjectName('version_label')
|
||||||
self.version_number_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
self.version_number_label = QtWidgets.QLabel(self.plugin_info_group_box)
|
||||||
@ -83,5 +82,4 @@ class Ui_PluginViewDialog(object):
|
|||||||
self.version_label.setText('%s:' % UiStrings().Version)
|
self.version_label.setText('%s:' % UiStrings().Version)
|
||||||
self.about_label.setText('%s:' % UiStrings().About)
|
self.about_label.setText('%s:' % UiStrings().About)
|
||||||
self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
|
self.status_label.setText(translate('OpenLP.PluginForm', 'Status:'))
|
||||||
self.status_combo_box.setItemText(0, translate('OpenLP.PluginForm', 'Active'))
|
self.status_checkbox.setText(translate('OpenLP.PluginForm', 'Active'))
|
||||||
self.status_combo_box.setItemText(1, translate('OpenLP.PluginForm', 'Inactive'))
|
|
||||||
|
@ -49,7 +49,7 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
self._clear_details()
|
self._clear_details()
|
||||||
# Right, now let's put some signals and slots together!
|
# Right, now let's put some signals and slots together!
|
||||||
self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
|
self.plugin_list_widget.itemSelectionChanged.connect(self.on_plugin_list_widget_selection_changed)
|
||||||
self.status_combo_box.currentIndexChanged.connect(self.on_status_combo_box_changed)
|
self.status_checkbox.stateChanged.connect(self.on_status_checkbox_changed)
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -86,10 +86,10 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
Clear the plugin details widgets
|
Clear the plugin details widgets
|
||||||
"""
|
"""
|
||||||
self.status_combo_box.setCurrentIndex(-1)
|
self.status_checkbox.setChecked(False)
|
||||||
self.version_number_label.setText('')
|
self.version_number_label.setText('')
|
||||||
self.about_text_browser.setHtml('')
|
self.about_text_browser.setHtml('')
|
||||||
self.status_combo_box.setEnabled(False)
|
self.status_checkbox.setEnabled(False)
|
||||||
|
|
||||||
def _set_details(self):
|
def _set_details(self):
|
||||||
"""
|
"""
|
||||||
@ -99,11 +99,8 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
self.version_number_label.setText(self.active_plugin.version)
|
self.version_number_label.setText(self.active_plugin.version)
|
||||||
self.about_text_browser.setHtml(self.active_plugin.about())
|
self.about_text_browser.setHtml(self.active_plugin.about())
|
||||||
self.programatic_change = True
|
self.programatic_change = True
|
||||||
status = PluginStatus.Active
|
self.status_checkbox.setChecked(self.active_plugin.status == PluginStatus.Active)
|
||||||
if self.active_plugin.status == PluginStatus.Active:
|
self.status_checkbox.setEnabled(True)
|
||||||
status = PluginStatus.Inactive
|
|
||||||
self.status_combo_box.setCurrentIndex(status)
|
|
||||||
self.status_combo_box.setEnabled(True)
|
|
||||||
self.programatic_change = False
|
self.programatic_change = False
|
||||||
|
|
||||||
def on_plugin_list_widget_selection_changed(self):
|
def on_plugin_list_widget_selection_changed(self):
|
||||||
@ -125,13 +122,13 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties):
|
|||||||
else:
|
else:
|
||||||
self._clear_details()
|
self._clear_details()
|
||||||
|
|
||||||
def on_status_combo_box_changed(self, status):
|
def on_status_checkbox_changed(self, status):
|
||||||
"""
|
"""
|
||||||
If the status of a plugin is altered, apply the change
|
If the status of a plugin is altered, apply the change
|
||||||
"""
|
"""
|
||||||
if self.programatic_change or status == PluginStatus.Disabled:
|
if self.programatic_change:
|
||||||
return
|
return
|
||||||
if status == PluginStatus.Inactive:
|
if status:
|
||||||
self.application.set_busy_cursor()
|
self.application.set_busy_cursor()
|
||||||
self.active_plugin.toggle_status(PluginStatus.Active)
|
self.active_plugin.toggle_status(PluginStatus.Active)
|
||||||
self.application.set_normal_cursor()
|
self.application.set_normal_cursor()
|
||||||
|
Loading…
Reference in New Issue
Block a user