diff --git a/copy-runtime-files.py b/copy-runtime-files.py index 143e2eb1..03430a95 100644 --- a/copy-runtime-files.py +++ b/copy-runtime-files.py @@ -95,6 +95,8 @@ def setup_parameters(parsed_args): else: globalVar.qt_version = execute_cmd('qmake -v', True) if globalVar.qt_version == -1: + print(bcolors.WARNING + "No qmake found, trying qmake-qt5..." + bcolors.ENDC) + globalVar.qt_version = execute_cmd('qmake-qt5 -v', True) if globalVar.qt_version == -1: print(bcolors.FAIL + "No qmake found!" + bcolors.ENDC) @@ -177,6 +179,28 @@ def copy_ringtones(): shutil.copy(ringtone_path + os.sep + file, copy_to_path) +def compile_and_copy_web_resources(): + # web resources + rcc = 'rcc' + + if globalVar.qt_path: + rcc = globalVar.qt_path + os.sep + 'bin' + os.sep + \ + 'rcc' + ('.exe' if globalVar.system_name == "Windows" else '') + + if execute_cmd(rcc + ' -v', True) == -1: + print(bcolors.WARNING + "No rcc found, trying rcc-qt5..." + bcolors.ENDC) + + rcc = rcc.replace('rcc', 'rcc-qt5') + if execute_cmd(rcc + ' -v', True) == -1: + print(bcolors.FAIL + "No rcc found!" + bcolors.ENDC) + sys.exit() + + lrc_web_resources_path = globalVar.lrc_path + os.sep + 'webresource.qrc' + + execute_cmd(rcc + ' -binary ' + lrc_web_resources_path + + ' -o ' + globalVar.output_path + os.sep + 'webresource.rcc') + + def release_and_copy_translations(): # translations binary lrelease = 'lrelease' @@ -186,6 +210,8 @@ def release_and_copy_translations(): 'lrelease' + ('.exe' if globalVar.system_name == "Windows" else '') if execute_cmd(lrelease + ' -version', True) == -1: + print(bcolors.WARNING + "No lrelease found, trying lrelease-qt5..." + bcolors.ENDC) + lrelease = lrelease.replace('lrelease', 'lrelease-qt5') if execute_cmd(lrelease + ' -version', True) == -1: print(bcolors.FAIL + "No lrelease found!" + bcolors.ENDC) @@ -305,6 +331,9 @@ def main(): # translations release_and_copy_translations() + # web resources + compile_and_copy_web_resources() + # write stamp write_stamp() diff --git a/resources.qrc b/resources.qrc index 5e7aab59..44424faa 100644 --- a/resources.qrc +++ b/resources.qrc @@ -74,14 +74,6 @@ images/icons/round-remove_circle-24px.svg images/icons/round-settings-24px.svg images/icons/round-undo-24px.svg - ../lrc/src/web-chatview/chatview.css - ../lrc/src/web-chatview/chatview.html - ../lrc/src/web-chatview/chatview.js - ../lrc/src/web-chatview/linkify.js - ../lrc/src/web-chatview/linkify-html.js - ../lrc/src/web-chatview/linkify-string.js - ../lrc/src/web-chatview/qwebchannel.js - ../lrc/src/web-chatview/chatview-windows.css images/icons/round-check_circle-24px.svg images/icons/round-error-24px.svg images/icons/round-save_alt-24px.svg diff --git a/src/mainapplication.cpp b/src/mainapplication.cpp index 744913ea..4ea416e7 100644 --- a/src/mainapplication.cpp +++ b/src/mainapplication.cpp @@ -1,4 +1,4 @@ -/*! +/*! * Copyright (C) 2015-2020 by Savoir-faire Linux * Author: Edric Ladent Milaret * Author: Andreas Traczyk @@ -133,6 +133,10 @@ MainApplication::init() { setWindowIcon(QIcon(":images/jami.ico")); + // Lrc web resources + QResource::registerResource(QCoreApplication::applicationDirPath() + QDir::separator() + + "webresource.rcc"); + #ifdef Q_OS_LINUX if (!getenv("QT_QPA_PLATFORMTHEME")) setenv("QT_QPA_PLATFORMTHEME", "gtk3", true);