# HG changeset patch # User Andre Heinecke # Date 1397724916 0 # Node ID 81cf25402cb0797eb6bb00697e5e5c5746b2178e # Parent 3d1e9df2480368c9079bbb4cc43fab17e79f10ec# Parent 8f95e7014667b13c7ec708086e165b84555e366d Merge diff -r 8f95e7014667 -r 81cf25402cb0 ui/CMakeLists.txt --- a/ui/CMakeLists.txt Thu Apr 17 10:11:40 2014 +0200 +++ b/ui/CMakeLists.txt Thu Apr 17 08:55:16 2014 +0000 @@ -100,23 +100,37 @@ # TRUSTBRIDGE_SOURCES in the test subdirectory. set(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_SOURCES}) qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES}) -add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}) - -target_link_libraries(trustbridge Qt5::Widgets - trustbridge_common - ${POLARSSL_LIBRARIES} - ${EXTRA_STATIC_LIBS} - ${PROFILING_LIBS}) set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES}) qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES}) if(Qt5LinguistTools_FOUND) + # Include translation as a resource + # This works in the source directory to enable the rcc dependencies to be found + # and it also updates the currently available localization. + # This would probably be better placed in a macro + configure_file(l10n/administrator.qrc.in administrator.qrc) + qt5_add_resources(ADMINISTRATOR_L10N ${CMAKE_CURRENT_BINARY_DIR}/administrator.qrc) qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES_WITH_RESOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator.ts) - add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES} ${ADMINISTRATOR_TRANSLATION}) + ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator_de_DE.ts) + add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES} + ${ADMINISTRATOR_L10N} + ${ADMINISTRATOR_TRANSLATION} + ) + + configure_file(l10n/trustbridge.qrc.in trustbridge.qrc) + qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc) + qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES} + ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts) + add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES} + ${TRUSTBRIDGE_L10N} + ${TRUSTBRIDGE_TRANSLATION} + ) + else() message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.") + add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}) + add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}) endif() target_link_libraries(administrator Qt5::Widgets @@ -125,6 +139,13 @@ ${EXTRA_STATIC_LIBS} ${PROFILING_LIBS}) +target_link_libraries(trustbridge Qt5::Widgets + trustbridge_common + ${POLARSSL_LIBRARIES} + ${EXTRA_STATIC_LIBS} + ${PROFILING_LIBS}) + + # Tests add_subdirectory(tests) diff -r 8f95e7014667 -r 81cf25402cb0 ui/administrator.cpp --- a/ui/administrator.cpp Thu Apr 17 10:11:40 2014 +0200 +++ b/ui/administrator.cpp Thu Apr 17 08:55:16 2014 +0000 @@ -11,6 +11,8 @@ #include #include #include +#include +#include #ifndef VERSION #define VERSION "0.0.1" @@ -41,6 +43,17 @@ QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); QSettings::setDefaultFormat(QSettings::IniFormat); + QTranslator translator; + if (QLocale::system().name() == "C") { + /* Useful for testing / development as the primary target is german */ + translator.load(":/l10n/administrator_de_DE"); + } else { + translator.load(":/l10n/administrator_" + QLocale::system().name()); + qDebug() << "Loading translations for: " << "administrator_" + + QLocale::system().name(); + } + app.installTranslator(&translator); + AdministratorWindow adminWin; adminWin.show(); diff -r 8f95e7014667 -r 81cf25402cb0 ui/l10n/administrator.qrc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/l10n/administrator.qrc.in Thu Apr 17 08:55:16 2014 +0000 @@ -0,0 +1,5 @@ + + + @CMAKE_CURRENT_BINARY_DIR@/administrator_de_DE.qm + + diff -r 8f95e7014667 -r 81cf25402cb0 ui/l10n/administrator.ts --- a/ui/l10n/administrator.ts Thu Apr 17 10:11:40 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ - - - - - AdministratorWindow - - - Menu - Menü - - - - Create Installer - Installationspaket erstellen - - - - Settings - Einstellungen - - - - Help - Hilfe - - - - About - - - - - Quit - - - - - Managed Certificates - - - - - Administrator Application - - - - - Save - - - - - Load - - - - - Add - - - - - Remove - - - - - Select certificate file - - - - - Select certificate - - - - - CertificateTabelModel - - - Subject CN - - - - - Subject O - - - - - Issuer CN - - - - - Issuer O - - - - - valid from - - - - - valid to - - - - - SHA1 Fingerprint - - - - - CertificateTableDelegate - - - add - - - - - remove - - - - - CreateCertListDialog - - - adminstrator - Create signed certificate list - - - - - Create a new, signed certificate list. - - - - - - Create List - - - - - Select certificate - - - - - Select target location - - - - - CreateInstallerDialog - - - adminstrator - Create signed installer binary - - - - - Create a new signed installer binary. - - - - - - Create Installer - Installationspaket erstellen - - - - Select certificate - - - - - Select source archive - - - - - Select target location - - - - - QObject - - - Certificate: - <bold>%1</bold> - %2, %3 - -Serial number: -%4 -Valid from: <bold>%5</bold> to <bold>%6</bold> - -Issued by: .. - - - - - Failed to parse certificate - - - - diff -r 8f95e7014667 -r 81cf25402cb0 ui/l10n/administrator_de_DE.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/l10n/administrator_de_DE.ts Thu Apr 17 08:55:16 2014 +0000 @@ -0,0 +1,212 @@ + + + + + AdministratorWindow + + + Menu + Menü + + + + Create Installer + Installationspaket erstellen + + + + Settings + Einstellungen + + + + Help + Hilfe + + + + About + + + + + Quit + + + + + Managed Certificates + + + + + Administrator Application + + + + + Save + + + + + Load + + + + + Add + + + + + Remove + + + + + Select certificate file + + + + + Select certificate + + + + + CertificateTabelModel + + + Subject CN + + + + + Subject O + + + + + Issuer CN + + + + + Issuer O + + + + + valid from + + + + + valid to + + + + + SHA1 Fingerprint + + + + + CertificateTableDelegate + + + add + + + + + remove + + + + + CreateCertListDialog + + + adminstrator - Create signed certificate list + + + + + Create a new, signed certificate list. + + + + + + Create List + + + + + Select certificate + + + + + Select target location + + + + + CreateInstallerDialog + + + adminstrator - Create signed installer binary + + + + + Create a new signed installer binary. + + + + + + Create Installer + Installationspaket erstellen + + + + Select certificate + + + + + Select source archive + + + + + Select target location + + + + + QObject + + + Certificate: + <bold>%1</bold> + %2, %3 + +Serial number: +%4 +Valid from: <bold>%5</bold> to <bold>%6</bold> + +Issued by: .. + + + + + Failed to parse certificate + + + + diff -r 8f95e7014667 -r 81cf25402cb0 ui/l10n/trustbridge.qrc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/l10n/trustbridge.qrc.in Thu Apr 17 08:55:16 2014 +0000 @@ -0,0 +1,5 @@ + + + @CMAKE_CURRENT_BINARY_DIR@/trustbridge_de_DE.qm + + diff -r 8f95e7014667 -r 81cf25402cb0 ui/l10n/trustbridge_de_DE.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/l10n/trustbridge_de_DE.ts Thu Apr 17 08:55:16 2014 +0000 @@ -0,0 +1,288 @@ + + + + + AboutDialog + + + This dialog contains some text about the application + + + + + Close + + + + + Downloader + + + Invalid response + + + + + + + + Connection lost + + + + + Invalid response from the server + + + + + Failed to initialize SSL Module. + + + + + Failed to connect. + + + + + Connected + + + + + Closing + + + + + HelpDialog + + + This dialog contains some text to help the user. + + + + + Close + + + + + InstallWrapper + + + Could not find certificate installation process. + + + + + Failed to write temporary file. + + + + + Error executing process: %1 + + + + + Error monitoring process: %1 + + + + + Certificate installation timed out. + + + + + Failed to check process status: %1 + + + + + The process failed with return code. %1 + + + + + Failed to start installer process. + + + + + + Failed to complete installation. + + + + + MainWindow + + + An updated certificate list is available. Click here to install. + + + + + An update for %1 is available. Click here to install. + + + + + Check for Updates + + + + + + + Quit + + + + + TrustBridge + + + + + Menu + Menü + + + + Force Update + + + + + Settings + + + + + Statusdialog + + + + + Help + + + + + About + + + + + Managed Certificates + + + + + autoupdate + + + + + Install selected + + + + + Details + + + + + Error executing update + + + + + Installing certificates... + + + + + QObject + + + Certificate: + <bold>%1</bold> + %2, %3 + +Serial number: +%4 +Valid from: <bold>%5</bold> to <bold>%6</bold> + +Issued by: .. + + + + + Failed to parse certificate + + + + + Couldn't detect any system tray on this system. This software can only be used in a desktop environment. + + + + + StatusDialog + + + The following certificates are successfully installed: + + + + + + * Email CA 2013 + + + + + + * Server CA 2010 + + + + + + +The following certificates are successfully removed: + + + + + + * Email CA 2010 + + + + + + +Errors while processing certificates: + + + + + + * PCA-1-Verwaltung-08 + + + + + + Close + + + + diff -r 8f95e7014667 -r 81cf25402cb0 ui/main.cpp --- a/ui/main.cpp Thu Apr 17 10:11:40 2014 +0200 +++ b/ui/main.cpp Thu Apr 17 08:55:16 2014 +0000 @@ -12,6 +12,8 @@ #include #include #include +#include +#include #ifndef VERSION #define VERSION "0.0.1" @@ -38,6 +40,17 @@ QStringList arguments = QApplication::arguments(); bool trayMode = arguments.contains("--tray"); + QTranslator translator; + if (QLocale::system().name() == "C") { + /* Useful for testing / development as the primary target is german */ + translator.load(":/l10n/trustbridge_de_DE"); + } else { + translator.load(":/l10n/trustbridge_" + QLocale::system().name()); + qDebug() << "Loading translations for: " << "trustbridge_" + + QLocale::system().name(); + } + app.installTranslator(&translator); + if (!QSystemTrayIcon::isSystemTrayAvailable() || !QSystemTrayIcon::supportsMessages()) { QMessageBox::critical(0, QString::fromLatin1(APPNAME),