diff --git a/openlp/core/api/http/endpoint/controller.py b/openlp/core/api/http/endpoint/controller.py index e095696d0..47503712d 100644 --- a/openlp/core/api/http/endpoint/controller.py +++ b/openlp/core/api/http/endpoint/controller.py @@ -113,5 +113,22 @@ def controller_set(request): log.error("Endpoint controller/live/set request id not found") return {'results': {'success': True}} + +@api_controller_endpoint.route('/controller/{controller}/{action:next|previous}') +@controller_endpoint.route('/{controller}/{action:next|previous}') +@requires_auth +def controller_direction(request, controller, action): + """ + Handles requests for setting service items in the slide controller +11 + :param request: The http request object. + :param controller: the controller slides forward or backward. + :param action: the controller slides forward or backward. + """ + event = getattr(Registry().get('live_controller'), 'slidecontroller_{controller}_{action}'. + format(controller=controller, action=action)) + event.emit() + return {'results': {'success': True}} + register_endpoint(controller_endpoint) register_endpoint(api_controller_endpoint) diff --git a/openlp/core/api/http/endpoint/core.py b/openlp/core/api/http/endpoint/core.py index 8ac1d7e31..9f38059a6 100644 --- a/openlp/core/api/http/endpoint/core.py +++ b/openlp/core/api/http/endpoint/core.py @@ -54,9 +54,9 @@ stage = translate('RemotePlugin.Mobile', 'Stage View') live = translate('RemotePlugin.Mobile', 'Live View') TRANSLATED_STRINGS = { - 'app_title': "{main} {remote}".format(main=UiStrings().OLPV2x, remote=remote), - 'stage_title': "{main} {stage}".format(main=UiStrings().OLPV2x, stage=stage), - 'live_title': "{main} {live}".format(main=UiStrings().OLPV2x, live=live), + 'app_title': "{main} {remote}".format(main=UiStrings().OLP, remote=remote), + 'stage_title': "{main} {stage}".format(main=UiStrings().OLP, stage=stage), + 'live_title': "{main} {live}".format(main=UiStrings().OLP, live=live), 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), @@ -116,6 +116,7 @@ def poll(request): return Registry().get('poller').raw_poll() +@blank_endpoint.route('api/display/{display:hide|show|blank|theme|desktop}') @blank_endpoint.route('display/{display:hide|show|blank|theme|desktop}') @requires_auth def toggle_display(request, display): @@ -128,13 +129,12 @@ def toggle_display(request, display): return {'results': {'success': True}} -@blank_endpoint.route('api/plugin/{search:search}') -@blank_endpoint.route('plugin/{search:search}') -def plugin_search(request, search): +@blank_endpoint.route('api/plugin/search') +@blank_endpoint.route('plugin/search') +def plugin_search_list(request): """ - Deliver the functions for the /display url + Deliver a list of active plugins that support search :param request: the http request - not used - :param search: the display function to be triggered """ searches = [] for plugin in Registry().get('plugin_manager').plugins: diff --git a/openlp/core/api/http/endpoint/service.py b/openlp/core/api/http/endpoint/service.py index 335d81d21..a3f968c65 100644 --- a/openlp/core/api/http/endpoint/service.py +++ b/openlp/core/api/http/endpoint/service.py @@ -63,6 +63,21 @@ def service_set(request): return {'results': {'success': True}} +@api_service_endpoint.route('{action:next|previous}') +@service_endpoint.route('{action:next|previous}') +@requires_auth +def service_direction(request, action): + """ + Handles requests for setting service items in the service manager + + :param request: The http request object. + :param action: the the service slides forward or backward. + """ + event = getattr(Registry().get('service_manager'), 'servicemanager_{action}_item'.format(action=action)) + event.emit(None) + return {'results': {'success': True}} + + def get_service_items(): """ Read the service item in use and return the data as a json object diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 91db10fcf..ecaacba6a 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -111,8 +111,6 @@ class UiStrings(object): self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural') self.OLP = translate('OpenLP.Ui', 'OpenLP') - self.OLPV2 = "{name} {version}".format(name=self.OLP, version="2") - self.OLPV2x = "{name} {version}".format(name=self.OLP, version="2.4") self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?') self.OpenService = translate('OpenLP.Ui', 'Open service.') self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop') diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 9c58696a2..83e23ceeb 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -387,7 +387,7 @@ class Ui_MainWindow(object): """ Set up the translation system """ - main_window.setWindowTitle(UiStrings().OLPV2x) + main_window.setWindowTitle(UiStrings().OLP) self.file_menu.setTitle(translate('OpenLP.MainWindow', '&File')) self.file_import_menu.setTitle(translate('OpenLP.MainWindow', '&Import')) self.file_export_menu.setTitle(translate('OpenLP.MainWindow', '&Export')) @@ -1170,9 +1170,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): :param file_name: The file name of the service file. """ if modified: - title = '{title} - {name}*'.format(title=UiStrings().OLPV2x, name=file_name) + title = '{title} - {name}*'.format(title=UiStrings().OLP, name=file_name) else: - title = '{title} - {name}'.format(title=UiStrings().OLPV2x, name=file_name) + title = '{title} - {name}'.format(title=UiStrings().OLP, name=file_name) self.setWindowTitle(title) def show_status_message(self, message): diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 5240b7fa8..02e5c7908 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -105,7 +105,7 @@ class AlertsTab(SettingsTab): self.timeout_label.setText(translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) self.timeout_spin_box.setSuffix(UiStrings().Seconds) self.preview_group_box.setTitle(UiStrings().Preview) - self.font_preview.setText(UiStrings().OLPV2x) + self.font_preview.setText(UiStrings().OLP) def on_background_color_changed(self, color): """ diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 8f7654161..7190d2c04 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -203,7 +203,7 @@ class SongFormat(object): }, OpenLP2: { 'class': OpenLPSongImport, - 'name': UiStrings().OLPV2, + 'name': UiStrings().OLP, 'prefix': 'openLP2', 'selectMode': SongFormatSelect.SingleFile, 'filter': '{text} (*.sqlite)'.format(text=translate('SongsPlugin.ImportWizardForm', 'OpenLP 2 Databases')) diff --git a/tests/functional/openlp_core_ui/test_mainwindow.py b/tests/functional/openlp_core_ui/test_mainwindow.py index 93baa8da7..edfcd6aeb 100644 --- a/tests/functional/openlp_core_ui/test_mainwindow.py +++ b/tests/functional/openlp_core_ui/test_mainwindow.py @@ -110,9 +110,9 @@ class TestMainWindow(TestCase, TestMixin): # WHEN no changes are made to the service - # THEN the main window's title shoud be the same as the OLPV2x string in the UiStrings class - self.assertEqual(self.main_window.windowTitle(), UiStrings().OLPV2x, - 'The main window\'s title should be the same as the OLPV2x string in UiStrings class') + # THEN the main window's title shoud be the same as the OLP string in the UiStrings class + self.assertEqual(self.main_window.windowTitle(), UiStrings().OLP, + 'The main window\'s title should be the same as the OLP string in UiStrings class') def set_service_modifed_test(self): """ @@ -124,8 +124,8 @@ class TestMainWindow(TestCase, TestMixin): self.main_window.set_service_modified(True, 'test.osz') # THEN the main window's title should be set to the - self.assertEqual(self.main_window.windowTitle(), '%s - %s*' % (UiStrings().OLPV2x, 'test.osz'), - 'The main window\'s title should be set to " - test.osz*"') + self.assertEqual(self.main_window.windowTitle(), '%s - %s*' % (UiStrings().OLP, 'test.osz'), + 'The main window\'s title should be set to " - test.osz*"') def set_service_unmodified_test(self): """ @@ -137,8 +137,8 @@ class TestMainWindow(TestCase, TestMixin): self.main_window.set_service_modified(False, 'test.osz') # THEN the main window's title should be set to the - self.assertEqual(self.main_window.windowTitle(), '%s - %s' % (UiStrings().OLPV2x, 'test.osz'), - 'The main window\'s title should be set to " - test.osz"') + self.assertEqual(self.main_window.windowTitle(), '%s - %s' % (UiStrings().OLP, 'test.osz'), + 'The main window\'s title should be set to " - test.osz"') def mainwindow_configuration_test(self): """