From a6d58bb6052ac8cb01805a48c4ad2f129126116f Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 02:13:59 +0000 Subject: Added KDE3 version of kvirc git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/modules/options/optw_texticons.h | 105 +++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/modules/options/optw_texticons.h (limited to 'src/modules/options/optw_texticons.h') diff --git a/src/modules/options/optw_texticons.h b/src/modules/options/optw_texticons.h new file mode 100644 index 00000000..652c7da9 --- /dev/null +++ b/src/modules/options/optw_texticons.h @@ -0,0 +1,105 @@ +#ifndef _OPTW_TEXTICONS_H_ +#define _OPTW_TEXTICONS_H_ + +// +// File : optw_texticons.h +// Creation date : Fri May 24 2002 00:14:02 CEST by Szymon Stefanek +// +// This file is part of the KVirc irc client distribution +// Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net) +// +// This program is FREE software. You can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your opinion) any later version. +// +// This program is distributed in the HOPE that it will be USEFUL, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, write to the Free Software Foundation, +// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +// + +#include "kvi_optionswidget.h" +#include "kvi_texticonmanager.h" +#define KVI_OPTIONS_WIDGET_ICON_KviTextIconsOptionsWidget KVI_SMALLICON_BIGGRIN +#define KVI_OPTIONS_WIDGET_NAME_KviTextIconsOptionsWidget __tr2qs_no_lookup("Text icons") +#define KVI_OPTIONS_WIDGET_PARENT_KviTextIconsOptionsWidget KviToolsOptionsWidget +#define KVI_OPTIONS_WIDGET_KEYWORDS_KviTextIconsOptionsWidget __tr2qs_no_lookup("smileys,emoticons") + + + +#include +#include "kvi_tal_popupmenu.h" +#include "kvi_tal_hbox.h" + +#ifdef COMPILE_USE_QT4 +#include +#define KviTalTable Q3Table +#define KviTalTableItem Q3TableItem +#else +#include +#define KviTalTable QTable +#define KviTalTableItem QTableItem +#endif + +class KviTextIconTableItem; + +class KviTextIconEditor : public KviTalHBox +{ + Q_OBJECT +public: + KviTextIconEditor(QWidget * par,KviTextIcon * icon,KviTextIconTableItem* item); + ~KviTextIconEditor(); +protected: + KviTextIconTableItem *m_pTableItem; + KviTextIcon *m_pIcon; + KviTalPopupMenu *m_pPopup; + QToolButton *m_pIconButton; + QToolButton *m_pBrowseButton; +public: + void updateIcon(); + KviTextIcon* icon() { return m_pIcon; }; +protected slots: + void iconSelected(int); + void doPopup(); + void chooseFromFile(); +}; + +class KviTextIconTableItem : public KviTalTableItem +{ + friend class KviTextIconsOptionsWidget; +public: + KviTextIconTableItem(KviTalTable * t,KviTextIcon * icon); + ~KviTextIconTableItem(); +protected: + KviTextIcon * m_pIcon; +public: + KviTextIcon * icon() { return m_pIcon; }; + void setId(int id); + virtual QWidget * createEditor() const; + virtual void setContentFromEditor(QWidget * w); +}; + +class KviTextIconsOptionsWidget : public KviOptionsWidget +{ + Q_OBJECT +public: + KviTextIconsOptionsWidget(QWidget * parent); + ~KviTextIconsOptionsWidget(); +protected: + KviTalTable * m_pTable; + QPushButton * m_pAdd; + QPushButton * m_pDel; +public: + virtual void commit(); +protected slots: + void selectionChanged(); + void addClicked(); + void delClicked(); +}; + +#endif //!_OPTW_TEXTICONS_H_ -- cgit v1.2.1