createserverdialog.h
1 //------------------------------------------------------------------------------
2 // createserverdialog.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; 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, bool offline);
49  void makeRemoteGameSetupDialog(const EnginePlugin *plugin);
50  MapListPanel *mapListPanel();
51  QString mapName() const;
52  void setConfigureButtonVisible(bool visible);
53  void setIwadByName(const QString &iwad);
54 
55  private slots:
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  void showConfiguration();
70  void showHostCommandLine();
71  void showOfflineCommandLine();
72 
73  private:
74  static const QString TEMP_GAME_CONFIG_FILENAME;
75 
77 
83  void addIwad(const QString& path);
84 
90  bool createHostInfo(GameCreateParams& params, bool offline);
91  void createHostInfoDemoRecord(GameCreateParams& params, bool offline);
92 
93  GameMode currentGameMode() const;
94 
95  bool fillInParamsFromPluginPages(GameCreateParams &params);
96  void initDMFlagsTabs();
97 
103  void initEngineSpecificPages(EnginePlugin* engineInfo);
104 
105  void initInfoAndPassword();
106 
107  void initRules();
108 
109  bool loadConfig(const QString& filename, bool loadingPrevious);
110  void runGame(bool offline);
111  bool saveConfig(const QString& filename);
112  void showCommandLine(bool offline);
113 };
114 
115 #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 create a game.
Game mode representation.
Base class to be used by plugins to define custom pages in Create Game dialog.