engineconfigurationbasebox.h
1 //------------------------------------------------------------------------------
2 // engineconfigurationbasebox.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) 2010 "Blzut3" <admin@maniacsvault.net>
22 //------------------------------------------------------------------------------
23 
24 #ifndef __ENGINECONFIGBASE_H__
25 #define __ENGINECONFIGBASE_H__
26 
27 #include "gui/configuration/configurationbasebox.h"
28 #include "dptr.h"
29 
30 class EnginePlugin;
31 class IniSection;
32 class QLineEdit;
33 
49 {
50  Q_OBJECT
51 
52  public:
63  EngineConfigurationBaseBox(const EnginePlugin *plugin, IniSection &cfg, QWidget *parent=NULL);
64  virtual ~EngineConfigurationBaseBox();
65 
66  QIcon icon() const;
67  QString name() const;
68  void readSettings();
72  const EnginePlugin *plugin() const;
73  QString title() const;
74 
75  protected:
79  void addWidget(QWidget *widget);
89  void browseForBinary(QLineEdit *input, const QString &type);
90  void saveSettings();
91 
92  private:
94 
95  QString currentCustomParameters() const;
96  void makeClientOnly();
97  void removeStoredCustomParametersFromConfig(const QString &parameters);
98  void removeStoredCustomParametersFromWidget(const QString &parameters);
99 
100  private slots:
101  void browseForClientBinary();
102  void browseForServerBinary();
103  void removeCurrentCustomParametersFromStorage();
104  void saveCustomParameters();
105  void updateCustomParametersSaveState();
106 };
107 
108 #endif /* __ENGINECONFIGBASE_H__ */
virtual void saveSettings()=0
Reimplement this to write settings to config from widgets.
virtual QString name() const =0
Reimplement this to return a list-displayable name for this ConfigurationBaseBox. ...
Base for configuration pages for plugins; provides some default behavior.
INI section representation.
Definition: inisection.h:40
virtual void readSettings()=0
Reimplement this to read settings from config into widgets.
virtual QIcon icon() const =0
Reimplement this to return a displayable icon for the ConfigurationBaseBox.
virtual QString title() const
Page title, by default returns the same string as name().
Base class for configuration pages.