2018-05-10 16:41:14 +00:00
|
|
|
#include "mainwindow.h"
|
2019-01-30 20:23:26 +00:00
|
|
|
|
|
|
|
#include "version.h"
|
|
|
|
|
2018-05-10 16:41:14 +00:00
|
|
|
#include <QApplication>
|
2019-01-30 07:53:19 +00:00
|
|
|
#include <QCommandLineParser>
|
2018-05-10 16:41:14 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
QApplication app(argc, argv);
|
2019-01-30 20:23:26 +00:00
|
|
|
QCoreApplication::setApplicationName(ESGRAF48_DESCRIPTION);
|
|
|
|
QCoreApplication::setApplicationVersion(ESGRAF48_VERSION);
|
2019-01-30 07:53:19 +00:00
|
|
|
|
|
|
|
QCommandLineParser cmdParser;
|
2019-01-30 20:23:26 +00:00
|
|
|
cmdParser.setApplicationDescription(ESGRAF48_DESCRIPTION);
|
2019-01-30 07:53:19 +00:00
|
|
|
cmdParser.addHelpOption();
|
|
|
|
cmdParser.addVersionOption();
|
|
|
|
cmdParser.addPositionalArgument("filename", "file to open");
|
|
|
|
|
|
|
|
cmdParser.process(app);
|
|
|
|
|
|
|
|
const QStringList args = cmdParser.positionalArguments();
|
2018-12-02 14:22:44 +00:00
|
|
|
|
|
|
|
std::unique_ptr<MainWindow> mainWindow;
|
2019-01-30 07:53:19 +00:00
|
|
|
if (args.empty())
|
2018-12-02 14:22:44 +00:00
|
|
|
{
|
|
|
|
mainWindow = std::make_unique<MainWindow>(nullptr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-01-30 07:53:19 +00:00
|
|
|
mainWindow = std::make_unique<MainWindow>(nullptr, args.at(0));
|
2018-12-02 14:22:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mainWindow->show();
|
2018-05-10 16:41:14 +00:00
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|