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 MapListPanel;
34 class Message;
35 class Server;
36 
40 class CreateServerDialog : public QDialog
41 {
42  Q_OBJECT
43 
44  public:
45  CreateServerDialog(QWidget* parent = NULL);
46  virtual ~CreateServerDialog();
47 
48  bool commandLineArguments(QString &executable, QStringList &args);
49  void makeRemoteGameSetupDialog(const EnginePlugin *plugin);
50  MapListPanel *mapListPanel();
51  QString mapName() const;
52  void setIwadByName(const QString &iwad);
53 
54  private slots:
55  void btnCommandLineClicked();
56  void btnLoadClicked();
57  void btnPlayOfflineClicked();
58  void btnSaveClicked();
59  void btnStartServerClicked();
60  void firstLoadConfigTimer();
61 
67  void initEngineSpecific(EnginePlugin *engineInfo);
68  void initGamemodeSpecific(const GameMode &gameMode);
69 
70  private:
71  static const QString TEMP_SERVER_CONFIG_FILENAME;
72 
74 
80  void addIwad(const QString& path);
81 
87  bool createHostInfo(GameCreateParams& params, bool offline);
88  void createHostInfoDemoRecord(GameCreateParams& params, bool offline);
89 
90  GameMode currentGameMode() const;
91 
92  bool fillInParamsFromPluginPages(GameCreateParams &params);
93  void initDMFlagsTabs();
94 
100  void initEngineSpecificPages(EnginePlugin* engineInfo);
101 
102  void initInfoAndPassword();
103 
104  void initRules();
105 
106  bool loadConfig(const QString& filename, bool loadingPrevious);
107  void runGame(bool offline);
108  bool saveConfig(const QString& filename);
109 };
110 
111 #endif
Game parametrization data used when creating new games.
Message object used to pass messages throughout the Doomseeker&#39;s system.
Definition: message.h:63
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 Game dialog.