Doomseeker
   
  • Doomseeker
  • Wadseeker
  • Download
  • Tracker
  • Git
  • Docs
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

src/core/main.h

00001 //------------------------------------------------------------------------------
00002 // main.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2009 "Blzut3" <admin@maniacsvault.net>
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 "localizationinfo.h"
00032 #include <QApplication>
00033 #include <QObject>
00034 #include <QStringList>
00035 #include <QUrl>
00036 
00037 class RefreshingThread;
00038 
00042 class MAIN_EXPORT Main : public QObject
00043 {
00044         public:
00045                 static const QString            IP2C_FILENAME;
00046 
00047                 static QApplication*            application;
00057                 static bool bInstallUpdatesAndRestart;
00058                 static IP2C                                     *ip2c;
00059                 static DataPaths*                       dataPaths;
00060                 static QWidget*                         mainWindow;
00061                 static PluginLoader*            enginePlugins;
00062                 static QList<LocalizationInfo> localizations;
00063                 static bool                                     running; 
00064                 static RefreshingThread*        refreshingThread;
00065                 static QString                          workingDirectory;
00066                 static QString argDataDir;
00067                 static bool bPortableMode;
00068 
00069                 Main(int argc, char* argv[]);
00070                 ~Main();
00071 
00077                 void                                            finalize();
00078 
00082                 int                                                     run();
00083 
00084         protected:
00085                 static const QString            DOOMSEEKER_CONFIG_FILENAME;
00086                 static const QString            DOOMSEEKER_INI_FILENAME;
00087                 static const QString            DOOMSEEKER_IRC_INI_FILENAME;
00088 
00089                 int                                                     connectToServerByURL();
00090                 void                                            convertOldIniToQSettingsIni();
00091 
00092                 void                                            createMainWindow();
00093                 bool                                            createRemoteConsole();
00094 
00095                 int                                                     runTestMode();
00096 
00102                 bool                                            initDataDirectories();
00103 
00109                 int                                                     initIP2C();
00110                 void                                            initIRCConfig();
00111                 void initLocalizationsDefinitions();
00112                 void                                            initMainConfig();
00113                 void                                            initPluginConfig();
00114                 int installPendingUpdates();
00115 
00120                 bool                                            interpretCommandLineParameters();
00121                 void                                            preserveOldConfigBackwardsCompatibility();
00122                 void                                            setupRefreshingThread();
00123 
00124                 char**                                          arguments;
00125                 int                                                     argumentsCount;
00126                 bool                        bIsFirstRun;
00127                 bool                                            bTestMode;
00128                 QStringList                             dataDirectories;
00129                 QString                                         rconPluginName; 
00130                 QString                                         rconAddress;
00131                 unsigned short                          rconPort;
00132                 bool                                            startRcon;
00133                 int updateFailedCode;
00134                 QUrl                                            connectUrl;
00135 };
00136 
00137 #endif /* __MAIN_H__ */
   
Doomseeker © 2009-2024 The Doomseeker Team