diff options
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4c7169b..d2eeaf8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -33,6 +33,12 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) : ui->setupUi(this); + connect( // connect with "this" as context, so the connection will die when the window is destroyed + kristall::globals().localization.get(), &Localization::translationChanged, + this, [this]() { this->ui->retranslateUi(this); }, + Qt::DirectConnection + ); + this->url_status->setElideMode(Qt::ElideMiddle); this->statusBar()->addWidget(this->url_status); @@ -469,13 +475,17 @@ void MainWindow::on_actionSettings_triggered() dialog.setOptions(kristall::globals().options); dialog.setGeminiSslTrust(kristall::globals().trust.gemini); dialog.setHttpsSslTrust(kristall::globals().trust.https); + dialog.setLocale(kristall::globals().localization->locale); if(dialog.exec() != QDialog::Accepted) { kristall::setTheme(kristall::globals().options.theme); + kristall::globals().localization->setLocale(kristall::globals().localization->locale); this->setUiDensity(kristall::globals().options.ui_density, false); return; } + kristall::globals().localization->setLocale(dialog.locale()); + kristall::globals().trust.gemini = dialog.geminiSslTrust(); kristall::globals().trust.https = dialog.httpsSslTrust(); kristall::globals().options = dialog.options(); @@ -483,6 +493,7 @@ void MainWindow::on_actionSettings_triggered() kristall::globals().protocols = dialog.protocols(); kristall::globals().document_style = dialog.geminiStyle(); + kristall::saveLocale(); kristall::applySettings(); kristall::saveSettings(); |
