/[qtwitgui]/branches/QT_4.8.4/VS2008/main.cpp
ViewVC logotype

Contents of /branches/QT_4.8.4/VS2008/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations) (download)
Sat Jul 20 07:13:22 2013 UTC (6 years ago) by william
File size: 1395 byte(s)


1 #include <QtGui/QApplication>
2 #include "mainwindow.h"
3 #include "includes.h"
4 #include "wiitdb.h"
5 #include "tools.h"
6 #include "svnrev.h"
7 int main(int argc, char *argv[])
8 {
9 Q_INIT_RESOURCE( resources );
10
11 QApplication a(argc, argv);
12 settingsPath = QDesktopServices::storageLocation( QDesktopServices::HomeLocation ) + "/QtWitGui.ini";
13 SetupLog();
14 qDebug().nospace() << "<b><text style=\"color:green\">" << PROGRAM_NAME << " r" << SVN_REV_STR << "</text></b>";
15
16 QTranslator translator;
17 if( !translator.load( QString( "language/witGuiLang_" ) + QLocale::system().name() ) )
18 translator.load( QString( ":/language/witGuiLang_" ) + QLocale::system().name() );
19
20 a.installTranslator( &translator );
21
22 wiiTDB = new WiiTDB;
23
24 QApplication::setWindowIcon( QIcon( ":images/icon.ico" ) );
25
26 MainWindow w;
27
28 QStringList args = QApplication::arguments();
29 if( args.contains( "--greyness") )
30 {
31 QFile file( ":/darkTheme.qss" );
32 file.open( QFile::ReadOnly );
33 QString styleSheet = QLatin1String( file.readAll() );
34 w.setStyleSheet( styleSheet );
35 }
36 w.show();
37
38 int ret = a.exec();
39 delete wiiTDB;
40 delete logWindow;
41 #ifdef Q_WS_WIN //on windows XP, wmic leaves behind a temp file ( 0 bytes ): just delete it
42 if( QFile::exists( "./TempWmicBatchFile.bat" ) )
43 QFile::remove( "./TempWmicBatchFile.bat" );
44 #endif
45 return ret;
46 }

  ViewVC Help
Powered by ViewVC 1.1.22