main.cpp 2.02 KB
Newer Older
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
1
2
3
4
5
6
/*
 *  --------------------------------------------------------------------------------------------
 *
 *    VVV        VVV A           Virtual Acoustics (VA) | http://www.virtualacoustics.org
 *     VVV      VVV AAA          Licensed under the Apache License, Version 2.0
 *      VVV    VVV   AAA
7
 *       VVV  VVV     AAA        Copyright 2015-2019
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
8
9
10
11
12
13
14
 *        VVVVVV       AAA       Institute of Technical Acoustics (ITA)
 *         VVVV         AAA      RWTH Aachen University
 *
 *  --------------------------------------------------------------------------------------------
 */

#include <QApplication>
15
#include <QCommandLineParser>
16
17
18
#include <QCoreApplication>
#include <QLocale>

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
19
20
21
22
23
24
25
26
27
#include "RedstartWindow.h"

int main( int argc, char* argv[] )
{
	// Qt app
	QApplication a( argc, argv );
	a.setOrganizationName( "Institute of Technical Acoustics (ITA)" );
	a.setOrganizationDomain( "akustik.rwth-aachen.de" );
	a.setApplicationName( "Redstart" );
28
	a.setApplicationDisplayName( "Redstart VA GUI [BETA]" );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
29

30
31
32
	QLocale::setDefault( QLocale::English );

	QIcon icon;
33
	icon.addFile( QStringLiteral( ":/banners/logo/BlackRedstartM.png" ), QSize(), QIcon::Normal, QIcon::On );
34
35
	a.setWindowIcon( icon );

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
	QCommandLineParser oCLIParser;
	oCLIParser.setApplicationDescription( "Redstart helper" );
	oCLIParser.addHelpOption();
	oCLIParser.addVersionOption();
	oCLIParser.addPositionalArgument( "session", QCoreApplication::translate( "main", "Redstart session or VA core configuration file path" ) );

	QCommandLineOption bAutoStartVA( "a", QCoreApplication::translate( "main", "Autostart VA core" ) );
	oCLIParser.addOption( bAutoStartVA );

	QCommandLineOption oSafeModeOption( QStringList() << "s" << "safemode", QCoreApplication::translate( "main", "Run in safemode (override and disable autostart)" ) );
	oCLIParser.addOption( oSafeModeOption );

	oCLIParser.process( a );

	bool bFailSafeMode = oCLIParser.isSet( oSafeModeOption );
	bool bAutoStart = oCLIParser.isSet( bAutoStartVA );

	RedstartWindow w( bFailSafeMode, bAutoStart );
Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
54
	w.show();
55

Dipl.-Ing. Jonas Stienen's avatar
Dipl.-Ing. Jonas Stienen committed
56
57
	return a.exec();
};