From fbcef30044c565f39d486c8edac38b0d20831827 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 9 Jun 2017 16:55:39 +0100 Subject: [PATCH] settings tab --- openlp/core/api/tab.py | 19 ++++++++++++++++++- openlp/core/common/uistrings.py | 2 +- openlp/plugins/remotes/remoteplugin.py | 5 ++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/openlp/core/api/tab.py b/openlp/core/api/tab.py index 74b1d59f1..e37a283b9 100644 --- a/openlp/core/api/tab.py +++ b/openlp/core/api/tab.py @@ -93,6 +93,7 @@ class ApiTab(SettingsTab): self.user_login_group_box.setCheckable(True) self.user_login_group_box.setChecked(False) self.user_login_group_box.setObjectName('user_login_group_box') + self.user_login_layout = QtWidgets.QFormLayout(self.user_login_group_box) self.user_login_layout.setObjectName('user_login_layout') self.user_id_label = QtWidgets.QLabel(self.user_login_group_box) @@ -110,6 +111,18 @@ class ApiTab(SettingsTab): self.update_site_group_box.setCheckable(True) self.update_site_group_box.setChecked(False) self.update_site_group_box.setObjectName('update_site_group_box') + self.update_site_layout = QtWidgets.QFormLayout(self.update_site_group_box) + self.update_site_layout.setObjectName('update_site_layout') + self.current_version_label = QtWidgets.QLabel(self.update_site_group_box) + self.current_version_label.setObjectName('current_version_label') + self.current_version_value = QtWidgets.QLabel(self.update_site_group_box) + self.current_version_value.setObjectName('current_version_value') + self.update_site_layout.addRow(self.current_version_label, self.current_version_value) + self.master_version_label = QtWidgets.QLabel(self.update_site_group_box) + self.master_version_label.setObjectName('master_version_label') + self.master_version_value = QtWidgets.QLabel(self.update_site_group_box) + self.master_version_value.setObjectName('master_version_value') + self.update_site_layout.addRow(self.master_version_label, self.master_version_value) self.left_layout.addWidget(self.update_site_group_box) self.android_app_group_box = QtWidgets.QGroupBox(self.right_column) self.android_app_group_box.setObjectName('android_app_group_box') @@ -188,9 +201,12 @@ class ApiTab(SettingsTab): 'Scan the QR code or click download to install the iOS app from the App ' 'Store.').format(qr='https://itunes.apple.com/app/id1096218725')) self.user_login_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'User Authentication')) - self.update_site_group_box.setTitle(str(UiStrings().WebDownloadText)) + self.aa = UiStrings() + self.update_site_group_box.setTitle(UiStrings().WebDownloadText) self.user_id_label.setText(translate('RemotePlugin.RemoteTab', 'User id:')) self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:')) + self.current_version_label.setText(translate('RemotePlugin.RemoteTab', 'Current Version number:')) + self.master_version_label.setText(translate('RemotePlugin.RemoteTab', 'Latest Version number:')) def set_urls(self): """ @@ -238,6 +254,7 @@ class ApiTab(SettingsTab): self.user_login_group_box.setChecked(Settings().value(self.settings_section + '/authentication enabled')) self.user_id.setText(Settings().value(self.settings_section + '/user id')) self.password.setText(Settings().value(self.settings_section + '/password')) + self.current_version_value.setText(Settings().value('remotes/download version')) self.set_urls() def save(self): diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index c3157592c..a2481ab84 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -167,7 +167,7 @@ class UiStrings(object): self.View = translate('OpenLP.Ui', 'View') self.ViewMode = translate('OpenLP.Ui', 'View Mode') self.Video = translate('OpenLP.Ui', 'Video') - self.WebDownloadText = translate('OpenLP.Ui', 'Web Interface – Download and Install latest Version'), + self.WebDownloadText = translate('OpenLP.Ui', 'Web Interface, Download and Install latest Version') book_chapter = translate('OpenLP.Ui', 'Book Chapter') chapter = translate('OpenLP.Ui', 'Chapter') verse = translate('OpenLP.Ui', 'Verse') diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index d3fe253c7..e5b19c94e 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -30,6 +30,9 @@ from openlp.plugins.remotes.endpoint import remote_endpoint from openlp.plugins.remotes.deploy import download_and_check log = logging.getLogger(__name__) +__default_settings__ = { + 'remotes/download version': '0000_00_00' +} class RemotesPlugin(Plugin, OpenLPMixin): @@ -39,7 +42,7 @@ class RemotesPlugin(Plugin, OpenLPMixin): """ remotes constructor """ - super(RemotesPlugin, self).__init__('remotes', {}) + super(RemotesPlugin, self).__init__('remotes', __default_settings__, {}) self.icon_path = ':/plugins/plugin_remote.png' self.icon = build_icon(self.icon_path) self.weight = -1