diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2021-03-17 11:54:43 +0100 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2021-05-08 10:44:03 +0200 |
| commit | 10684b6d82f1843eff3921da40802d335fb3cf5c (patch) | |
| tree | a80d403f0668686de90c2cd48786e7b5e5fc2128 /src/widgets/mediaplayer.cpp | |
| parent | a2f36ec4d14ddf1bcee98e52a0f3a924804d06fb (diff) | |
| download | kristall-10684b6d82f1843eff3921da40802d335fb3cf5c.tar.gz | |
Further improves localization (#191). Allows switching and setting the chosen localization properly.
Diffstat (limited to 'src/widgets/mediaplayer.cpp')
| -rw-r--r-- | src/widgets/mediaplayer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/mediaplayer.cpp b/src/widgets/mediaplayer.cpp index 6344cff..d2592c7 100644 --- a/src/widgets/mediaplayer.cpp +++ b/src/widgets/mediaplayer.cpp @@ -1,6 +1,8 @@ #include "mediaplayer.hpp" #include "ui_mediaplayer.h" +#include "kristall.hpp" + #include <QMediaContent> #include <QToolButton> #include <QTime> @@ -14,6 +16,12 @@ MediaPlayer::MediaPlayer(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->player.setVideoOutput(this->ui->video_out); connect(&this->player, &QMediaPlayer::durationChanged, this->ui->media_progress, &QSlider::setMaximum); |
