KVIrc  4.9.2
DeveloperAPIs
OptionsDialog.h
Go to the documentation of this file.
1 #ifndef _DIALOG_H_
2 #define _DIALOG_H_
3 //=============================================================================
4 //
5 // File : OptionsDialog.h
6 // Created on Fri 10 Feb 2006 18:52:18 by Szymon Stefanek
7 // Based on dlg_options.h: Tue Jun 11 2000 02:39:12 by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC Client distribution
10 // Copyright (C) 2000-2010 Szymon Stefanek <pragma at kvirc dot net>
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "OptionsInstanceManager.h"
29 
30 #include "KviOptionsWidget.h"
31 #include <QTreeWidget>
32 
33 #include <QWidget>
34 #include <QDialog>
35 #include <QStringList>
36 #include <QToolButton>
37 #include <QPainter>
38 
39 class QLabel;
40 class QPushButton;
41 class QLineEdit;
42 class QStackedWidget;
43 
45 {
46  Q_OBJECT
47 public:
48  OptionsDialogFrontWidget(QWidget * parent, const QString & szText);
50 };
51 
52 class OptionsDialogTreeWidgetItem : public QTreeWidgetItem
53 {
54 public:
56  OptionsDialogTreeWidgetItem(QTreeWidgetItem * parent, OptionsWidgetInstanceEntry * e);
58 
59 public:
62 };
63 
64 class OptionsDialog : public QDialog
65 {
66  Q_OBJECT
67 public:
68  OptionsDialog(QWidget * par, const QString & szGroup, bool bModal);
70 
71 private:
72  QTreeWidget * m_pTreeWidget;
73  QLabel * m_pCategoryLabel;
74  QStackedWidget * m_pWidgetStack;
76  QString m_szGroup;
77  QLineEdit * m_pSearchLineEdit;
78  QToolButton * m_pSearchButton;
79 
80 private:
82  void fillTreeWidget(QTreeWidgetItem * p, KviPointerList<OptionsWidgetInstanceEntry> * l, const QString & szGroup, bool bNotContainedOnly = false);
83  //OptionsDialogTreeWidgetItem * showHiddenChildren(QTreeWidgetItem * p,KviPointerList<OptionsWidgetInstanceEntry> * l);
84  //OptionsDialogTreeWidgetItem * findItemByPage(OptionsDialogTreeWidgetItem *it,KviOptionsWidget * pPage);
85 private slots:
86  void treeWidgetItemSelectionChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev);
87  void applyClicked();
88  void okClicked();
89  void cancelClicked();
91  void searchClicked();
92  void searchLineEditTextChanged(const QString &);
93 
94 protected:
95  void apply(bool bDialogAboutToClose);
96  virtual void closeEvent(QCloseEvent * e);
97  virtual void keyPressEvent(QKeyEvent * e);
98  virtual void showEvent(QShowEvent * e);
99  bool recursiveSearch(OptionsDialogTreeWidgetItem * pItem, const QStringList & lKeywords);
100  bool searchInSelectors(KviOptionsWidget * pWidget, const QStringList & lKeywords);
101 
102 public:
103  void search(const QString & szKeywords);
104  void search(const QStringList & lKeywords);
105 };
106 
107 #endif //_DIALOG_H_
OptionsDialog(QWidget *par, const QString &szGroup, bool bModal)
Definition: OptionsDialog.cpp:98
void okClicked()
Definition: OptionsDialog.cpp:608
KviOptionsWidget * m_pOptionsWidget
Definition: OptionsDialog.h:61
QLineEdit * m_pSearchLineEdit
Definition: OptionsDialog.h:77
~OptionsDialog()
Definition: OptionsDialog.cpp:281
#define l
Definition: detector.cpp:76
Definition: OptionsInstanceManager.h:44
QLabel * m_pCategoryLabel
Definition: OptionsDialog.h:73
OptionsDialogTreeWidgetItem(QTreeWidget *parent, OptionsWidgetInstanceEntry *e)
Definition: OptionsDialog.cpp:75
void applyClicked()
Definition: OptionsDialog.cpp:564
Definition: OptionsDialog.h:44
void recursiveCommit(OptionsDialogTreeWidgetItem *it)
Definition: OptionsDialog.cpp:625
Definition: OptionsDialog.h:64
void treeWidgetItemSelectionChanged(QTreeWidgetItem *it, QTreeWidgetItem *prev)
Definition: OptionsDialog.cpp:530
#define e
Definition: detector.cpp:69
Definition: OptionsDialog.h:52
OptionsDialogFrontWidget * m_pFrontWidget
Definition: OptionsDialog.h:75
bool searchInSelectors(KviOptionsWidget *pWidget, const QStringList &lKeywords)
Definition: OptionsDialog.cpp:322
Definition: KviOptionsWidget.h:40
QString m_szGroup
Definition: OptionsDialog.h:76
void searchClicked()
Definition: OptionsDialog.cpp:458
void pageWantsToSwitchToAdvancedPage(KviOptionsWidget *pPage)
Definition: OptionsDialog.cpp:559
QToolButton * m_pSearchButton
Definition: OptionsDialog.h:78
QStackedWidget * m_pWidgetStack
Definition: OptionsDialog.h:74
A template double linked list of pointers.
Definition: KviPointerList.h:55
virtual void closeEvent(QCloseEvent *e)
Definition: OptionsDialog.cpp:619
virtual void showEvent(QShowEvent *e)
Definition: OptionsDialog.cpp:289
void cancelClicked()
Definition: OptionsDialog.cpp:614
void apply(bool bDialogAboutToClose)
Definition: OptionsDialog.cpp:569
void fillTreeWidget(QTreeWidgetItem *p, KviPointerList< OptionsWidgetInstanceEntry > *l, const QString &szGroup, bool bNotContainedOnly=false)
Definition: OptionsDialog.cpp:465
OptionsDialogFrontWidget(QWidget *parent, const QString &szText)
Definition: OptionsDialog.cpp:61
OptionsWidgetInstanceEntry * m_pInstanceEntry
Definition: OptionsDialog.h:60
virtual void keyPressEvent(QKeyEvent *e)
Definition: OptionsDialog.cpp:647
QTreeWidget * m_pTreeWidget
Definition: OptionsDialog.h:72
void searchLineEditTextChanged(const QString &)
Definition: OptionsDialog.cpp:317
void search(const QString &szKeywords)
Definition: OptionsDialog.cpp:452
bool recursiveSearch(OptionsDialogTreeWidgetItem *pItem, const QStringList &lKeywords)
Definition: OptionsDialog.cpp:362
#define p
Definition: detector.cpp:80