1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Riebeling
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
26 Q_IMPORT_PLUGIN(qtaccessiblewidgets
)
29 int main( int argc
, char ** argv
) {
30 QApplication
app( argc
, argv
);
32 QDir
dir(QApplication::applicationDirPath());
35 QApplication::addLibraryPath(dir
.absolutePath());
37 QString absolutePath
= QCoreApplication::instance()->applicationDirPath();
38 // portable installation:
39 // check for a configuration file in the program folder.
41 if(QFileInfo(absolutePath
+ "/RockboxUtility.ini").isFile())
42 user
= new QSettings(absolutePath
+ "/RockboxUtility.ini", QSettings::IniFormat
, 0);
43 else user
= new QSettings(QSettings::IniFormat
, QSettings::UserScope
, "rockbox.org", "RockboxUtility");
45 QString applang
= QLocale::system().name();
46 QTranslator translator
;
49 if(!user
->value("lang", "").toString().isEmpty()) {
50 applang
= user
->value("lang", "").toString();
52 if(!applang
.isEmpty()) {
53 if(!translator
.load("rbutil_" + applang
, absolutePath
))
54 translator
.load("rbutil_" + applang
, ":/lang");
55 if(!qttrans
.load("qt_" + applang
,
56 QLibraryInfo::location(QLibraryInfo::TranslationsPath
)))
57 qttrans
.load("qt_" + applang
, ":/lang");
59 QLocale::setDefault(applang
);
62 app
.installTranslator(&translator
);
63 app
.installTranslator(&qttrans
);
68 // app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );