QTfrontend/main.cpp
branchqt5transition
changeset 12897 fc47fc4af6bd
parent 12661 1dc160048a0c
child 13178 b4f48e7a4953
equal deleted inserted replaced
12896:8869b5256720 12897:fc47fc4af6bd
    18 
    18 
    19 #include "HWApplication.h"
    19 #include "HWApplication.h"
    20 
    20 
    21 #include <QTranslator>
    21 #include <QTranslator>
    22 #include <QLocale>
    22 #include <QLocale>
    23 #include <QPlastiqueStyle>
       
    24 #include <QRegExp>
    23 #include <QRegExp>
    25 #include <QMap>
    24 #include <QMap>
    26 #include <QSettings>
    25 #include <QSettings>
    27 #include <QStringListModel>
    26 #include <QStringListModel>
    28 #include <QDate>
    27 #include <QDate>
   250     QPixmap pixmap(":/res/splash.png");
   249     QPixmap pixmap(":/res/splash.png");
   251     QSplashScreen splash(pixmap);
   250     QSplashScreen splash(pixmap);
   252     splash.show();
   251     splash.show();
   253 #endif
   252 #endif
   254 
   253 
   255     app.setStyle(new QPlastiqueStyle());
   254     //app.setStyle(new QPlastiqueStyle());
   256 
   255 
   257     QDateTime now = QDateTime::currentDateTime();
   256     QDateTime now = QDateTime::currentDateTime();
   258     srand(now.toTime_t());
   257     srand(now.toTime_t());
   259     rand();
   258     rand();
   260 
   259 
   330         {
   329         {
   331             cc = QLocale::system().name();
   330             cc = QLocale::system().name();
   332 
   331 
   333             // Fallback to current input locale if "C" locale is returned
   332             // Fallback to current input locale if "C" locale is returned
   334             if(cc == "C")
   333             if(cc == "C")
   335                 cc = HWApplication::keyboardInputLocale().name();
   334                 cc = HWApplication::inputMethod()->locale().name();
   336         }
   335         }
   337 
   336 
   338         // Load locale files into translators
   337         // Load locale files into translators
   339         if (!TranslatorHedgewars.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
   338         if (!TranslatorHedgewars.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
   340             qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc));
   339             qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc));