FTW working and UI Strings

This commit is contained in:
Tim Bentley 2017-03-05 10:02:22 +00:00
parent 06baf5c560
commit ef6252bf4b
5 changed files with 15 additions and 19 deletions

View File

@ -22,7 +22,7 @@
from PyQt5 import QtCore, QtGui, QtNetwork, QtWidgets
from openlp.core.common import Settings, translate
from openlp.core.common import UiStrings, Settings, translate
from openlp.core.lib import SettingsTab
ZERO_URL = '0.0.0.0'
@ -188,7 +188,7 @@ class ApiTab(SettingsTab):
'Scan the QR code or click <a href="{qr}">download</a> 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(translate('RemotePlugin.RemoteTab', 'Download latest web site'))
self.update_site_group_box.setTitle(str(UiStrings().WebDownloadText))
self.user_id_label.setText(translate('RemotePlugin.RemoteTab', 'User id:'))
self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:'))

View File

@ -167,6 +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'),
book_chapter = translate('OpenLP.Ui', 'Book Chapter')
chapter = translate('OpenLP.Ui', 'Chapter')
verse = translate('OpenLP.Ui', 'Verse')

View File

@ -34,6 +34,7 @@ from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError
from PyQt5 import QtCore, QtWidgets
from openlp.core.api.deploy import download_and_check
from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, check_directory_exists, \
translate, clean_button_text, trace_error_handler
from openlp.core.lib import PluginStatus, build_icon
@ -555,7 +556,6 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties):
songs_destination = os.path.join(gettempdir(), 'openlp')
bibles_destination = AppLocation.get_section_data_path('bibles')
themes_destination = AppLocation.get_section_data_path('themes')
remote_destination = AppLocation.get_section_data_path('remotes')
missed_files = []
# Download songs
for i in range(self.songs_list_widget.count()):
@ -596,11 +596,10 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties):
sha256):
missed_files.append('Theme: {name}'.format(name=theme))
if self.remote_check_box.isChecked():
self._increment_progress_bar(self.downloading.format(name='AA'), 0)
self._increment_progress_bar(self.downloading.format(
name=translate('OpenLP.FirstTimeWizard', 'Downloading Web Application')), 0)
self.previous_size = 0
url_get_file(self, 'https://get.openlp.org/webclient', 'download.cfg',
os.path.join(remote_destination, theme),
sha256)
download_and_check(self)
if missed_files:
file_list = ''
for entry in missed_files:

View File

@ -24,6 +24,7 @@ The UI widgets for the first time wizard.
"""
from PyQt5 import QtCore, QtGui, QtWidgets
from openlp.core.common.uistrings import UiStrings
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
@ -254,7 +255,7 @@ class UiFirstTimeWizard(object):
self.presentation_check_box.setText(translate('OpenLP.FirstTimeWizard',
'Presentations Show .ppt, .odp and .pdf files'))
self.media_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Media Playback of Audio and Video files'))
self.remote_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Remote Download latest Web Pages'))
self.remote_check_box.setText(str(UiStrings().WebDownloadText))
self.song_usage_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Song Usage Monitor'))
self.alert_check_box.setText(translate('OpenLP.FirstTimeWizard',
'Alerts Display informative messages while showing other slides'))

View File

@ -34,7 +34,7 @@ log = logging.getLogger(__name__)
class RemotesPlugin(Plugin, OpenLPMixin):
log.info('Remote Plugin loaded')
log.info('Remotes Plugin loaded')
def __init__(self):
"""
@ -47,7 +47,12 @@ class RemotesPlugin(Plugin, OpenLPMixin):
self.live_cache = None
self.stage_cache = None
register_endpoint(remote_endpoint)
print("AAAAAA")
Registry().register_function('download_website', self.manage_download)
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'assets'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'images'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'static'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'templates'))
@staticmethod
def about():
@ -60,16 +65,6 @@ class RemotesPlugin(Plugin, OpenLPMixin):
'download as well as custom developed interfaces')
return about_text
def initialise(self):
"""
Create the internal file structure if it does not exist
:return:
"""
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'assets'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'images'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'static'))
check_directory_exists(os.path.join(AppLocation.get_section_data_path('remotes'), 'templates'))
def set_plugin_text_strings(self):
"""
Called to define all translatable texts of the plugin