From ee0d2e6e1967294f4a62da1840b0ffdaa3124a2d Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 19 Feb 2010 18:29:46 +0000 Subject: 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 --- konversation/src/channeloptionsdialog.h | 102 ++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 konversation/src/channeloptionsdialog.h (limited to 'konversation/src/channeloptionsdialog.h') diff --git a/konversation/src/channeloptionsdialog.h b/konversation/src/channeloptionsdialog.h new file mode 100644 index 0000000..b947fee --- /dev/null +++ b/konversation/src/channeloptionsdialog.h @@ -0,0 +1,102 @@ +/* + This program is free software; you can redistribute it and/or modifydvancedModes + 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 option) any later version. +*/ + +/* + copyright: (C) 2004 by Peter Simonsson + email: psn@linux.se +*/ +#ifndef KONVERSATIONCHANNELOPTIONSDIALOG_H +#define KONVERSATIONCHANNELOPTIONSDIALOG_H + +#include "channel.h" + +#include + +#include +#include + + +namespace Konversation +{ + class ChannelOptionsUI; + + class ChannelOptionsDialog : public KDialogBase + { + Q_OBJECT + public: + explicit ChannelOptionsDialog(Channel *channel); + ~ChannelOptionsDialog(); + + QString topic(); + QStringList modes(); + + + public slots: + void refreshTopicHistory(); + void refreshAllowedChannelModes(); + void refreshModes(); + void refreshEnableModes(); + void toggleAdvancedModes(); + + void refreshBanList(); + void addBan(const QString& newban); + void addBanClicked(); + void removeBan(const QString& ban); + void removeBanClicked(); + void banEdited(QListViewItem *edited); + + void changeOptions(); + + + protected slots: + void topicHistoryItemClicked(QListViewItem* item); + void topicBeingEdited(bool state); + + void cancelClicked(); + void okClicked(); + + + protected: + bool m_editingTopic; + QListViewItem *m_NewBan; + + + private: + ChannelOptionsUI* m_widget; + Channel *m_channel; + }; + + + // This is needed to overcome two deficiencies in KListViewItem + // First there is no signal emitted when a rename is canceled + // Second there is no way to get the old value of an item after a rename + class BanListViewItem : public KListViewItem + { + public: + explicit BanListViewItem( QListView *parent ); + BanListViewItem(QListView *parent, bool isNew); + BanListViewItem(QListView *parent, const QString& label1, const QString& label2 = QString(), uint timestamp = 0); + BanListViewItem (QListView *parent, bool isNew, const QString& label1, const QString& label2 = QString(), uint timestamp = 0); + + QString getOldValue() { return m_oldValue; } + QDateTime timestamp() { return m_timestamp; } + + virtual QString text(int column) const; + virtual int compare(QListViewItem *i, int col, bool ascending) const; + virtual void startRename(int col); + + + protected: + virtual void cancelRename(int col); + + QString m_oldValue; + bool m_isNewBan; + QDateTime m_timestamp; + }; + +} +#endif -- cgit v1.2.3