Skip to content

Commit 4f9eac2

Browse files
metsmamrts
authored andcommitted
New language menu
WE2-740 Signed-off-by: Raul Metsma <[email protected]>
1 parent 69672ab commit 4f9eac2

23 files changed

+219
-118
lines changed

.github/workflows/cmake-macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
BUILD_DIR: build
88
BUILD_NUMBER: ${{github.run_number}}
99
OPENSSL_ROOT_DIR: /usr/local/opt/[email protected]
10+
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
1011
QT_DIR: /usr/local/opt/qt6/lib/cmake/Qt6
1112
QT_QPA_PLATFORM: offscreen
1213
MAKEFLAGS: -j3

src/controller/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ add_library(controller STATIC
2020
controller.hpp
2121
inputoutputmode.cpp
2222
inputoutputmode.hpp
23-
logging.hpp
2423
logging.cpp
25-
observer_ptr.hpp
24+
logging.hpp
2625
qeid.hpp
2726
retriableerror.cpp
2827
retriableerror.hpp
@@ -33,7 +32,9 @@ add_library(controller STATIC
3332
threads/controllerchildthread.hpp
3433
threads/waitforcardthread.hpp
3534
ui.hpp
36-
utils.hpp
35+
utils/observer_ptr.hpp
36+
utils/qdisablecopymove.hpp
37+
utils/utils.hpp
3738
writeresponse.cpp
3839
writeresponse.hpp
3940
)

src/controller/application.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Application::Application(int& argc, char** argv, const QString& name) : QApplica
5656
setQuitOnLastWindowClosed(false);
5757

5858
translator = new QTranslator(this);
59-
QApplication::installTranslator(translator);
59+
installTranslator(translator);
6060
loadTranslations();
6161

6262
for (const QString& font : QDir(QStringLiteral(":/fonts")).entryList()) {
@@ -75,7 +75,7 @@ Application::Application(int& argc, char** argv, const QString& name) : QApplica
7575
}
7676

7777
#ifndef Q_OS_MAC
78-
bool Application::isDarkTheme() const
78+
bool Application::isDarkTheme()
7979
{
8080
#ifdef Q_OS_WIN
8181
QSettings settings(
@@ -102,10 +102,10 @@ bool Application::isDarkTheme() const
102102

103103
void Application::loadTranslations(const QString& lang)
104104
{
105-
QLocale locale;
106105
static const QStringList SUPPORTED_LANGS {QStringLiteral("en"), QStringLiteral("et"),
107106
QStringLiteral("fi"), QStringLiteral("hr"),
108107
QStringLiteral("ru")};
108+
QLocale locale;
109109
QString langSetting = QSettings().value(QStringLiteral("lang"), lang).toString();
110110
if (SUPPORTED_LANGS.contains(langSetting)) {
111111
locale = QLocale(langSetting);
@@ -119,10 +119,10 @@ CommandWithArgumentsPtr Application::parseArgs()
119119
QStringLiteral("Parent window handle (unused)"),
120120
QStringLiteral("parent-window"));
121121
QCommandLineParser parser;
122-
parser.setApplicationDescription(
122+
parser.setApplicationDescription(QStringLiteral(
123123
"Application that communicates with the Web eID browser extension via standard input and "
124124
"output, but also works standalone in command-line mode. Performs PKI cryptographic "
125-
"operations with eID smart cards for signing and authentication purposes.");
125+
"operations with eID smart cards for signing and authentication purposes."));
126126

127127
parser.addHelpOption();
128128
parser.addOptions({{{"c", "command-line-mode"},

src/controller/application.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class Application : public QApplication
4545
public:
4646
Application(int& argc, char** argv, const QString& name);
4747

48-
bool isDarkTheme() const;
48+
static bool isDarkTheme();
4949
void loadTranslations(const QString& lang = {});
50-
CommandWithArgumentsPtr parseArgs();
50+
static CommandWithArgumentsPtr parseArgs();
5151
static void registerMetatypes();
5252

5353
// Methods specific to Safari web extension's containing app,

src/controller/application.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#import <AppKit/AppKit.h>
2828
#import <Cocoa/Cocoa.h>
2929

30-
bool Application::isDarkTheme() const
30+
bool Application::isDarkTheme()
3131
{
3232
if (__builtin_available(macOS 10.14, *))
3333
{

src/controller/command-handlers/certificatereader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "application.hpp"
2626
#include "signauthutils.hpp"
27-
#include "utils.hpp"
27+
#include "utils/utils.hpp"
2828
#include "magic_enum/magic_enum.hpp"
2929

3030
using namespace electronic_id;

src/controller/command-handlers/sign.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "sign.hpp"
2424

2525
#include "signauthutils.hpp"
26-
#include "utils.hpp"
26+
#include "utils/utils.hpp"
2727

2828
using namespace electronic_id;
2929

src/controller/command-handlers/signauthutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "ui.hpp"
2626
#include "commandhandler.hpp"
27-
#include "utils.hpp"
27+
#include "utils/utils.hpp"
2828

2929
using namespace electronic_id;
3030

src/controller/controller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "threads/commandhandlerrunthread.hpp"
2828
#include "threads/waitforcardthread.hpp"
2929

30-
#include "utils.hpp"
30+
#include "utils/utils.hpp"
3131
#include "inputoutputmode.hpp"
3232
#include "writeresponse.hpp"
3333

src/controller/ui.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "certandpininfo.hpp"
2727
#include "retriableerror.hpp"
2828

29-
#include "observer_ptr.hpp"
29+
#include "utils/observer_ptr.hpp"
3030

3131
#include <QDialog>
3232

0 commit comments

Comments
 (0)