generalgamesetuppanel.h
1 //------------------------------------------------------------------------------
2 // generalgamesetuppanel.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) 2014 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef idb76a672e_9f54_4dbc_a933_33ea083e8f11
24 #define idb76a672e_9f54_4dbc_a933_33ea083e8f11
25 
26 #include "dptr.h"
27 
28 #include <QWidget>
29 
30 class EnginePlugin;
31 class GameCreateParams;
32 class GameMode;
33 class Ini;
34 class Message;
35 class Server;
36 
37 class GeneralGameSetupPanel : public QWidget
38 {
39 Q_OBJECT
40 
41 public:
42  GeneralGameSetupPanel(QWidget *parent);
44 
45  GameMode currentGameMode() const;
46  EnginePlugin *currentPlugin() const;
47  void fillInParams(GameCreateParams &params, bool offline);
48  void loadConfig(Ini &config, bool loadingPrevious);
49  void saveConfig(Ini &config);
50  void setupForEngine(EnginePlugin *engine);
51  void setupForRemoteGame();
52  void setIwadByName(const QString &iwad);
53 
54 signals:
55  void gameModeChanged(const GameMode &gameMode);
56  void pluginChanged(EnginePlugin *plugin);
57 
58 private:
60 
61  QString pathToExe(bool offline);
62  QString pathToClientExe(Server* server, Message& message);
63  QString pathToOfflineExe(Message& message);
64  QString pathToServerExe(Message& message);
65 
66  bool setEngine(const QString &engineName);
67 
68 private slots:
69  void browseExecutable();
70  void onGameModeChanged(int);
71  void setExecutableToDefault();
72 };
73 
74 #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
Game mode representation.
Configuration handler.
Definition: ini.h:69