forked from openlp/openlp
- Added checkbox for controlling the visibility of Projectors panel in 1st time wiz.
This commit is contained in:
parent
c9065a286a
commit
4520403387
@ -187,8 +187,8 @@ class Settings(QtCore.QSettings):
|
||||
'user interface/main window state': QtCore.QByteArray(),
|
||||
'user interface/preview panel': True,
|
||||
'user interface/preview splitter geometry': QtCore.QByteArray(),
|
||||
'user interface/projectors hidden in wizard': True,
|
||||
'user interface/layout preset enabled': False,
|
||||
'projector/show after wizard': False,
|
||||
'projector/db type': 'sqlite',
|
||||
'projector/db username': '',
|
||||
'projector/db password': '',
|
||||
|
@ -576,7 +576,6 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties):
|
||||
self.progress_label.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Click the %s button to start OpenLP.') %
|
||||
clean_button_text(self.buttonText(QtWidgets.QWizard.FinishButton)))
|
||||
Settings().setValue('user interface/projectors hidden in wizard', True)
|
||||
self.finish_button.setVisible(True)
|
||||
self.finish_button.setEnabled(True)
|
||||
self.cancel_button.setVisible(False)
|
||||
|
@ -24,7 +24,7 @@ The UI widgets for the first time wizard.
|
||||
"""
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
from openlp.core.common import translate, is_macosx, clean_button_text
|
||||
from openlp.core.common import translate, is_macosx, clean_button_text, Settings
|
||||
from openlp.core.lib import build_icon
|
||||
from openlp.core.lib.ui import add_welcome_page
|
||||
|
||||
@ -136,6 +136,13 @@ class UiFirstTimeWizard(object):
|
||||
self.alert_check_box.setChecked(True)
|
||||
self.alert_check_box.setObjectName('alert_check_box')
|
||||
self.plugin_layout.addWidget(self.alert_check_box)
|
||||
self.projectors_check_box = QtWidgets.QCheckBox(self.plugin_page)
|
||||
# If visibility setting for projector panel is True, check the box.
|
||||
if Settings().value('projector/show after wizard'):
|
||||
self.projectors_check_box.setChecked(True)
|
||||
self.projectors_check_box.setObjectName('projectors_check_box')
|
||||
self.projectors_check_box.clicked.connect(self.on_projectors_check_box_clicked)
|
||||
self.plugin_layout.addWidget(self.projectors_check_box)
|
||||
first_time_wizard.setPage(FirstTimePage.Plugins, self.plugin_page)
|
||||
# The song samples page
|
||||
self.songs_page = QtWidgets.QWizardPage()
|
||||
@ -243,6 +250,9 @@ class UiFirstTimeWizard(object):
|
||||
self.remote_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Allow remote access'))
|
||||
self.song_usage_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Monitor Song Usage'))
|
||||
self.alert_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Allow Alerts'))
|
||||
self.projectors_check_box.setText(translate('OpenLP.FirstTimeWizard',
|
||||
'Projectors - This allows OpenLP to control projectors in your'
|
||||
' network that are compatible with PJLink.'))
|
||||
self.no_internet_page.setTitle(translate('OpenLP.FirstTimeWizard', 'No Internet Connection'))
|
||||
self.no_internet_page.setSubTitle(
|
||||
translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.'))
|
||||
@ -277,3 +287,10 @@ class UiFirstTimeWizard(object):
|
||||
clean_button_text(first_time_wizard.buttonText(QtWidgets.QWizard.FinishButton)))
|
||||
first_time_wizard.setButtonText(QtWidgets.QWizard.CustomButton2,
|
||||
clean_button_text(first_time_wizard.buttonText(QtWidgets.QWizard.CancelButton)))
|
||||
|
||||
def on_projectors_check_box_clicked(self):
|
||||
# When clicking projectors_check box, change the visibility setting for Projectors panel.
|
||||
if Settings().value('projector/show after wizard'):
|
||||
Settings().setValue('projector/show after wizard', False)
|
||||
else:
|
||||
Settings().setValue('projector/show after wizard', True)
|
||||
|
@ -698,9 +698,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
|
||||
return
|
||||
self.application.set_busy_cursor()
|
||||
self.first_time()
|
||||
# if settings.value('%s/screen blank' % self.general_settings_section):
|
||||
#if Settings().value('advanced/enable exit confirmation'):
|
||||
if Settings().value('user interface/projectors hidden in wizard'):
|
||||
# Check if Projectors panel should be visible or not after wizard.
|
||||
if Settings().value('projector/show after wizard'):
|
||||
self.projector_manager_dock.setVisible(True)
|
||||
else:
|
||||
self.projector_manager_dock.setVisible(False)
|
||||
for plugin in self.plugin_manager.plugins:
|
||||
self.active_plugin = plugin
|
||||
@ -1034,6 +1035,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
|
||||
"""
|
||||
self.set_view_mode(True, True, True, True, True, True, 'default')
|
||||
Settings().setValue('user interface/layout preset enabled', True)
|
||||
Settings().setValue('projector/show after wizard', True)
|
||||
|
||||
def on_mode_setup_item_clicked(self):
|
||||
"""
|
||||
@ -1041,6 +1043,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
|
||||
"""
|
||||
self.set_view_mode(True, True, False, True, False, True, 'setup')
|
||||
Settings().setValue('user interface/layout preset enabled', True)
|
||||
Settings().setValue('projector/show after wizard', True)
|
||||
|
||||
def on_mode_live_item_clicked(self):
|
||||
"""
|
||||
@ -1048,6 +1051,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
|
||||
"""
|
||||
self.set_view_mode(False, True, False, False, True, True, 'live')
|
||||
Settings().setValue('user interface/layout preset enabled', True)
|
||||
Settings().setValue('projector/show after wizard', True)
|
||||
|
||||
def set_view_mode(self, media=True, service=True, theme=True, preview=True, live=True, projector=True, mode=''):
|
||||
"""
|
||||
@ -1193,6 +1197,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties):
|
||||
"""
|
||||
self.projector_manager_dock.setVisible(not self.projector_manager_dock.isVisible())
|
||||
Settings().setValue('user interface/layout preset enabled', False)
|
||||
# Check/uncheck checkbox on First time wizard based on visibility of this panel.
|
||||
if not Settings().value('projector/show after wizard'):
|
||||
Settings().setValue('projector/show after wizard', True)
|
||||
else:
|
||||
Settings().setValue('projector/show after wizard', False)
|
||||
|
||||
def toggle_service_manager(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user