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/configpage.h"
27 #include "dptr.h"
28 
29 class FileAlias;
30 class QTableWidgetItem;
31 
32 class CFGWadAlias : public ConfigPage
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  void showEvent(QShowEvent *event);
48 
49  private:
51 
52  void addAliasToTable(const FileAlias &alias);
53  FileAlias aliasFromRow(int row) const;
54  void applyAliasToRow(int row, const FileAlias &alias);
55  QList<FileAlias> aliases() const;
56  int findRowWithWad(const QString &wadName);
57  void resizeRowsToContents();
58  QTableWidgetItem *toolTipItem(const QString &contents);
59 
60  private slots:
61  void addDefaults();
62  void addNewEntry();
63  void removeSelected();
64 };
65 
66 #endif
QString name() const
Reimplement this to return a list-displayable name for this ConfigPage.
Definition: cfgwadalias.h:41
void readSettings()
Reimplement this to read settings from config into widgets.
void saveSettings()
Reimplement this to write settings to config from widgets.
QIcon icon() const
Reimplement this to return a displayable icon for the ConfigPage.
Base class for configuration pages.
Definition: configpage.h:43