diff options
| author | 2011-01-03 01:40:30 +0000 | |
|---|---|---|
| committer | 2011-01-03 01:40:30 +0000 | |
| commit | c95fb7ebc950f4302837cceac7152a2e2ed498b3 (patch) | |
| tree | 0c1a9b365ca7536f175cb05c6eed9e40e7f1e37a /src/modules/channelsjoin/ChannelsJoinDialog.h | |
| parent | fix for a crash in /exec when the magic parameter is set and the callback is ... (diff) | |
| download | KVIrc-c95fb7ebc950f4302837cceac7152a2e2ed498b3.tar.gz KVIrc-c95fb7ebc950f4302837cceac7152a2e2ed498b3.tar.bz2 KVIrc-c95fb7ebc950f4302837cceac7152a2e2ed498b3.zip | |
Implemented #1022
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5290 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/channelsjoin/ChannelsJoinDialog.h')
| -rw-r--r-- | src/modules/channelsjoin/ChannelsJoinDialog.h | 81 |
1 files changed, 57 insertions, 24 deletions
diff --git a/src/modules/channelsjoin/ChannelsJoinDialog.h b/src/modules/channelsjoin/ChannelsJoinDialog.h index b4b64145e..45914c23a 100644 --- a/src/modules/channelsjoin/ChannelsJoinDialog.h +++ b/src/modules/channelsjoin/ChannelsJoinDialog.h @@ -32,8 +32,9 @@ #include "KviWindow.h" #include "KviCString.h" -#include <QTreeWidget> +#include "KviTalPopupMenu.h" +#include <QTreeWidget> #include <QDialog> class QCheckBox; @@ -43,12 +44,42 @@ class KviConsoleWindow; class KviTalGroupBox; /** +* \class ChannelsJoinDialogTreeWidget +* \brief Channels join window tree widget +*/ +class KVIRC_API ChannelsJoinDialogTreeWidget : public QTreeWidget +{ + Q_OBJECT +public: + ChannelsJoinDialogTreeWidget(QWidget * par) + :QTreeWidget(par), m_pJoinPopup(0) + { + }; + + ~ChannelsJoinDialogTreeWidget() + { + if(m_pJoinPopup) + delete m_pJoinPopup; + }; +protected: + KviTalPopupMenu * m_pJoinPopup; + /** + * \brief Called when the user clicks on the list + * \param e mouse event descriptor + * \return void + */ + virtual void mousePressEvent(QMouseEvent * e); + virtual void mouseDoubleClickEvent(QMouseEvent * e); +}; + +/** * \class ChannelsJoinDialog * \brief Channels join window class */ class ChannelsJoinDialog : public QDialog { Q_OBJECT + friend class ChannelsJoinDialogTreeWidget; public: /** * \brief Constructs the channels join window @@ -62,17 +93,19 @@ public: * \brief Destroys the channels join window */ ~ChannelsJoinDialog(); + protected: - QLineEdit * m_pChannelEdit; - QTreeWidget * m_pTreeWidget; - KviTalGroupBox * m_pGroupBox; - QLineEdit * m_pPass; - QCheckBox * m_pShowAtStartupCheck; - QCheckBox * m_pCloseAfterJoinCheck; - QPushButton * m_pJoinButton; - QPushButton * m_pRegButton; - QPushButton * m_pClearButton; - KviConsoleWindow * m_pConsole; + enum ItemTypes { HeaderItem, RecentChannelItem, RegisteredChannelItem }; + QLineEdit * m_pChannelEdit; + ChannelsJoinDialogTreeWidget * m_pTreeWidget; + KviTalGroupBox * m_pGroupBox; + QLineEdit * m_pPass; + QCheckBox * m_pShowAtStartupCheck; + QCheckBox * m_pCloseAfterJoinCheck; + QPushButton * m_pJoinButton; + QPushButton * m_pRegButton; + QPushButton * m_pClearButton; + KviConsoleWindow * m_pConsole; public: virtual void closeEvent(QCloseEvent * e); @@ -94,26 +127,18 @@ public: * \return void */ void setConsole(KviConsoleWindow * pConsole); -protected slots: - /** - * \brief Called when the text changes - * \return void - */ - void editTextChanged(const QString &); /** - * \brief Called when an item is clicked - * \param it The item clicked + * \brief Called when the user choose an item from the list * \return void */ - void itemClicked(QTreeWidgetItem * it, int); - + void itemSelected(); +protected slots: /** - * \brief Called when an item is double-clicked - * \param it The item clicked + * \brief Called when the text changes * \return void */ - void itemDoubleClicked(QTreeWidgetItem * it, int); + void editTextChanged(const QString &); /** * \brief Called when the return is pressed @@ -140,6 +165,14 @@ protected slots: void joinClicked(); /** + * \brief Called when the delete button is pressed + * + * It deletes the selected channel + * \return void + */ + void deleteClicked(); + + /** * \brief Called when the register button is pressed * * It registers the selected channel in the database |
