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 ****************************************************************************/
27 Q_IMPORT_PLUGIN(qtaccessiblewidgets
)
32 int main( int argc
, char ** argv
) {
33 qInstallMsgHandler(SysTrace::debug
);
34 QApplication
app( argc
, argv
);
36 QDir
dir(QApplication::applicationDirPath());
39 QApplication::addLibraryPath(dir
.absolutePath());
41 QString absolutePath
= QCoreApplication::instance()->applicationDirPath();
42 // portable installation:
43 // check for a configuration file in the program folder.
45 if(QFileInfo(absolutePath
+ "/RockboxUtility.ini").isFile())
46 user
= new QSettings(absolutePath
+ "/RockboxUtility.ini", QSettings::IniFormat
, 0);
47 else user
= new QSettings(QSettings::IniFormat
, QSettings::UserScope
, "rockbox.org", "RockboxUtility");
49 QString applang
= QLocale::system().name();
50 QTranslator translator
;
53 if(!user
->value("lang", "").toString().isEmpty()) {
54 applang
= user
->value("lang", "").toString();
56 if(!applang
.isEmpty()) {
57 if(!translator
.load("rbutil_" + applang
, absolutePath
))
58 translator
.load("rbutil_" + applang
, ":/lang");
59 if(!qttrans
.load("qt_" + applang
,
60 QLibraryInfo::location(QLibraryInfo::TranslationsPath
)))
61 qttrans
.load("qt_" + applang
, ":/lang");
63 QLocale::setDefault(applang
);
66 app
.installTranslator(&translator
);
67 app
.installTranslator(&qttrans
);
68 //: This string is used to indicate the writing direction. Translate it
69 //: to "RTL" (without quotes) for RTL languages. Anything else will get
70 //: treated as LTR language.
71 if(QObject::tr("LTR") == "RTL")
72 app
.setLayoutDirection(Qt::RightToLeft
);
77 // app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) );