cfgwadalias.h
1 //------------------------------------------------------------------------------
2 // cfgwadalias.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 idBE57B8CD_234F_4EEE_AC1B1FAAFB11B1CD
24 #define idBE57B8CD_234F_4EEE_AC1B1FAAFB11B1CD
25 
26 #include "gui/configuration/configurationbasebox.h"
27 #include "dptr.h"
28 
29 class FileAlias;
30 class QTableWidgetItem;
31 
33 {
34  Q_OBJECT
35 
36  public:
37  CFGWadAlias(QWidget *parent=NULL);
38  ~CFGWadAlias();
39 
40  QIcon icon() const;
41  QString name() const { return tr("WAD Aliases"); }
42 
43  void readSettings();
44 
45  protected:
46  void saveSettings();
47 
48  private:
50 
51  void addAliasToTable(const FileAlias &alias);
52  FileAlias aliasFromRow(int row) const;
53  void applyAliasToRow(int row, const FileAlias &alias);
54  QList<FileAlias> aliases() const;
55  int findRowWithWad(const QString &wadName);
56  QTableWidgetItem *toolTipItem(const QString &contents);
57 
58  private slots:
59  void addDefaults();
60  void addNewEntry();
61  void removeSelected();
62 };
63 
64 #endif
QString name() const
Reimplement this to return a list-displayable name for this ConfigurationBaseBox. ...
Definition: cfgwadalias.h:41
void readSettings()
Reimplement this to read settings from config into widgets.
Base class for configuration pages.
void saveSettings()
Reimplement this to write settings to config from widgets.
QIcon icon() const
Reimplement this to return a displayable icon for the ConfigurationBaseBox.