diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-19 18:29:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-19 18:29:46 +0000 |
commit | ee0d2e6e1967294f4a62da1840b0ffdaa3124a2d (patch) | |
tree | 5c150db3c91a190b4911f19aeec9b1b2163c0c53 /konversation/src/konviconfigdialog.h | |
download | konversation-ee0d2e6e1967294f4a62da1840b0ffdaa3124a2d.tar.gz konversation-ee0d2e6e1967294f4a62da1840b0ffdaa3124a2d.zip |
Added old abandoned KDE3 version of Konversation
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/konversation@1092922 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konversation/src/konviconfigdialog.h')
-rw-r--r-- | konversation/src/konviconfigdialog.h | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/konversation/src/konviconfigdialog.h b/konversation/src/konviconfigdialog.h new file mode 100644 index 0000000..b53262b --- /dev/null +++ b/konversation/src/konviconfigdialog.h @@ -0,0 +1,124 @@ +/* + * This file is part of the KDE libraries + * Copyright (C) 2003 Benjamin C Meyer (ben+kdelibs at meyerhome dot net) + * Copyright (C) 2003 Waldo Bastian <bastian@kde.org> + * Copyright (C) 2004 Michael Brade <brade@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +/* + * KConfigDialog derivative allowing for a multi-level hierarchical TreeList. + * Differences from KConfigDialog: + * - Use QStringList instead of QString for the item name(s) in addPage and + * addPageInternal, thus calling the respective KDialogBase methods which + * allow specifying a path from which the TreeList hierarchy is constructed. + * - Use 16x16 icons in the TreeList. + * - Fill a new int m_lastAddedIndex with the pageIndex() of a new page added + * with addPageInternal, and offer a public interface int lastAddedIndex(). + * See the KConfigDialog reference for detailed documentation. + * + * begin: Nov 22 2005 + * copyright: (C) 2005-2006 by Eike Hein, KConfigDialog developers + * email: hein@kde.org + */ + +#ifndef KONVICONFIGDIALOG_H +#define KONVICONFIGDIALOG_H + +#include <qasciidict.h> + +#include <kdialogbase.h> + + +class KConfig; +class KConfigSkeleton; +class KConfigDialogManager; + +class KonviConfigDialog : public KDialogBase +{ + Q_OBJECT + + signals: + void widgetModified(); + + void settingsChanged(); + + void settingsChanged(const char *dialogName); + + void sigUpdateWidgets(); + + public: + KonviConfigDialog( QWidget *parent, const char *name, + KConfigSkeleton *config, + DialogType dialogType = IconList, + int dialogButtons = Default|Ok|Apply|Cancel|Help, + ButtonCode defaultButton = Ok, + bool modal=false ); + + ~KonviConfigDialog(); + + void addPage( QWidget *page, const QStringList &items, + const QString &pixmapName, + const QString &header=QString(), + bool manage=true ); + + void addPage( QWidget *page, KConfigSkeleton *config, + const QStringList &items, + const QString &pixmapName, + const QString &header=QString() ); + + static KonviConfigDialog* exists( const char* name ); + + static bool showDialog( const char* name ); + + virtual void show(); + + int lastAddedIndex(); + + protected slots: + virtual void updateSettings(); + + virtual void updateWidgets(); + + virtual void updateWidgetsDefault(); + + protected: + virtual bool hasChanged() { return false; } + + virtual bool isDefault() { return true; } + + protected slots: + void updateButtons(); + + void settingsChangedSlot(); + + private: + void addPageInternal(QWidget *page, const QStringList &items, + const QString &pixmapName, const QString &header); + + void setupManagerConnections(KConfigDialogManager *manager); + + private: + static QAsciiDict<KonviConfigDialog> openDialogs; + + class KConfigDialogPrivate; + + KConfigDialogPrivate *d; + + int m_lastAddedIndex; +}; +#endif //KONVICONFIGDIALOG_H |