Skip to content

Commit

Permalink
Modernize the property setters/getters via inspector
Browse files Browse the repository at this point in the history
  • Loading branch information
bakulf committed Nov 29, 2022
1 parent a7eb906 commit c9809f2
Show file tree
Hide file tree
Showing 22 changed files with 805 additions and 852 deletions.
6 changes: 3 additions & 3 deletions src/addons/addoni18n.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "addoni18n.h"
#include "leakdetector.h"
#include "localizer.h"
#include "settingsholder.h"

AddonI18n::AddonI18n(QObject* parent, const QString& manifestFileName,
const QString& id, const QString& name)
Expand All @@ -15,11 +15,11 @@ AddonI18n::AddonI18n(QObject* parent, const QString& manifestFileName,
AddonI18n::~AddonI18n() { MVPN_COUNT_DTOR(AddonI18n); }

void AddonI18n::enable() {
emit Localizer::instance()->codeChanged();
emit SettingsHolder::instance()->languageCodeChanged();
Addon::enable();
}

void AddonI18n::disable() {
emit Localizer::instance()->codeChanged();
emit SettingsHolder::instance()->languageCodeChanged();
Addon::disable();
}
23 changes: 12 additions & 11 deletions src/commands/commandui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,24 +586,25 @@ int CommandUI::run(QStringList& tokens) {

#endif

QObject::connect(Localizer::instance(), &Localizer::codeChanged, []() {
logger.debug() << "Retranslating";
QmlEngineHolder::instance()->engine()->retranslate();
NotificationHandler::instance()->retranslate();
L18nStrings::instance()->retranslate();
AddonManager::instance()->retranslate();
QObject::connect(
SettingsHolder::instance(), &SettingsHolder::languageCodeChanged, []() {
logger.debug() << "Retranslating";
QmlEngineHolder::instance()->engine()->retranslate();
NotificationHandler::instance()->retranslate();
L18nStrings::instance()->retranslate();
AddonManager::instance()->retranslate();

#ifdef MVPN_MACOS
MacOSMenuBar::instance()->retranslate();
MacOSMenuBar::instance()->retranslate();
#endif

#ifdef MVPN_WASM
WasmWindowController::instance()->retranslate();
WasmWindowController::instance()->retranslate();
#endif

MozillaVPN::instance()->serverCountryModel()->retranslate();
MozillaVPN::instance()->currentServer()->retranslate();
});
MozillaVPN::instance()->serverCountryModel()->retranslate();
MozillaVPN::instance()->currentServer()->retranslate();
});

InspectorHandler::initialize();

Expand Down
Loading

0 comments on commit c9809f2

Please sign in to comment.