createserverdialog.h
1 //------------------------------------------------------------------------------
2 // createserverdialog.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2009-2012 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef DOOMSEEKER_GUI_CREATESERVERDIALOG_H
24 #define DOOMSEEKER_GUI_CREATESERVERDIALOG_H
25 
27 #include "dptr.h"
28 #include <QDialog>
29 
31 class EnginePlugin;
32 class GameCreateParams;
33 class Message;
34 class Server;
35 
39 class CreateServerDialog : public QDialog
40 {
41  Q_OBJECT
42 
43  public:
44  CreateServerDialog(QWidget* parent = NULL);
45  virtual ~CreateServerDialog();
46 
47  bool commandLineArguments(QString &executable, QStringList &args);
48  void makeRemoteGameSetupDialog(const EnginePlugin *plugin);
49  void setIwadByName(const QString &iwad);
50 
51  private slots:
52  void btnCommandLineClicked();
53  void btnLoadClicked();
54  void btnPlayOfflineClicked();
55  void btnSaveClicked();
56  void btnStartServerClicked();
57  void firstLoadConfigTimer();
58 
64  void initEngineSpecific(EnginePlugin *engineInfo);
65  void initGamemodeSpecific(const GameMode &gameMode);
66 
67  private:
68  static const QString TEMP_SERVER_CONFIG_FILENAME;
69 
71 
77  void addIwad(const QString& path);
78 
84  bool createHostInfo(GameCreateParams& params, bool offline);
85  void createHostInfoDemoRecord(GameCreateParams& params, bool offline);
86 
87  GameMode currentGameMode() const;
88 
89  bool fillInParamsFromPluginPages(GameCreateParams &params);
90  void initDMFlagsTabs();
91 
97  void initEngineSpecificPages(EnginePlugin* engineInfo);
98 
99  void initInfoAndPassword();
100 
101  void initRules();
102 
103  bool loadConfig(const QString& filename, bool loadingPrevious);
104  void runGame(bool offline);
105  bool saveConfig(const QString& filename);
106 };
107 
108 #endif
Game parametrization data used when creating new games.
Message object used to pass messages throughout the Doomseeker's system.
Definition: message.h:62
A representation of a server for a given game.
Definition: server.h:93
Dialog window allowing user to host a game.
Game mode representation.
Base class to be used by plugins to define custom pages in Create Server dialog.