mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Fix bug in Language selection
This commit is contained in:
parent
84f945c5a1
commit
4fd9ef2dd2
10
main.cpp
10
main.cpp
@ -214,7 +214,6 @@ int main(int argc, char *argv[])
|
||||
qDebug() << "Available Translations";
|
||||
QFileInfoList list=dir.entryInfoList();
|
||||
QString language=PREF[STR_PREF_Language].toString();
|
||||
bool langok=false;
|
||||
|
||||
QString langfile,langname;
|
||||
|
||||
@ -238,16 +237,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (langfile.isEmpty()) {
|
||||
if (language.isEmpty()) {
|
||||
langsel.connect(&lang_okbtn,SIGNAL(clicked()),&langsel, SLOT(close()));
|
||||
|
||||
langsel.exec();
|
||||
langsel.disconnect(&lang_okbtn,SIGNAL(clicked()),&langsel, SLOT(close()));
|
||||
langfile=lang_combo.currentText();
|
||||
PREF[STR_PREF_Language]=langfile;
|
||||
langname=lang_combo.currentText();
|
||||
langfile=lang_combo.itemData(lang_combo.currentIndex()).toString();
|
||||
PREF[STR_PREF_Language]=langname;
|
||||
}
|
||||
|
||||
qDebug() << "Loading Translation" << langfile;
|
||||
qDebug() << "Loading " << langname << " Translation" << langfile;
|
||||
QTranslator translator;
|
||||
|
||||
translator.load(langfile,QCoreApplication::applicationDirPath()+"/Translations");
|
||||
|
@ -612,7 +612,7 @@ void MainWindow::on_action_About_triggered()
|
||||
QString msg=QString(
|
||||
"<span style=\"color:#000000; font-weight:600; vertical-align:middle;\">"
|
||||
"<table width=100%><tr><td>"
|
||||
"<p><h1>"+tr("SleepyHead")+" v%1.%2.%3-%4 (%8)</h1></p><font color=black><p>"+tr("Build Date")+": %5 %6<br/>%7<br/>"+tr("Data Folder")+": %9<hr>"+
|
||||
"<p><h1>"+STR_TR_SleepyHead+" v%1.%2.%3-%4 (%8)</h1></p><font color=black><p>"+tr("Build Date")+": %5 %6<br/>%7<br/>"+tr("Data Folder Location")+": %9<hr>"+
|
||||
tr("Copyright")+" ©2012 Mark Watkins (jedimark) <br> \n"+
|
||||
tr("This software is released under the GNU Public License v3.0<br>")+
|
||||
"<hr><p>"+tr("SleepyHead Project Page")+": <a href=\"http://sourceforge.net/projects/sleepyhead\">http://sourceforge.net/projects/sleepyhead</a><br/>"+
|
||||
@ -1095,7 +1095,8 @@ void MainWindow::RestartApplication(bool force_login)
|
||||
args << "-p";
|
||||
if (force_login) args << "-l";
|
||||
if (QProcess::startDetached(apppath,args)) {
|
||||
QApplication::instance()->exit();
|
||||
::exit(0);
|
||||
//QApplication::instance()->exit();
|
||||
} else QMessageBox::warning(this,tr("Gah!"),tr("If you can read this, the restart command didn't work. Your going to have to do it yourself manually."),QMessageBox::Ok);
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user