generalgamesetuppanel.h
1 //------------------------------------------------------------------------------
2 // generalgamesetuppanel.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) 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 CreateServerDialog;
31 class EnginePlugin;
32 class GameCreateParams;
33 class GameFileList;
34 class GameMode;
35 class Ini;
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);
48  void loadConfig(Ini &config, bool loadingPrevious);
49  QString mapName() const;
50  void reloadAppConfig();
51  void saveConfig(Ini &config);
52  void setupForEngine(EnginePlugin *engine);
53  void setupForRemoteGame();
54  void setCreateServerDialog(CreateServerDialog *dialog);
55  void setIwadByName(const QString &iwad);
56 
57 signals:
58  void gameModeChanged(const GameMode &gameMode);
59  void pluginChanged(EnginePlugin *plugin);
60 
61 protected:
62  void showEvent(QShowEvent *event);
63 
64 private:
66 
67  GameFileList gameExecutables() const;
68 
69  QString pathToExe();
70 
71  bool setEngine(const QString &engineName);
72  void setupDifficulty(const EnginePlugin *engine);
73 
74 private slots:
75  void onGameModeChanged(int);
76  void updateMapWarningVisibility();
77 };
78 
79 #endif
GameFile collection.
Definition: gamefile.h:145
Game parametrization data used when creating new games.
Dialog window allowing user to create a game.
Game mode representation.
Configuration handler.
Definition: ini.h:69