Commit a7a2fdc9 authored by Mike Kremer's avatar Mike Kremer

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
: QWidget(parent),
plugins_(_plugins),
coreKeys_(_core),
keys_(_invKeys)
keys_(_invKeys),
translationIndexChanged_(false)
{
setupUi(this);
......@@ -142,7 +142,6 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
progressDialog = new QProgressDialog(this);
connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload()));
//colordialog
connect(backgroundButton, SIGNAL(clicked()), this, SLOT(getBackgroundColor()) );
connect(baseColorButton, SIGNAL(clicked()), this, SLOT(getBaseColor()) );
......@@ -209,6 +208,10 @@ void OptionsWidget::switchStackedWidget() {
slotPreviewStereoSettings();
}
void OptionsWidget::slotTranslationIndexChanged(int /*_index*/) {
translationIndexChanged_ = true;
}
void OptionsWidget::updateViewerSettings(int _row){
updatingViewerSettings_ = true;
......@@ -393,6 +396,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
translation->setCurrentIndex(1);
else
translation->setCurrentIndex(2);
// Listen to changes...
connect(translation, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTranslationIndexChanged(int)));
updateVersionsTable();
......@@ -657,6 +663,15 @@ void OptionsWidget::slotApply() {
OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() );
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() ){
case 0 : OpenFlipper::Options::translation("en_US"); break;
case 1 : OpenFlipper::Options::translation("de_DE"); break;
......
......@@ -208,6 +208,9 @@ private slots:
// Update component of OpenFlipper
void updateComponent();
// Tracks whether another language has been selected
void slotTranslationIndexChanged(int);
private:
/** After checking for updates this variable will contain a list of filenames for which updates are available
......@@ -221,6 +224,10 @@ private:
/** Current filename of the plugin to be updated
*/
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