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 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 from openlp.core.lib import SettingsTab
ZERO_URL = '0.0.0.0' 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 ' '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')) 'Store.').format(qr='https://itunes.apple.com/app/id1096218725'))
self.user_login_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'User Authentication')) 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.user_id_label.setText(translate('RemotePlugin.RemoteTab', 'User id:'))
self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:')) self.password_label.setText(translate('RemotePlugin.RemoteTab', 'Password:'))

View File

@ -167,6 +167,7 @@ class UiStrings(object):
self.View = translate('OpenLP.Ui', 'View') self.View = translate('OpenLP.Ui', 'View')
self.ViewMode = translate('OpenLP.Ui', 'View Mode') self.ViewMode = translate('OpenLP.Ui', 'View Mode')
self.Video = translate('OpenLP.Ui', 'Video') 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') book_chapter = translate('OpenLP.Ui', 'Book Chapter')
chapter = translate('OpenLP.Ui', 'Chapter') chapter = translate('OpenLP.Ui', 'Chapter')
verse = translate('OpenLP.Ui', 'Verse') verse = translate('OpenLP.Ui', 'Verse')

View File

@ -34,6 +34,7 @@ from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError
from PyQt5 import QtCore, QtWidgets 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, \ from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, check_directory_exists, \
translate, clean_button_text, trace_error_handler translate, clean_button_text, trace_error_handler
from openlp.core.lib import PluginStatus, build_icon 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') songs_destination = os.path.join(gettempdir(), 'openlp')
bibles_destination = AppLocation.get_section_data_path('bibles') bibles_destination = AppLocation.get_section_data_path('bibles')
themes_destination = AppLocation.get_section_data_path('themes') themes_destination = AppLocation.get_section_data_path('themes')
remote_destination = AppLocation.get_section_data_path('remotes')
missed_files = [] missed_files = []
# Download songs # Download songs
for i in range(self.songs_list_widget.count()): for i in range(self.songs_list_widget.count()):
@ -596,11 +596,10 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties):
sha256): sha256):
missed_files.append('Theme: {name}'.format(name=theme)) missed_files.append('Theme: {name}'.format(name=theme))
if self.remote_check_box.isChecked(): 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 self.previous_size = 0
url_get_file(self, 'https://get.openlp.org/webclient', 'download.cfg', download_and_check(self)
os.path.join(remote_destination, theme),
sha256)
if missed_files: if missed_files:
file_list = '' file_list = ''
for entry in missed_files: 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 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.common import translate, is_macosx, clean_button_text, Settings
from openlp.core.lib import build_icon from openlp.core.lib import build_icon
from openlp.core.lib.ui import add_welcome_page from openlp.core.lib.ui import add_welcome_page
@ -254,7 +255,7 @@ class UiFirstTimeWizard(object):
self.presentation_check_box.setText(translate('OpenLP.FirstTimeWizard', self.presentation_check_box.setText(translate('OpenLP.FirstTimeWizard',
'Presentations Show .ppt, .odp and .pdf files')) 'Presentations Show .ppt, .odp and .pdf files'))
self.media_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Media Playback of Audio and Video 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.song_usage_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Song Usage Monitor'))
self.alert_check_box.setText(translate('OpenLP.FirstTimeWizard', self.alert_check_box.setText(translate('OpenLP.FirstTimeWizard',
'Alerts Display informative messages while showing other slides')) 'Alerts Display informative messages while showing other slides'))

View File

@ -34,7 +34,7 @@ log = logging.getLogger(__name__)
class RemotesPlugin(Plugin, OpenLPMixin): class RemotesPlugin(Plugin, OpenLPMixin):
log.info('Remote Plugin loaded') log.info('Remotes Plugin loaded')
def __init__(self): def __init__(self):
""" """
@ -47,7 +47,12 @@ class RemotesPlugin(Plugin, OpenLPMixin):
self.live_cache = None self.live_cache = None
self.stage_cache = None self.stage_cache = None
register_endpoint(remote_endpoint) register_endpoint(remote_endpoint)
print("AAAAAA")
Registry().register_function('download_website', self.manage_download) 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 @staticmethod
def about(): def about():
@ -60,16 +65,6 @@ class RemotesPlugin(Plugin, OpenLPMixin):
'download as well as custom developed interfaces') 'download as well as custom developed interfaces')
return about_text 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): def set_plugin_text_strings(self):
""" """
Called to define all translatable texts of the plugin Called to define all translatable texts of the plugin