00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __MAIN_H__
00025 #define __MAIN_H__
00026
00027 #include "ini/ini.h"
00028 #include "ip2c/ip2c.h"
00029 #include "plugins/pluginloader.h"
00030 #include "datapaths.h"
00031 #include "refresher.h"
00032 #include <QApplication>
00033 #include <QObject>
00034 #include <QStringList>
00035
00039 class MAIN_EXPORT Main : public QObject
00040 {
00041 public:
00042 static const QString IP2C_FILENAME;
00043
00044 static IP2C *ip2c;
00045 static DataPaths* dataPaths;
00046 static QWidget* mainWindow;
00047 static PluginLoader* enginePlugins;
00048 static bool running;
00049 static RefreshingThread* refreshingThread;
00050 static QString workingDirectory;
00051
00052 Main(int argc, char* argv[]);
00053 ~Main();
00054
00060 void finalize();
00061
00065 int run();
00066
00067 protected:
00068 static const QString DOOMSEEKER_CONFIG_FILENAME;
00069 static const QString DOOMSEEKER_INI_FILENAME;
00070 static const QString DOOMSEEKER_IRC_INI_FILENAME;
00071
00072 void convertCfgToIni();
00073 void convertOldIniToQSettingsIni();
00074
00075 void createMainWindow();
00076 bool createRemoteConsole();
00077
00078 int runTestMode();
00079
00085 bool initDataDirectories();
00086
00092 int initIP2C();
00093 void initIRCConfig();
00094 void initMainConfig();
00095 void initPluginConfig();
00096
00101 bool interpretCommandLineParameters();
00102 void preserveOldConfigBackwardsCompatibility();
00103 void setupRefreshingThread();
00104
00105 QApplication* application;
00106 char** arguments;
00107 int argumentsCount;
00108 bool bIsFirstRun;
00109 bool bPortableMode;
00110 bool bTestMode;
00111 QStringList dataDirectories;
00112 QString rconPluginName;
00113 QString rconAddress;
00114 unsigned short rconPort;
00115 bool startRcon;
00116 };
00117
00118 #endif