source: subversion/applications/editors/merkaartor/Main.cpp @ 13954

Last change on this file since 13954 was 13732, checked in by Chris Browet, 11 years ago

FIX : Tweaked windows menu to be "standard"
ADD : Splash screen
FIX : warnings

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#include <QtGui/QApplication>
2#include <QtGui/QMessageBox> 
3
4#include <QLibraryInfo>
5#include <QSplashScreen>
6
7#include "MainWindow.h"
8#include "Preferences/MerkaartorPreferences.h"
9
10int main(int argc, char** argv)
11{
12        QApplication app(argc,argv);
13
14        QCoreApplication::setOrganizationName("BartVanhauwaert");
15        QCoreApplication::setOrganizationDomain("www.irule.be");
16        QCoreApplication::setApplicationName("Merkaartor");
17
18        QPixmap pixmap(":/Splash/Mercator_splash.png");
19        QSplashScreen splash(pixmap);
20        splash.show();
21        app.processEvents();
22
23        splash.showMessage(QString(app.translate("Main", "Merkaartor v%1%2\nInitializing...")).arg(VERSION).arg(REVISION), Qt::AlignBottom | Qt::AlignHCenter, Qt::black);
24        app.processEvents();
25
26#if defined(Q_OS_MAC)
27        QDir dir(QApplication::applicationDirPath());
28        dir.cdUp();
29        dir.cd("plugins");
30        QApplication::setLibraryPaths(QStringList(dir.absolutePath()));
31#endif
32
33        MainWindow Main;
34
35#ifdef _MOBILE
36//      Main.showMaximized();
37        Main.showFullScreen();
38#else
39        Main.show();
40#endif
41        QStringList fileNames = QCoreApplication::arguments();
42        fileNames.removeFirst();
43
44        Main.loadFiles(fileNames);
45
46        if (fileNames.isEmpty())
47                QDir::setCurrent(MerkaartorPreferences::instance()->getWorkingDir());
48
49        Main.show();
50        splash.finish(&Main);
51
52        int x = app.exec();
53        return x;
54}
55
56
Note: See TracBrowser for help on using the repository browser.