MinetestMapperGUI/main.cpp

41 lines
1.3 KiB
C++
Raw Normal View History

2015-05-13 07:49:49 -07:00
#include "mainwindow.h"
2019-03-21 19:24:03 -07:00
#include "translator.h"
#include <QCoreApplication>
2015-05-13 07:49:49 -07:00
#include <QApplication>
#include <QDebug>
2017-01-27 03:15:24 -08:00
#include <QCommandLineParser>
2017-03-02 22:02:15 -08:00
#include <QLibraryInfo>
2015-05-13 07:49:49 -07:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("MinetestMapperGui");
a.setApplicationDisplayName("Minetest Mapper GUI");
a.setApplicationVersion(GIT_VERSION);
a.setOrganizationName("MinetestMapperGui");
2017-03-02 22:02:15 -08:00
// Setup the translators
2019-03-21 19:24:03 -07:00
Translator t(QLocale::system());
2017-03-02 22:02:15 -08:00
// Init commandline parser
2017-01-27 03:15:24 -08:00
QCommandLineParser parser;
parser.setApplicationDescription("This program provides a graphical user interface for minetestmapper. \n"
"If you are looking for the command line interface of minetesmapper please execute minetestmapper directly.");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption startPortableOption(QStringList() << "p" << "portable",
"Starts in portable mode which reads and writes settings and profiles relative to current directory");
parser.addOption(startPortableOption);
parser.process(a.arguments());
bool portable = parser.isSet(startPortableOption);
2019-03-21 19:24:03 -07:00
MainWindow w(portable, &t);
2015-05-13 07:49:49 -07:00
w.show();
return a.exec();
}