From 3a19271a18fd6e001da480512bd86425f4056afe Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 3 Jul 2010 22:39:29 +0200 Subject: [PATCH 01/11] Shuffle the menus. --- openlp/core/ui/mainwindow.py | 110 ++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 3f392655d..85ae1af53 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -147,16 +147,20 @@ class Ui_MainWindow(object): self.FileImportMenu.setObjectName(u'FileImportMenu') self.FileExportMenu = QtGui.QMenu(self.FileMenu) self.FileExportMenu.setObjectName(u'FileExportMenu') - self.OptionsMenu = QtGui.QMenu(self.MenuBar) - self.OptionsMenu.setObjectName(u'OptionsMenu') - self.OptionsViewMenu = QtGui.QMenu(self.OptionsMenu) - self.OptionsViewMenu.setObjectName(u'OptionsViewMenu') - self.ViewModeMenu = QtGui.QMenu(self.OptionsViewMenu) + # View Menu + self.ViewMenu = QtGui.QMenu(self.MenuBar) + self.ViewMenu.setObjectName(u'ViewMenu') + self.ViewModeMenu = QtGui.QMenu(self.ViewMenu) self.ViewModeMenu.setObjectName(u'ViewModeMenu') - self.OptionsLanguageMenu = QtGui.QMenu(self.OptionsMenu) - self.OptionsLanguageMenu.setObjectName(u'OptionsLanguageMenu') + # Tools Menu self.ToolsMenu = QtGui.QMenu(self.MenuBar) self.ToolsMenu.setObjectName(u'ToolsMenu') + # Settings Menu + self.SettingsMenu = QtGui.QMenu(self.MenuBar) + self.SettingsMenu.setObjectName(u'SettingsMenu') + self.SettingsLanguageMenu = QtGui.QMenu(self.SettingsMenu) + self.SettingsLanguageMenu.setObjectName(u'SettingsLanguageMenu') + # Help Menu self.HelpMenu = QtGui.QMenu(self.MenuBar) self.HelpMenu.setObjectName(u'HelpMenu') MainWindow.setMenuBar(self.MenuBar) @@ -240,10 +244,10 @@ class Ui_MainWindow(object): self.ExportLanguageItem.setObjectName(u'ExportLanguageItem') self.actionLook_Feel = QtGui.QAction(MainWindow) self.actionLook_Feel.setObjectName(u'actionLook_Feel') - self.OptionsSettingsItem = QtGui.QAction(MainWindow) + self.SettingsConfigureItem = QtGui.QAction(MainWindow) SettingsIcon = build_icon(u':/system/system_settings.png') - self.OptionsSettingsItem.setIcon(SettingsIcon) - self.OptionsSettingsItem.setObjectName(u'OptionsSettingsItem') + self.SettingsConfigureItem.setIcon(SettingsIcon) + self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem') self.ViewMediaManagerItem = QtGui.QAction(MainWindow) self.ViewMediaManagerItem.setCheckable(True) self.ViewMediaManagerItem.setChecked(self.MediaManagerDock.isVisible()) @@ -260,9 +264,9 @@ class Ui_MainWindow(object): self.ServiceManagerDock.isVisible()) self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') - self.PluginItem = QtGui.QAction(MainWindow) - #self.PluginItem.setIcon(AlertIcon) - self.PluginItem.setObjectName(u'PluginItem') + self.SettingsPluginListItem = QtGui.QAction(MainWindow) + #self.SettingsPluginListItem.setIcon(AlertIcon) + self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem') self.HelpDocumentationItem = QtGui.QAction(MainWindow) ContentsIcon = build_icon(u':/system/system_help_contents.png') self.HelpDocumentationItem.setIcon(ContentsIcon) @@ -297,11 +301,11 @@ class Ui_MainWindow(object): AddToolIcon = build_icon(u':/tools/tools_add.png') self.ToolsAddToolItem.setIcon(AddToolIcon) self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem') - self.action_Preview_Panel = QtGui.QAction(MainWindow) - self.action_Preview_Panel.setCheckable(True) - self.action_Preview_Panel.setChecked( + self.ViewPreviewPanel = QtGui.QAction(MainWindow) + self.ViewPreviewPanel.setCheckable(True) + self.ViewPreviewPanel.setChecked( self.settingsmanager.showPreviewPanel) - self.action_Preview_Panel.setObjectName(u'action_Preview_Panel') + self.ViewPreviewPanel.setObjectName(u'ViewPreviewPanel') self.PreviewController.Panel.setVisible( self.settingsmanager.showPreviewPanel) self.ModeLiveItem = QtGui.QAction(MainWindow) @@ -315,22 +319,24 @@ class Ui_MainWindow(object): self.FileImportMenu.menuAction(), self.FileExportMenu.menuAction(), self.FileExitItem) add_actions(self.ViewModeMenu, [self.ModeLiveItem]) - add_actions(self.OptionsViewMenu, (self.ViewModeMenu.menuAction(), + add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(), None, self.ViewMediaManagerItem, self.ViewServiceManagerItem, - self.ViewThemeManagerItem, None, self.action_Preview_Panel)) + self.ViewThemeManagerItem, None, self.ViewPreviewPanel)) #i18n add Language Actions - add_actions(self.OptionsLanguageMenu, (self.AutoLanguageItem, None)) - add_actions(self.OptionsLanguageMenu, self.LanguageGroup.actions()) - add_actions(self.OptionsMenu, (self.OptionsLanguageMenu.menuAction(), - self.OptionsViewMenu.menuAction(), None, self.OptionsSettingsItem)) + add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None)) + add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) + add_actions(self.SettingsMenu, (self.SettingsPluginListItem, + self.SettingsLanguageMenu.menuAction(), None, + self.SettingsConfigureItem)) add_actions(self.ToolsMenu, - (self.PluginItem, None, self.ToolsAddToolItem)) + (self.ToolsAddToolItem, None)) add_actions(self.HelpMenu, (self.HelpDocumentationItem, self.HelpOnlineHelpItem, None, self.HelpWebSiteItem, self.HelpAboutItem)) add_actions(self.MenuBar, - (self.FileMenu.menuAction(), self.OptionsMenu.menuAction(), - self.ToolsMenu.menuAction(), self.HelpMenu.menuAction())) + (self.FileMenu.menuAction(), self.ViewMenu.menuAction(), + self.ToolsMenu.menuAction(), self.SettingsMenu.menuAction(), + self.HelpMenu.menuAction())) # Initialise the translation self.retranslateUi(MainWindow) self.MediaToolBox.setCurrentIndex(0) @@ -360,12 +366,12 @@ class Ui_MainWindow(object): self.FileMenu.setTitle(translate('MainWindow', '&File')) self.FileImportMenu.setTitle(translate('MainWindow', '&Import')) self.FileExportMenu.setTitle(translate('MainWindow', '&Export')) - self.OptionsMenu.setTitle(translate('MainWindow', '&Options')) - self.OptionsViewMenu.setTitle(translate('MainWindow', '&View')) + self.ViewMenu.setTitle(translate('MainWindow', '&View')) self.ViewModeMenu.setTitle(translate('MainWindow', 'M&ode')) - self.OptionsLanguageMenu.setTitle(translate('MainWindow', - '&Language')) self.ToolsMenu.setTitle(translate('MainWindow', '&Tools')) + self.SettingsMenu.setTitle(translate('MainWindow', '&Settings')) + self.SettingsLanguageMenu.setTitle(translate('MainWindow', + '&Language')) self.HelpMenu.setTitle(translate('MainWindow', '&Help')) self.MediaManagerDock.setWindowTitle( translate('MainWindow', 'Media Manager')) @@ -376,23 +382,23 @@ class Ui_MainWindow(object): self.FileNewItem.setText(translate('MainWindow', '&New')) self.FileNewItem.setToolTip(translate('MainWindow', 'New Service')) self.FileNewItem.setStatusTip( - translate('MainWindow', 'Create a new Service')) + translate('MainWindow', 'Create a new service.')) self.FileNewItem.setShortcut(translate('MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('MainWindow', '&Open')) self.FileOpenItem.setToolTip(translate('MainWindow', 'Open Service')) self.FileOpenItem.setStatusTip( - translate('MainWindow', 'Open an existing service')) + translate('MainWindow', 'Open an existing service.')) self.FileOpenItem.setShortcut(translate('MainWindow', 'Ctrl+O')) self.FileSaveItem.setText(translate('MainWindow', '&Save')) self.FileSaveItem.setToolTip(translate('MainWindow', 'Save Service')) self.FileSaveItem.setStatusTip( - translate('MainWindow', 'Save the current service to disk')) + translate('MainWindow', 'Save the current service to disk.')) self.FileSaveItem.setShortcut(translate('MainWindow', 'Ctrl+S')) self.FileSaveAsItem.setText(translate('MainWindow', 'Save &As...')) self.FileSaveAsItem.setToolTip( translate('MainWindow', 'Save Service As')) self.FileSaveAsItem.setStatusTip(translate('MainWindow', - 'Save the current service under a new name')) + 'Save the current service under a new name.')) self.FileSaveAsItem.setShortcut(translate('MainWindow', 'F12')) self.FileExitItem.setText(translate('MainWindow', 'E&xit')) self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP')) @@ -402,39 +408,41 @@ class Ui_MainWindow(object): self.ExportThemeItem.setText(translate('MainWindow', '&Theme')) self.ExportLanguageItem.setText(translate('MainWindow', '&Language')) self.actionLook_Feel.setText(translate('MainWindow', 'Look && &Feel')) - self.OptionsSettingsItem.setText(translate('MainWindow', '&Settings')) + self.SettingsConfigureItem.setText(translate('MainWindow', + '&Configure OpenLP...')) self.ViewMediaManagerItem.setText( translate('MainWindow', '&Media Manager')) self.ViewMediaManagerItem.setToolTip( translate('MainWindow', 'Toggle Media Manager')) self.ViewMediaManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Media Manager')) + 'Toggle the visibility of the media manager.')) self.ViewMediaManagerItem.setShortcut(translate('MainWindow', 'F8')) self.ViewThemeManagerItem.setText( translate('MainWindow', '&Theme Manager')) self.ViewThemeManagerItem.setToolTip( translate('MainWindow', 'Toggle Theme Manager')) self.ViewThemeManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Theme Manager')) + 'Toggle the visibility of the theme manager.')) self.ViewThemeManagerItem.setShortcut(translate('MainWindow', 'F10')) self.ViewServiceManagerItem.setText( translate('MainWindow', '&Service Manager')) self.ViewServiceManagerItem.setToolTip( translate('MainWindow', 'Toggle Service Manager')) self.ViewServiceManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Service Manager')) + 'Toggle the visibility of the service manager.')) self.ViewServiceManagerItem.setShortcut(translate('MainWindow', 'F9')) - self.action_Preview_Panel.setText( + self.ViewPreviewPanel.setText( translate('MainWindow', '&Preview Panel')) - self.action_Preview_Panel.setToolTip( + self.ViewPreviewPanel.setToolTip( translate('MainWindow', 'Toggle Preview Panel')) - self.action_Preview_Panel.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Preview Panel')) - self.action_Preview_Panel.setShortcut(translate('MainWindow', 'F11')) - self.PluginItem.setText(translate('MainWindow', '&Plugin List')) - self.PluginItem.setStatusTip( + self.ViewPreviewPanel.setStatusTip(translate('MainWindow', + 'Toggle the visibility of the preview panel.')) + self.ViewPreviewPanel.setShortcut(translate('MainWindow', 'F11')) + self.SettingsPluginListItem.setText(translate('MainWindow', + '&Plugin List')) + self.SettingsPluginListItem.setStatusTip( translate('MainWindow', 'List the Plugins')) - self.PluginItem.setShortcut(translate('MainWindow', 'Alt+F7')) + self.SettingsPluginListItem.setShortcut(translate('MainWindow', 'Alt+F7')) self.HelpDocumentationItem.setText( translate('MainWindow', '&User Guide')) self.HelpAboutItem.setText(translate('MainWindow', '&About')) @@ -456,8 +464,6 @@ class Ui_MainWindow(object): self.ToolsAddToolItem.setStatusTip( translate('MainWindow', 'Add an application to the list of tools')) - self.action_Preview_Panel.setText( - translate('MainWindow', '&Preview Pane')) self.ModeLiveItem.setText(translate('MainWindow', '&Live')) @@ -514,7 +520,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.ViewThemeManagerItem, QtCore.SIGNAL(u'triggered(bool)'), self.toggleThemeManager) - QtCore.QObject.connect(self.action_Preview_Panel, + QtCore.QObject.connect(self.ViewPreviewPanel, QtCore.SIGNAL(u'toggled(bool)'), self.togglePreviewPanel) QtCore.QObject.connect(self.MediaManagerDock, @@ -528,14 +534,14 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.ViewThemeManagerItem.setChecked) QtCore.QObject.connect(self.PreviewController.Panel, QtCore.SIGNAL(u'visibilityChanged(bool)'), - self.action_Preview_Panel.setChecked) + self.ViewPreviewPanel.setChecked) QtCore.QObject.connect(self.HelpWebSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, QtCore.SIGNAL(u'triggered()'), self.onHelpAboutItemClicked) - QtCore.QObject.connect(self.PluginItem, + QtCore.QObject.connect(self.SettingsPluginListItem, QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) - QtCore.QObject.connect(self.OptionsSettingsItem, + QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged) From 0a4c9481bf1afa307c37fb2aeafe31ec016eb428 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sat, 3 Jul 2010 23:07:21 +0200 Subject: [PATCH 02/11] Add a nice little icon for the plugin list. --- openlp/core/ui/mainwindow.py | 3 ++- resources/images/openlp-2.qrc | 1 + resources/images/settings_plugin_list.png | Bin 0 -> 800 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 resources/images/settings_plugin_list.png diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 85ae1af53..e9ec4d96a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -265,7 +265,8 @@ class Ui_MainWindow(object): self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') self.SettingsPluginListItem = QtGui.QAction(MainWindow) - #self.SettingsPluginListItem.setIcon(AlertIcon) + PluginListIcon = build_icon(u':/system/settings_plugin_list.png') + self.SettingsPluginListItem.setIcon(PluginListIcon) self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem') self.HelpDocumentationItem = QtGui.QAction(MainWindow) ContentsIcon = build_icon(u':/system/system_help_contents.png') diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 118a30eae..c9277c3cf 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -98,6 +98,7 @@ system_servicemanager.png system_thememanager.png system_exit.png + settings_plugin_list.png system_settings.png diff --git a/resources/images/settings_plugin_list.png b/resources/images/settings_plugin_list.png new file mode 100644 index 0000000000000000000000000000000000000000..a633007124601cccb2e9bfa3e2c1dac47c6f34b2 GIT binary patch literal 800 zcmV+*1K<3KP)xdv|7@Z+9W&U}y9A z&b)b_FW3IyJ}bmYOc za{iEFg%*q#CWn5vR$kJTwyVL7H?ujU9wH!V|Hs;gurG5tGQfs!uyu3QxcX{lk}fyt z9!b5w``o^)%b>`Aw1h^POkrL+6w*zLl<5zV*+uH+f5Fk^J4^J)Z%@^2Q z&lI*qjd=u9fsH0uvIT8nkckPtZ~z!$bvuNOdN_svWkgt4nIZ;1w_i&~w87&x^Q8*` z1r;I$A^B|hES;`Dgod7&p2KUIm8Ia-LFV5D?N0!7@XRr6ivC5}9t`#*IgOV{8PbN%a zK-Fb{ziLji`yqKDg=@NY;z&pbV3=rfpkI>Amyqum_yVmJUDq=z+ZTZ-licw>neQx# e7$smHhs}Sa^}E Date: Tue, 6 Jul 2010 13:58:33 +0100 Subject: [PATCH 03/11] Rename CheckedBoxen --- openlp/core/ui/amendthemedialog.py | 16 ++++++++-------- openlp/core/ui/amendthemeform.py | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 2bb202964..a5cd69610 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -596,15 +596,15 @@ class Ui_AmendThemeDialog(object): self.TransitionGroupBox.setObjectName(u'TransitionGroupBox') self.gridLayout_5 = QtGui.QGridLayout(self.TransitionGroupBox) self.gridLayout_5.setObjectName(u'gridLayout_5') - self.SlideTransitionCheckedBoxLabel = QtGui.QLabel( + self.SlideTransitionCheckBoxLabel = QtGui.QLabel( self.TransitionGroupBox) - self.SlideTransitionCheckedBoxLabel.setObjectName( - u'SlideTransitionCheckedBoxLabel') + self.SlideTransitionCheckBoxLabel.setObjectName( + u'SlideTransitionCheckBoxLabel') self.gridLayout_5.addWidget( - self.SlideTransitionCheckedBoxLabel, 0, 0, 1, 1) - self.SlideTransitionCheckedBox = QtGui.QCheckBox(self.AlignmentGroupBox) - self.SlideTransitionCheckedBox.setTristate(False) - self.gridLayout_5.addWidget(self.SlideTransitionCheckedBox, 0, 1, 1, 1) + self.SlideTransitionCheckBoxLabel, 0, 0, 1, 1) + self.SlideTransitionCheckBox = QtGui.QCheckBox(self.AlignmentGroupBox) + self.SlideTransitionCheckBox.setTristate(False) + self.gridLayout_5.addWidget(self.SlideTransitionCheckBox, 0, 1, 1, 1) self.OptionsRightLayout.addWidget(self.TransitionGroupBox) spacerItem6 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) @@ -864,7 +864,7 @@ class Ui_AmendThemeDialog(object): translate('AmendThemeForm', 'Bottom')) self.TransitionGroupBox.setTitle( translate('AmendThemeForm', 'Slide Transition')) - self.SlideTransitionCheckedBoxLabel.setText( + self.SlideTransitionCheckBoxLabel.setText( translate('AmendThemeForm', 'Transition active:')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.OtherOptionsTab), diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index c85eff4b8..1c2658dc3 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -133,9 +133,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtCore.QObject.connect(self.OutlineSpinBox, QtCore.SIGNAL(u'editingFinished()'), self.onOutlineSpinBoxChanged) - QtCore.QObject.connect(self.SlideTransitionCheckedBox, + QtCore.QObject.connect(self.SlideTransitionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onSlideTransitionCheckedBoxChanged) + self.onSlideTransitionCheckBoxChanged) def accept(self): new_theme = ThemeXML() @@ -500,7 +500,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.stateChanging(self.theme) self.previewTheme() - def onSlideTransitionCheckedBoxChanged(self, value): + def onSlideTransitionCheckBoxChanged(self, value): if value == 2: # checked self.theme.display_slideTransition = True else: @@ -624,9 +624,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.ShadowColorPushButton.setEnabled(False) self.ShadowSpinBox.setValue(int(self.theme.display_shadow_size)) if self.theme.display_slideTransition: - self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Checked) + self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Checked) else: - self.SlideTransitionCheckedBox.setCheckState(QtCore.Qt.Unchecked) + self.SlideTransitionCheckBox.setCheckState(QtCore.Qt.Unchecked) self.HorizontalComboBox.setCurrentIndex( self.theme.display_horizontalAlign) self.VerticalComboBox.setCurrentIndex(self.theme.display_verticalAlign) From 419b21a2b16c888af0566f0c4175a37349b4bf1c Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 6 Jul 2010 17:26:52 +0200 Subject: [PATCH 04/11] Fix up some strings and come bugs in the alerts plugin. --- openlp/plugins/alerts/alertsplugin.py | 7 ++++--- openlp/plugins/alerts/forms/alertform.py | 7 ++++--- openlp/plugins/alerts/lib/alertsmanager.py | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index fbf7df6db..d5dd4e274 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -35,7 +35,7 @@ from openlp.plugins.alerts.forms import AlertForm log = logging.getLogger(__name__) -class alertsPlugin(Plugin): +class AlertsPlugin(Plugin): log.info(u'Alerts Plugin loaded') def __init__(self, plugin_helpers): @@ -88,7 +88,7 @@ class alertsPlugin(Plugin): Plugin.finalise(self) self.toolsAlertItem.setVisible(False) - def togglealertsState(self): + def toggleAlertsState(self): self.alertsActive = not self.alertsActive QtCore.QSettings().setValue( self.settingsSection + u'/active', @@ -102,4 +102,5 @@ class alertsPlugin(Plugin): about_text = translate('AlertsPlugin', 'Alerts Plugin
This plugin ' 'controls the displaying of alerts on the presentations screen') - return about_text \ No newline at end of file + return about_text + diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index bf75f9ced..388d35751 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -88,13 +88,14 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.AlertTextEdit.setText(u'') self.SaveButton.setEnabled(False) self.DeleteButton.setEnabled(False) - self.EditButton.setEnabled(False) def onNewClick(self): if len(self.AlertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, - translate('AlertsPlugin.AlertForm', 'Item selected to Add'), - translate('AlertsPlugin.AlertForm', 'Missing data')) + translate('AlertsPlugin.AlertForm', 'New Alert'), + translate('AlertsPlugin.AlertForm', 'You haven\'t specified ' + 'any text for your alert. Please type in some text before ' + 'clicking New.')) else: alert = AlertItem() alert.text = unicode(self.AlertTextEdit.text()) diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index aac3eccb9..a8c4c9bfe 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -95,7 +95,7 @@ class AlertsManager(QtCore.QObject): alertTab = self.parent.alertsTab text = HTMLCODE % (alertTab.font_color, alertTab.bg_color, alertTab.font_face, alertTab.font_size, text) - self.parent.preview_controller.parent.displayManager.addAlert(text, + self.parent.previewController.parent.displayManager.addAlert(text, alertTab.location) # check to see if we have a timer running if self.timer_id == 0: @@ -112,8 +112,9 @@ class AlertsManager(QtCore.QObject): log.debug(u'timer event') alertTab = self.parent.alertsTab if event.timerId() == self.timer_id: - self.parent.preview_controller.parent.displayManager.addAlert(u'', + self.parent.previewController.parent.displayManager.addAlert(u'', alertTab.location) self.killTimer(self.timer_id) self.timer_id = 0 self.generateAlert() + From 4c291bbed033ec78191e6eee4e4e1fc30c442531 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 6 Jul 2010 22:05:48 +0200 Subject: [PATCH 05/11] Added View Modes. --- openlp/core/lib/settingsmanager.py | 30 ++++- openlp/core/ui/mainwindow.py | 191 +++++++++++++++++++++-------- 2 files changed, 165 insertions(+), 56 deletions(-) diff --git a/openlp/core/lib/settingsmanager.py b/openlp/core/lib/settingsmanager.py index 74a5d4866..a8c8e7c50 100644 --- a/openlp/core/lib/settingsmanager.py +++ b/openlp/core/lib/settingsmanager.py @@ -57,15 +57,33 @@ class SettingsManager(object): self.mainwindow_left + self.mainwindow_right) - 100 ) / 2 self.slidecontroller_image = self.slidecontroller - 50 - self.showPreviewPanel = QtCore.QSettings().value( - u'user interface/preview panel', QtCore.QVariant(True)).toBool() - - def togglePreviewPanel(self, isVisible): + def get_preview_visibility(self): """ - Toggle the preview panel visibility. + Return the preview panel's visibility. + """ + return QtCore.QSettings().value(u'user interface/preview panel', + QtCore.QVariant(True)).toBool() + + def set_preview_visibility(self, visible): + """ + Set the preview panel's visibility. """ QtCore.QSettings().setValue(u'user interface/preview panel', - QtCore.QVariant(isVisible)) + QtCore.QVariant(visible)) + + def get_live_visibility(self): + """ + Return the live panel's visibility. + """ + return QtCore.QSettings().value(u'user interface/live panel', + QtCore.QVariant(True)).toBool() + + def set_live_visibility(self, visible): + """ + Set the live panel's visibility. + """ + QtCore.QSettings().setValue(u'user interface/live panel', + QtCore.QVariant(visible)) @staticmethod def get_last_dir(section, num=None): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index e9ec4d96a..d436ac379 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -172,8 +172,8 @@ class Ui_MainWindow(object): self.StatusBar.addPermanentWidget(self.DefaultThemeLabel) # Create the MediaManager self.MediaManagerDock = OpenLPDockWidget(MainWindow) - MediaManagerIcon = build_icon(u':/system/system_mediamanager.png') - self.MediaManagerDock.setWindowIcon(MediaManagerIcon) + self.MediaManagerDock.setWindowIcon( + build_icon(u':/system/system_mediamanager.png')) self.MediaManagerDock.setStyleSheet(media_manager_style) self.MediaManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_left) @@ -192,8 +192,8 @@ class Ui_MainWindow(object): QtCore.Qt.DockWidgetArea(1), self.MediaManagerDock) # Create the service manager self.ServiceManagerDock = OpenLPDockWidget(MainWindow) - ServiceManagerIcon = build_icon(u':/system/system_servicemanager.png') - self.ServiceManagerDock.setWindowIcon(ServiceManagerIcon) + self.ServiceManagerDock.setWindowIcon( + build_icon(u':/system/system_servicemanager.png')) self.ServiceManagerDock.setObjectName(u'ServiceManagerDock') self.ServiceManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) @@ -203,8 +203,8 @@ class Ui_MainWindow(object): QtCore.Qt.DockWidgetArea(2), self.ServiceManagerDock) # Create the theme manager self.ThemeManagerDock = OpenLPDockWidget(MainWindow) - ThemeManagerIcon = build_icon(u':/system/system_thememanager.png') - self.ThemeManagerDock.setWindowIcon(ThemeManagerIcon) + self.ThemeManagerDock.setWindowIcon( + build_icon(u':/system/system_thememanager.png')) self.ThemeManagerDock.setObjectName(u'ThemeManagerDock') self.ThemeManagerDock.setMinimumWidth( self.settingsmanager.mainwindow_right) @@ -231,8 +231,7 @@ class Ui_MainWindow(object): self.FileSaveAsItem = QtGui.QAction(MainWindow) self.FileSaveAsItem.setObjectName(u'FileSaveAsItem') self.FileExitItem = QtGui.QAction(MainWindow) - ExitIcon = build_icon(u':/system/system_exit.png') - self.FileExitItem.setIcon(ExitIcon) + self.FileExitItem.setIcon(build_icon(u':/system/system_exit.png')) self.FileExitItem.setObjectName(u'FileExitItem') self.ImportThemeItem = QtGui.QAction(MainWindow) self.ImportThemeItem.setObjectName(u'ImportThemeItem') @@ -242,40 +241,41 @@ class Ui_MainWindow(object): self.ExportThemeItem.setObjectName(u'ExportThemeItem') self.ExportLanguageItem = QtGui.QAction(MainWindow) self.ExportLanguageItem.setObjectName(u'ExportLanguageItem') - self.actionLook_Feel = QtGui.QAction(MainWindow) - self.actionLook_Feel.setObjectName(u'actionLook_Feel') self.SettingsConfigureItem = QtGui.QAction(MainWindow) - SettingsIcon = build_icon(u':/system/system_settings.png') - self.SettingsConfigureItem.setIcon(SettingsIcon) + self.SettingsConfigureItem.setIcon( + build_icon(u':/system/system_settings.png')) self.SettingsConfigureItem.setObjectName(u'SettingsConfigureItem') self.ViewMediaManagerItem = QtGui.QAction(MainWindow) self.ViewMediaManagerItem.setCheckable(True) self.ViewMediaManagerItem.setChecked(self.MediaManagerDock.isVisible()) - self.ViewMediaManagerItem.setIcon(MediaManagerIcon) + self.ViewMediaManagerItem.setIcon( + build_icon(u':/system/system_mediamanager.png')) self.ViewMediaManagerItem.setObjectName(u'ViewMediaManagerItem') self.ViewThemeManagerItem = QtGui.QAction(MainWindow) self.ViewThemeManagerItem.setCheckable(True) self.ViewThemeManagerItem.setChecked(self.ThemeManagerDock.isVisible()) - self.ViewThemeManagerItem.setIcon(ThemeManagerIcon) + self.ViewThemeManagerItem.setIcon( + build_icon(u':/system/system_thememanager.png')) self.ViewThemeManagerItem.setObjectName(u'ViewThemeManagerItem') self.ViewServiceManagerItem = QtGui.QAction(MainWindow) self.ViewServiceManagerItem.setCheckable(True) self.ViewServiceManagerItem.setChecked( self.ServiceManagerDock.isVisible()) - self.ViewServiceManagerItem.setIcon(ServiceManagerIcon) + self.ViewServiceManagerItem.setIcon( + build_icon(u':/system/system_servicemanager.png')) self.ViewServiceManagerItem.setObjectName(u'ViewServiceManagerItem') self.SettingsPluginListItem = QtGui.QAction(MainWindow) - PluginListIcon = build_icon(u':/system/settings_plugin_list.png') - self.SettingsPluginListItem.setIcon(PluginListIcon) + self.SettingsPluginListItem.setIcon( + build_icon(u':/system/settings_plugin_list.png')) self.SettingsPluginListItem.setObjectName(u'SettingsPluginListItem') self.HelpDocumentationItem = QtGui.QAction(MainWindow) - ContentsIcon = build_icon(u':/system/system_help_contents.png') - self.HelpDocumentationItem.setIcon(ContentsIcon) + self.HelpDocumentationItem.setIcon( + build_icon(u':/system/system_help_contents.png')) self.HelpDocumentationItem.setObjectName(u'HelpDocumentationItem') self.HelpDocumentationItem.setEnabled(False) self.HelpAboutItem = QtGui.QAction(MainWindow) - AboutIcon = build_icon(u':/system/system_about.png') - self.HelpAboutItem.setIcon(AboutIcon) + self.HelpAboutItem.setIcon( + build_icon(u':/system/system_about.png')) self.HelpAboutItem.setObjectName(u'HelpAboutItem') self.HelpOnlineHelpItem = QtGui.QAction(MainWindow) self.HelpOnlineHelpItem.setObjectName(u'HelpOnlineHelpItem') @@ -299,18 +299,36 @@ class Ui_MainWindow(object): add_actions(self.LanguageGroup, [languageItem]) self.LanguageGroup.setDisabled(LanguageManager.AutoLanguage) self.ToolsAddToolItem = QtGui.QAction(MainWindow) - AddToolIcon = build_icon(u':/tools/tools_add.png') - self.ToolsAddToolItem.setIcon(AddToolIcon) + self.ToolsAddToolItem.setIcon(build_icon(u':/tools/tools_add.png')) self.ToolsAddToolItem.setObjectName(u'ToolsAddToolItem') self.ViewPreviewPanel = QtGui.QAction(MainWindow) self.ViewPreviewPanel.setCheckable(True) self.ViewPreviewPanel.setChecked( - self.settingsmanager.showPreviewPanel) + self.settingsmanager.get_preview_visibility()) self.ViewPreviewPanel.setObjectName(u'ViewPreviewPanel') self.PreviewController.Panel.setVisible( - self.settingsmanager.showPreviewPanel) + self.settingsmanager.get_preview_visibility()) + self.ViewLivePanel = QtGui.QAction(MainWindow) + self.ViewLivePanel.setCheckable(True) + self.ViewLivePanel.setChecked( + self.settingsmanager.get_live_visibility()) + self.ViewLivePanel.setObjectName(u'ViewLivePanel') + self.LiveController.Panel.setVisible( + self.settingsmanager.get_live_visibility()) + self.ModeDefaultItem = QtGui.QAction(MainWindow) + self.ModeDefaultItem.setCheckable(True) + self.ModeDefaultItem.setObjectName(u'ModeDefaultItem') + self.ModeSetupItem = QtGui.QAction(MainWindow) + self.ModeSetupItem.setCheckable(True) + self.ModeSetupItem.setObjectName(u'ModeLiveItem') self.ModeLiveItem = QtGui.QAction(MainWindow) + self.ModeLiveItem.setCheckable(True) self.ModeLiveItem.setObjectName(u'ModeLiveItem') + self.ModeGroup = QtGui.QActionGroup(MainWindow) + self.ModeGroup.addAction(self.ModeDefaultItem) + self.ModeGroup.addAction(self.ModeSetupItem) + self.ModeGroup.addAction(self.ModeLiveItem) + self.ModeDefaultItem.setChecked(True) add_actions(self.FileImportMenu, (self.ImportThemeItem, self.ImportLanguageItem)) add_actions(self.FileExportMenu, @@ -319,10 +337,12 @@ class Ui_MainWindow(object): self.FileSaveItem, self.FileSaveAsItem, None, self.FileImportMenu.menuAction(), self.FileExportMenu.menuAction(), self.FileExitItem) - add_actions(self.ViewModeMenu, [self.ModeLiveItem]) + add_actions(self.ViewModeMenu, (self.ModeDefaultItem, + self.ModeSetupItem, self.ModeLiveItem)) add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(), None, self.ViewMediaManagerItem, self.ViewServiceManagerItem, - self.ViewThemeManagerItem, None, self.ViewPreviewPanel)) + self.ViewThemeManagerItem, None, self.ViewPreviewPanel, + self.ViewLivePanel)) #i18n add Language Actions add_actions(self.SettingsLanguageMenu, (self.AutoLanguageItem, None)) add_actions(self.SettingsLanguageMenu, self.LanguageGroup.actions()) @@ -400,7 +420,7 @@ class Ui_MainWindow(object): translate('MainWindow', 'Save Service As')) self.FileSaveAsItem.setStatusTip(translate('MainWindow', 'Save the current service under a new name.')) - self.FileSaveAsItem.setShortcut(translate('MainWindow', 'F12')) + self.FileSaveAsItem.setShortcut(translate('MainWindow', 'Ctrl+Shift+S')) self.FileExitItem.setText(translate('MainWindow', 'E&xit')) self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP')) self.FileExitItem.setShortcut(translate('MainWindow', 'Alt+F4')) @@ -408,7 +428,6 @@ class Ui_MainWindow(object): self.ImportLanguageItem.setText(translate('MainWindow', '&Language')) self.ExportThemeItem.setText(translate('MainWindow', '&Theme')) self.ExportLanguageItem.setText(translate('MainWindow', '&Language')) - self.actionLook_Feel.setText(translate('MainWindow', 'Look && &Feel')) self.SettingsConfigureItem.setText(translate('MainWindow', '&Configure OpenLP...')) self.ViewMediaManagerItem.setText( @@ -439,6 +458,13 @@ class Ui_MainWindow(object): self.ViewPreviewPanel.setStatusTip(translate('MainWindow', 'Toggle the visibility of the preview panel.')) self.ViewPreviewPanel.setShortcut(translate('MainWindow', 'F11')) + self.ViewLivePanel.setText( + translate('MainWindow', '&Live Panel')) + self.ViewLivePanel.setToolTip( + translate('MainWindow', 'Toggle Live Panel')) + self.ViewLivePanel.setStatusTip(translate('MainWindow', + 'Toggle the visibility of the live panel.')) + self.ViewLivePanel.setShortcut(translate('MainWindow', 'F12')) self.SettingsPluginListItem.setText(translate('MainWindow', '&Plugin List')) self.SettingsPluginListItem.setStatusTip( @@ -453,10 +479,9 @@ class Ui_MainWindow(object): self.HelpOnlineHelpItem.setText( translate('MainWindow', '&Online Help')) self.HelpWebSiteItem.setText(translate('MainWindow', '&Web Site')) - #i18n self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect')) self.AutoLanguageItem.setStatusTip( - translate('MainWindow', 'Choose System language, if available')) + translate('MainWindow', 'Use the system language, if available.')) for item in self.LanguageGroup.actions(): item.setText(item.objectName()) item.setStatusTip(unicode(translate('MainWindow', @@ -464,8 +489,19 @@ class Ui_MainWindow(object): self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...')) self.ToolsAddToolItem.setStatusTip( translate('MainWindow', - 'Add an application to the list of tools')) + 'Add an application to the list of tools.')) + self.ModeDefaultItem.setText(translate('MainWindow', '&Default')) + self.ModeDefaultItem.setStatusTip( + translate('MainWindow', + 'Set the view mode back to the default.')) + self.ModeSetupItem.setText(translate('MainWindow', '&Setup')) + self.ModeSetupItem.setStatusTip( + translate('MainWindow', + 'Set the view mode to Setup.')) self.ModeLiveItem.setText(translate('MainWindow', '&Live')) + self.ModeLiveItem.setStatusTip( + translate('MainWindow', + 'Set the view mode to Live.')) class MainWindow(QtGui.QMainWindow, Ui_MainWindow): @@ -524,6 +560,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.ViewPreviewPanel, QtCore.SIGNAL(u'toggled(bool)'), self.togglePreviewPanel) + QtCore.QObject.connect(self.ViewLivePanel, + QtCore.SIGNAL(u'toggled(bool)'), + self.toggleLivePanel) QtCore.QObject.connect(self.MediaManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewMediaManagerItem.setChecked) @@ -533,9 +572,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.QObject.connect(self.ThemeManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewThemeManagerItem.setChecked) - QtCore.QObject.connect(self.PreviewController.Panel, - QtCore.SIGNAL(u'visibilityChanged(bool)'), - self.ViewPreviewPanel.setChecked) QtCore.QObject.connect(self.HelpWebSiteItem, QtCore.SIGNAL(u'triggered()'), self.onHelpWebSiteClicked) QtCore.QObject.connect(self.HelpAboutItem, @@ -544,16 +580,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'triggered()'), self.onPluginItemClicked) QtCore.QObject.connect(self.SettingsConfigureItem, QtCore.SIGNAL(u'triggered()'), self.onOptionsSettingsItemClicked) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage) QtCore.QObject.connect(self.FileNewItem, QtCore.SIGNAL(u'triggered()'), self.ServiceManagerContents.onNewService) @@ -571,6 +597,25 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage) self.LanguageGroup.triggered.connect(LanguageManager.set_language) + QtCore.QObject.connect(self.ModeDefaultItem, + QtCore.SIGNAL(u'triggered()'), + self.onModeDefaultItemClicked) + QtCore.QObject.connect(self.ModeSetupItem, + QtCore.SIGNAL(u'triggered()'), + self.onModeSetupItemClicked) + QtCore.QObject.connect(self.ModeLiveItem, + QtCore.SIGNAL(u'triggered()'), + self.onModeLiveItemClicked) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'theme_update_global'), self.defaultThemeChanged) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'openlp_version_check'), self.versionCheck) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage) #warning cyclic dependency #RenderManager needs to call ThemeManager and #ThemeManager needs to call RenderManager @@ -614,7 +659,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): log.info(u'Load data from Settings') self.settingsForm.postSetUp() - #i18n def setAutoLanguage(self, value): self.LanguageGroup.setDisabled(value) LanguageManager.AutoLanguage = value @@ -702,6 +746,48 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ self.settingsForm.exec_() + def onModeDefaultItemClicked(self): + """ + Put OpenLP into "Default" view mode. + """ + self.MediaManagerDock.setVisible(True) + self.ServiceManagerDock.setVisible(True) + self.ThemeManagerDock.setVisible(True) + self.PreviewController.Panel.setVisible(True) + self.LiveController.Panel.setVisible(True) + self.settingsmanager.set_preview_visibility(True) + self.settingsmanager.set_live_visibility(True) + self.ViewPreviewPanel.setChecked(True) + self.ViewLivePanel.setChecked(True) + + def onModeSetupItemClicked(self): + """ + Put OpenLP into "Setup" view mode. + """ + self.MediaManagerDock.setVisible(True) + self.ServiceManagerDock.setVisible(True) + self.ThemeManagerDock.setVisible(False) + self.PreviewController.Panel.setVisible(True) + self.LiveController.Panel.setVisible(False) + self.settingsmanager.set_preview_visibility(True) + self.settingsmanager.set_live_visibility(False) + self.ViewPreviewPanel.setChecked(True) + self.ViewLivePanel.setChecked(False) + + def onModeLiveItemClicked(self): + """ + Put OpenLP into "Live" view mode. + """ + self.MediaManagerDock.setVisible(False) + self.ServiceManagerDock.setVisible(True) + self.ThemeManagerDock.setVisible(False) + self.PreviewController.Panel.setVisible(False) + self.LiveController.Panel.setVisible(True) + self.settingsmanager.set_preview_visibility(False) + self.settingsmanager.set_live_visibility(True) + self.ViewPreviewPanel.setChecked(True) + self.ViewLivePanel.setChecked(True) + def screenChanged(self): """ The screen has changed to so tell the displays to update_display @@ -794,10 +880,15 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): if self.ThemeManagerDock.isVisible() != visible: self.ThemeManagerDock.setVisible(visible) - def togglePreviewPanel(self): - previewBool = self.PreviewController.Panel.isVisible() - self.PreviewController.Panel.setVisible(not previewBool) - self.settingsmanager.togglePreviewPanel(not previewBool) + def togglePreviewPanel(self, visible): + self.PreviewController.Panel.setVisible(visible) + self.settingsmanager.set_preview_visibility(visible) + self.ViewPreviewPanel.setChecked(visible) + + def toggleLivePanel(self, visible): + self.LiveController.Panel.setVisible(visible) + self.settingsmanager.set_live_visibility(visible) + self.ViewLivePanel.setChecked(visible) def loadSettings(self): log.debug(u'Loading QSettings') From 9e7f98e33c56e9f4ab64211517bfc8559f98369e Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 6 Jul 2010 22:27:57 +0200 Subject: [PATCH 06/11] Fixed a small bug where the item in the menu would remain checked despite the fact that the element on the form was no longer visible. --- openlp/core/ui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index d436ac379..3391f502a 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -785,7 +785,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.LiveController.Panel.setVisible(True) self.settingsmanager.set_preview_visibility(False) self.settingsmanager.set_live_visibility(True) - self.ViewPreviewPanel.setChecked(True) + self.ViewPreviewPanel.setChecked(False) self.ViewLivePanel.setChecked(True) def screenChanged(self): From b225a96d0960b0b6a60af0eb3ca050ea75a4b1d9 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 6 Jul 2010 22:18:55 +0100 Subject: [PATCH 07/11] Small modes refactoring --- openlp/core/ui/mainwindow.py | 42 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 3391f502a..a28e41772 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -753,12 +753,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(True) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(True) - self.PreviewController.Panel.setVisible(True) - self.LiveController.Panel.setVisible(True) - self.settingsmanager.set_preview_visibility(True) - self.settingsmanager.set_live_visibility(True) - self.ViewPreviewPanel.setChecked(True) - self.ViewLivePanel.setChecked(True) + self.togglePreviewPanel(True) + self.toggleLivePanel(True) def onModeSetupItemClicked(self): """ @@ -767,12 +763,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(True) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(False) - self.PreviewController.Panel.setVisible(True) - self.LiveController.Panel.setVisible(False) - self.settingsmanager.set_preview_visibility(True) - self.settingsmanager.set_live_visibility(False) - self.ViewPreviewPanel.setChecked(True) - self.ViewLivePanel.setChecked(False) + self.togglePreviewPanel(True) + self.toggleLivePanel(False) def onModeLiveItemClicked(self): """ @@ -781,12 +773,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(False) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(False) - self.PreviewController.Panel.setVisible(False) - self.LiveController.Panel.setVisible(True) - self.settingsmanager.set_preview_visibility(False) - self.settingsmanager.set_live_visibility(True) - self.ViewPreviewPanel.setChecked(False) - self.ViewLivePanel.setChecked(True) + self.togglePreviewPanel(False) + self.toggleLivePanel(True) def screenChanged(self): """ @@ -881,11 +869,29 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.ThemeManagerDock.setVisible(visible) def togglePreviewPanel(self, visible): + """ + Sets the visibility of the preview panel including saving the setting + and updating the menu. + + ``visible`` + A bool giving the state to set the panel to + True - Visible + False - Hidden + """ self.PreviewController.Panel.setVisible(visible) self.settingsmanager.set_preview_visibility(visible) self.ViewPreviewPanel.setChecked(visible) def toggleLivePanel(self, visible): + """ + Sets the visibility of the live panel including saving the setting and + updating the menu. + + ``visible`` + A bool giving the state to set the panel to + True - Visible + False - Hidden + """ self.LiveController.Panel.setVisible(visible) self.settingsmanager.set_live_visibility(visible) self.ViewLivePanel.setChecked(visible) From 8de0de9921baabca120d0ebd899bb6c83722f1ac Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 6 Jul 2010 22:23:09 +0100 Subject: [PATCH 08/11] Rename methods to better indicate function --- openlp/core/ui/mainwindow.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index a28e41772..9c5939070 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -559,10 +559,10 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.toggleThemeManager) QtCore.QObject.connect(self.ViewPreviewPanel, QtCore.SIGNAL(u'toggled(bool)'), - self.togglePreviewPanel) + self.setPreviewPanelVisibility) QtCore.QObject.connect(self.ViewLivePanel, QtCore.SIGNAL(u'toggled(bool)'), - self.toggleLivePanel) + self.setLivePanelVisibility) QtCore.QObject.connect(self.MediaManagerDock, QtCore.SIGNAL(u'visibilityChanged(bool)'), self.ViewMediaManagerItem.setChecked) @@ -753,8 +753,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(True) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(True) - self.togglePreviewPanel(True) - self.toggleLivePanel(True) + self.setPreviewPanelVisibility(True) + self.setLivePanelVisibility(True) def onModeSetupItemClicked(self): """ @@ -763,8 +763,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(True) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(False) - self.togglePreviewPanel(True) - self.toggleLivePanel(False) + self.setPreviewPanelVisibility(True) + self.setLivePanelVisibility(False) def onModeLiveItemClicked(self): """ @@ -773,8 +773,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.MediaManagerDock.setVisible(False) self.ServiceManagerDock.setVisible(True) self.ThemeManagerDock.setVisible(False) - self.togglePreviewPanel(False) - self.toggleLivePanel(True) + self.setPreviewPanelVisibility(False) + self.setLivePanelVisibility(True) def screenChanged(self): """ @@ -868,7 +868,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): if self.ThemeManagerDock.isVisible() != visible: self.ThemeManagerDock.setVisible(visible) - def togglePreviewPanel(self, visible): + def setPreviewPanelVisibility(self, visible): """ Sets the visibility of the preview panel including saving the setting and updating the menu. @@ -882,7 +882,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.settingsmanager.set_preview_visibility(visible) self.ViewPreviewPanel.setChecked(visible) - def toggleLivePanel(self, visible): + def setLivePanelVisibility(self, visible): """ Sets the visibility of the live panel including saving the setting and updating the menu. From 09fb6e6dda4566d56c921996e1e1da134bd3f99f Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 6 Jul 2010 22:59:52 +0100 Subject: [PATCH 09/11] Parent tweaks --- openlp/core/lib/toolbar.py | 2 +- openlp/core/ui/maindisplay.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index a2979746e..6b87f84fe 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -42,7 +42,7 @@ class OpenLPToolbar(QtGui.QToolBar): """ Initialise the toolbar. """ - QtGui.QToolBar.__init__(self, None) + QtGui.QToolBar.__init__(self, parent) # useful to be able to reuse button icons... self.icons = {} self.setIconSize(QtCore.QSize(20, 20)) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index b770a9e05..530cd6124 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -210,7 +210,6 @@ class MainDisplay(DisplayWidget): self.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) - self.parent = parent # WA_TranslucentBackground is not available in QT4.4 try: self.setAttribute(QtCore.Qt.WA_TranslucentBackground) @@ -616,7 +615,7 @@ class VideoDisplay(Phonon.VideoWidget): def mediaShow(self, message=''): """ - Show the video disaply if it was already hidden + Show the video display if it was already hidden """ if self.hidden: self.hidden = False @@ -625,7 +624,7 @@ class VideoDisplay(Phonon.VideoWidget): class AudioPlayer(QtCore.QObject): """ - This Class will play audio only allowing components to work witn a + This Class will play audio only allowing components to work with a soundtrack which does not take over the user interface. """ log.info(u'AudioPlayer Loaded') @@ -641,8 +640,7 @@ class AudioPlayer(QtCore.QObject): The list of screens. """ log.debug(u'AudioPlayer Initialisation started') - QtCore.QObject.__init__(self) - self.parent = parent + QtCore.QObject.__init__(self, parent) self.message = None self.mediaObject = Phonon.MediaObject() self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory) From 03a3d7b3f57d8565f95707a50659317e79ce0083 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 7 Jul 2010 17:40:17 +0200 Subject: [PATCH 10/11] (small) coding standard fixes --- openlp/core/ui/maindisplay.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 530cd6124..f6ced1851 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -240,7 +240,8 @@ class MainDisplay(DisplayWidget): #Sort out screen locations and sizes self.setGeometry(self.screen[u'size']) self.scene.setSceneRect(0,0,self.size().width(), self.size().height()) - self.webView.setGeometry(0, 0, self.size().width(), self.size().height()) + self.webView.setGeometry(0, 0, self.size().width(), + self.size().height()) #Build a custom splash screen self.InitialFrame = QtGui.QImage( self.screen[u'size'].width(), @@ -287,11 +288,14 @@ class MainDisplay(DisplayWidget): self.webView = QtWebKit.QWebView() self.page = self.webView.page() self.videoDisplay = self.page.mainFrame() - self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Vertical, QtCore.Qt.ScrollBarAlwaysOff) - self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff) + self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Vertical, + QtCore.Qt.ScrollBarAlwaysOff) + self.videoDisplay.setScrollBarPolicy(QtCore.Qt.Horizontal, + QtCore.Qt.ScrollBarAlwaysOff) self.proxy = QtGui.QGraphicsProxyWidget() self.proxy.setWidget(self.webView) - self.proxy.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) + self.proxy.setWindowFlags( + QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) self.proxy.setZValue(1) self.scene.addItem(self.proxy) @@ -412,7 +416,8 @@ class MainDisplay(DisplayWidget): log.debug(u'adddisplayVideo') self.displayImage(self.transparent) self.videoDisplay.setHtml(HTMLVIDEO % - (path, self.screen[u'size'].width(), self.screen[u'size'].height())) + (path, self.screen[u'size'].width(), + self.screen[u'size'].height())) def frameView(self, frame, transition=False): """ @@ -513,7 +518,7 @@ class VideoDisplay(Phonon.VideoWidget): Sets up the screen on a particular screen. """ log.debug(u'VideoDisplay Setup %s for %s ' % (self.screens, - self.screens.monitor_number)) + self.screens.monitor_number)) self.screen = self.screens.current #Sort out screen locations and sizes self.setGeometry(self.screen[u'size']) From bc15cc81046eff7c713548d999db30bf9eb8d082 Mon Sep 17 00:00:00 2001 From: andreas Date: Wed, 7 Jul 2010 18:00:44 +0200 Subject: [PATCH 11/11] -coding standard fixes --- openlp/core/ui/maindisplay.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index f6ced1851..8053144d7 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -294,8 +294,8 @@ class MainDisplay(DisplayWidget): QtCore.Qt.ScrollBarAlwaysOff) self.proxy = QtGui.QGraphicsProxyWidget() self.proxy.setWidget(self.webView) - self.proxy.setWindowFlags( - QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint) + self.proxy.setWindowFlags(QtCore.Qt.Window | + QtCore.Qt.FramelessWindowHint) self.proxy.setZValue(1) self.scene.addItem(self.proxy)