KVIrc  4.9.2
DeveloperAPIs
CustomizeToolBarsDialog.h
Go to the documentation of this file.
1 #ifndef _TOOLBAREDITOR_H_
2 #define _TOOLBAREDITOR_H_
3 //=============================================================================
4 //
5 // File : CustomizeToolBarsDialog.h
6 // Creation date : Wed 01 Dec 2004 14:42:20 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2004-2010 Szymon Stefanek <pragma at kvirc dot net>
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "kvi_settings.h"
28 
29 #include <QWidget>
30 #include <QLabel>
31 #include <QWidget>
32 #include <QDialog>
33 #include <QColor>
34 
35 class QTimer;
36 class QLineEdit;
37 class QPushButton;
38 class QPushButton;
39 class KviActionDrawer;
40 
41 class CustomizeToolBarsDialog : public QWidget
42 {
43  Q_OBJECT
44 protected:
45  CustomizeToolBarsDialog(QWidget * p);
46 
47 public:
49 
50 protected:
53  QPushButton * m_pDeleteToolBarButton;
54  QPushButton * m_pRenameToolBarButton;
55  QPushButton * m_pExportToolBarButton;
56 
57 public:
59  static void display(bool bTopLevel);
60  static void cleanup();
61 
62 protected:
63  virtual void showEvent(QShowEvent * e);
64  virtual void closeEvent(QCloseEvent * e);
65 protected slots:
66  void closeClicked();
67  void newToolBar();
68  void deleteToolBar();
69  void renameToolBar();
70  void exportToolBar();
71  void currentToolBarChanged();
72  virtual void reject();
73 };
74 
75 class CustomToolBarPropertiesDialog : public QDialog
76 {
77  Q_OBJECT
78 public:
79  CustomToolBarPropertiesDialog(QWidget * p, const QString & szText, const QString & szId = QString(), const QString & szLabel = QString(), const QString & szIconId = QString());
81 
82 protected:
83  QString m_szId;
84  QString m_szOriginalId;
85  QString m_szLabel;
86  QString m_szIconId;
87  QWidget * m_pAdvanced;
88  QLineEdit * m_pIdEdit;
89  QLineEdit * m_pLabelEdit;
90  QLineEdit * m_pIconEdit;
91  QPushButton * m_pIconButton;
92  QPushButton * m_pAdvancedButton;
93 
94 public:
95  const QString & id() { return m_szId; };
96  const QString & label() { return m_szLabel; };
97  const QString & iconId() { return m_szIconId; };
98 protected slots:
99  void okClicked();
100  void advancedClicked();
101  void iconButtonClicked();
102  void labelTextChanged(const QString & s);
103 
104 protected:
105  void iconSelected(const QString & szIconId);
106 };
107 
108 class TrashcanLabel : public QLabel
109 {
110  Q_OBJECT
111 public:
112  TrashcanLabel(QWidget * p);
113  virtual ~TrashcanLabel();
114 
115 protected:
116  unsigned int m_uFlashCount;
117  QTimer * m_pFlashTimer;
119 
120 protected:
121  virtual void dragEnterEvent(QDragEnterEvent * e);
122  virtual void dropEvent(QDropEvent * e);
123 public slots:
124  void flash();
125 protected slots:
126  void heartbeat();
127 };
128 
129 #endif
QString m_szIconId
Definition: CustomizeToolBarsDialog.h:86
QPushButton * m_pAdvancedButton
Definition: CustomizeToolBarsDialog.h:92
void iconButtonClicked()
Definition: CustomizeToolBarsDialog.cpp:227
static void display(bool bTopLevel)
Definition: CustomizeToolBarsDialog.cpp:546
static void cleanup()
Definition: CustomizeToolBarsDialog.cpp:538
Definition: CustomizeToolBarsDialog.h:108
CustomizeToolBarsDialog(QWidget *p)
Definition: CustomizeToolBarsDialog.cpp:295
QColor m_clrOriginal
Definition: CustomizeToolBarsDialog.h:118
QString m_szId
Definition: CustomizeToolBarsDialog.h:83
virtual void dropEvent(QDropEvent *e)
Definition: CustomizeToolBarsDialog.cpp:120
void renameToolBar()
Definition: CustomizeToolBarsDialog.cpp:477
static CustomizeToolBarsDialog * instance()
Definition: CustomizeToolBarsDialog.h:58
Definition: CustomizeToolBarsDialog.h:75
QWidget * m_pAdvanced
Definition: CustomizeToolBarsDialog.h:87
CustomToolBarPropertiesDialog(QWidget *p, const QString &szText, const QString &szId=QString(), const QString &szLabel=QString(), const QString &szIconId=QString())
Definition: CustomizeToolBarsDialog.cpp:132
QPushButton * m_pRenameToolBarButton
Definition: CustomizeToolBarsDialog.h:54
void labelTextChanged(const QString &s)
Definition: CustomizeToolBarsDialog.cpp:240
static CustomizeToolBarsDialog * m_pInstance
Definition: CustomizeToolBarsDialog.h:52
QLineEdit * m_pLabelEdit
Definition: CustomizeToolBarsDialog.h:89
void okClicked()
Definition: CustomizeToolBarsDialog.cpp:249
void flash()
Definition: CustomizeToolBarsDialog.cpp:86
unsigned int m_uFlashCount
Definition: CustomizeToolBarsDialog.h:116
#define e
Definition: detector.cpp:69
virtual void showEvent(QShowEvent *e)
Definition: CustomizeToolBarsDialog.cpp:372
QString m_szLabel
Definition: CustomizeToolBarsDialog.h:85
QPushButton * m_pIconButton
Definition: CustomizeToolBarsDialog.h:91
virtual void closeEvent(QCloseEvent *e)
Definition: CustomizeToolBarsDialog.cpp:581
QString m_szOriginalId
Definition: CustomizeToolBarsDialog.h:84
void closeClicked()
Definition: CustomizeToolBarsDialog.cpp:533
Action drawer class.
Definition: KviActionDrawer.h:48
void newToolBar()
Definition: CustomizeToolBarsDialog.cpp:508
~CustomizeToolBarsDialog()
Definition: CustomizeToolBarsDialog.cpp:358
void deleteToolBar()
Definition: CustomizeToolBarsDialog.cpp:380
char s char s s
Definition: KviIrcNumericCodes.h:391
QTimer * m_pFlashTimer
Definition: CustomizeToolBarsDialog.h:117
virtual void reject()
Definition: CustomizeToolBarsDialog.cpp:587
void currentToolBarChanged()
Definition: CustomizeToolBarsDialog.cpp:366
virtual ~TrashcanLabel()
Definition: CustomizeToolBarsDialog.cpp:77
Definition: CustomizeToolBarsDialog.h:41
void heartbeat()
Definition: CustomizeToolBarsDialog.cpp:96
const QString & iconId()
Definition: CustomizeToolBarsDialog.h:97
void advancedClicked()
Definition: CustomizeToolBarsDialog.cpp:281
QLineEdit * m_pIdEdit
Definition: CustomizeToolBarsDialog.h:88
QPushButton * m_pDeleteToolBarButton
Definition: CustomizeToolBarsDialog.h:53
This file contains compile time settings.
KviActionDrawer * m_pDrawer
Definition: CustomizeToolBarsDialog.h:51
QPushButton * m_pExportToolBarButton
Definition: CustomizeToolBarsDialog.h:55
virtual void dragEnterEvent(QDragEnterEvent *e)
Definition: CustomizeToolBarsDialog.cpp:126
TrashcanLabel(QWidget *p)
Definition: CustomizeToolBarsDialog.cpp:61
#define p
Definition: detector.cpp:80
const QString & label()
Definition: CustomizeToolBarsDialog.h:96
const QString & id()
Definition: CustomizeToolBarsDialog.h:95
void iconSelected(const QString &szIconId)
Definition: CustomizeToolBarsDialog.cpp:209
void exportToolBar()
Definition: CustomizeToolBarsDialog.cpp:395
QLineEdit * m_pIconEdit
Definition: CustomizeToolBarsDialog.h:90