|     15  *  You should have received a copy of the GNU General Public License | 
    15  *  You should have received a copy of the GNU General Public License | 
|     16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
    16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
|     17  */ | 
    17  */ | 
|     18  | 
    18  | 
|     19 #include <QApplication> | 
    19 #include <QApplication> | 
|     20 #include "configwindow.h" | 
        | 
|     21 #include "types.h" | 
        | 
|     22 #include "demo.h" | 
    20 #include "demo.h" | 
|     23 #include "prompts.h" | 
    21 #include "prompts.h" | 
|     24 #include "hginfo.h" | 
    22 #include "misc.h" | 
|     25  | 
    23  | 
|     26 // | 
    24 // | 
|     27 // ------------------------------------------------------------------------------------------------- | 
    25 // ------------------------------------------------------------------------------------------------- | 
|     28 // | 
    26 // | 
|     29  | 
    27  | 
|     31 { | 
    29 { | 
|     32 	QApplication app (argc, argv); | 
    30 	QApplication app (argc, argv); | 
|     33 	app.setApplicationName (UNIXNAME); | 
    31 	app.setApplicationName (UNIXNAME); | 
|     34 	app.setOrganizationName (UNIXNAME); | 
    32 	app.setOrganizationName (UNIXNAME); | 
|     35 	app.setApplicationVersion (versionString()); | 
    33 	app.setApplicationVersion (versionString()); | 
|     36 	qRegisterMetaType<ZandronumVersion> ("ZandronumVersion"); | 
    34 	commonInit(); | 
|     37 	qRegisterMetaTypeStreamOperators<ZandronumVersion> ("ZandronumVersion"); | 
        | 
|     38  | 
        | 
|     39 	for (int i = 1; i < argc; ++i) | 
        | 
|     40 	{ | 
        | 
|     41 		QString arg = argv[i]; | 
        | 
|     42  | 
        | 
|     43 		if (arg == "--config") | 
        | 
|     44 		{ | 
        | 
|     45 			ConfigWindow dlg; | 
        | 
|     46 			return dlg.exec(); | 
        | 
|     47 		} | 
        | 
|     48 	} | 
        | 
|     49  | 
    35  | 
|     50 	if (argc > 1) | 
    36 	if (argc > 1) | 
|     51 	{ | 
    37 	{ | 
|     52 		return launchDemo (argv[1]); | 
    38 		return launchDemo (argv[1]); | 
|     53 	} | 
    39 	} | 
|     59 			return 0; | 
    45 			return 0; | 
|     60  | 
    46  | 
|     61 		return launchDemo (dlg->path()); | 
    47 		return launchDemo (dlg->path()); | 
|     62 	} | 
    48 	} | 
|     63 } | 
    49 } | 
|     64  | 
        | 
|     65 // | 
        | 
|     66 // ------------------------------------------------------------------------------------------------- | 
        | 
|     67 // | 
        | 
|     68  | 
        | 
|     69 QString versionString() | 
        | 
|     70 { | 
        | 
|     71 #ifndef RELEASE | 
        | 
|     72 # ifdef HG_NODE | 
        | 
|     73 	// non-release with hg info | 
        | 
|     74 	return VERSION_STRING "-" HG_NODE; | 
        | 
|     75 # else | 
        | 
|     76 	// non-release, no hg info | 
        | 
|     77 	return VERSION_STRING "-beta"; | 
        | 
|     78 # endif | 
        | 
|     79 #else | 
        | 
|     80 	// release | 
        | 
|     81 	return VERSION_STRING; | 
        | 
|     82 #endif | 
        | 
|     83 } | 
        | 
|     84  | 
        | 
|     85 // | 
        | 
|     86 // ------------------------------------------------------------------------------------------------- | 
        | 
|     87 // | 
        | 
|     88  | 
        | 
|     89 QString versionSignature() | 
        | 
|     90 { | 
        | 
|     91 #ifdef HG_DATE_STRING | 
        | 
|     92 # define DATE_INFO " (" HG_DATE_STRING ")" | 
        | 
|     93 #else | 
        | 
|     94 # define DATE_INFO "" | 
        | 
|     95 #endif | 
        | 
|     96  | 
        | 
|     97 	return QString (APPNAME) + " " + versionString() + DATE_INFO; | 
        | 
|     98 } | 
        |