Commit a7a2fdc9 authored by Mike Kremer's avatar Mike Kremer
Browse files

Added message box informaing the user that a restart will be required to...

Added message box informaing the user that a restart will be required to change the language settings.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9342 383ad7c9-94d9-4d36-a494-682f7c89f535
parent fc90dfac
...@@ -58,8 +58,8 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -58,8 +58,8 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
: QWidget(parent), : QWidget(parent),
plugins_(_plugins), plugins_(_plugins),
coreKeys_(_core), coreKeys_(_core),
keys_(_invKeys) keys_(_invKeys),
translationIndexChanged_(false)
{ {
setupUi(this); setupUi(this);
...@@ -142,7 +142,6 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB ...@@ -142,7 +142,6 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
progressDialog = new QProgressDialog(this); progressDialog = new QProgressDialog(this);
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload())); connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
//colordialog //colordialog
connect(backgroundButton, SIGNAL(clicked()), this, SLOT(getBackgroundColor()) ); connect(backgroundButton, SIGNAL(clicked()), this, SLOT(getBackgroundColor()) );
connect(baseColorButton, SIGNAL(clicked()), this, SLOT(getBaseColor()) ); connect(baseColorButton, SIGNAL(clicked()), this, SLOT(getBaseColor()) );
...@@ -209,6 +208,10 @@ void OptionsWidget::switchStackedWidget() { ...@@ -209,6 +208,10 @@ void OptionsWidget::switchStackedWidget() {
slotPreviewStereoSettings(); slotPreviewStereoSettings();
} }
void OptionsWidget::slotTranslationIndexChanged(int /*_index*/) {
translationIndexChanged_ = true;
}
void OptionsWidget::updateViewerSettings(int _row){ void OptionsWidget::updateViewerSettings(int _row){
updatingViewerSettings_ = true; updatingViewerSettings_ = true;
...@@ -393,6 +396,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -393,6 +396,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
translation->setCurrentIndex(1); translation->setCurrentIndex(1);
else else
translation->setCurrentIndex(2); translation->setCurrentIndex(2);
// Listen to changes...
connect(translation, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTranslationIndexChanged(int)));
updateVersionsTable(); updateVersionsTable();
...@@ -657,6 +663,15 @@ void OptionsWidget::slotApply() { ...@@ -657,6 +663,15 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() ); OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() );
OpenFlipper::Options::gridVisible( gridVisible->isChecked() ); OpenFlipper::Options::gridVisible( gridVisible->isChecked() );
// Show warning message that restart is required if language has been changed...
if(translationIndexChanged_) {
int restart = QMessageBox::information(this, tr("Restart required!"),
tr("The changes will take effect after next restart. Do you want to close OpenFlipper now?"),
QMessageBox::Yes | QMessageBox::No);
if(restart == QMessageBox::Yes) emit exit(0);
}
switch ( translation->currentIndex() ){ switch ( translation->currentIndex() ){
case 0 : OpenFlipper::Options::translation("en_US"); break; case 0 : OpenFlipper::Options::translation("en_US"); break;
case 1 : OpenFlipper::Options::translation("de_DE"); break; case 1 : OpenFlipper::Options::translation("de_DE"); break;
......
...@@ -208,6 +208,9 @@ private slots: ...@@ -208,6 +208,9 @@ private slots:
// Update component of OpenFlipper // Update component of OpenFlipper
void updateComponent(); void updateComponent();
// Tracks whether another language has been selected
void slotTranslationIndexChanged(int);
private: private:
/** After checking for updates this variable will contain a list of filenames for which updates are available /** After checking for updates this variable will contain a list of filenames for which updates are available
...@@ -221,6 +224,10 @@ private: ...@@ -221,6 +224,10 @@ private:
/** Current filename of the plugin to be updated /** Current filename of the plugin to be updated
*/ */
QString currentUpdateName_; QString currentUpdateName_;
/** Used to track whether another language has been selected
*/
bool translationIndexChanged_;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment