X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelcontroller.h;h=268e783af12f4c3c7f45c73e8813197efe163ccf;hp=459d3873d8f8cbb42488ff172e308f3b0b5de22e;hb=86bd6b1ffb870e65af6d830a2ea16471c348ed5a;hpb=57058eabefe58082635c0ff83bbd4714baa5b6a9 diff --git a/src/uisupport/networkmodelcontroller.h b/src/uisupport/networkmodelcontroller.h index 459d3873..268e783a 100644 --- a/src/uisupport/networkmodelcontroller.h +++ b/src/uisupport/networkmodelcontroller.h @@ -21,10 +21,16 @@ #ifndef NETWORKMODELCONTROLLER_H_ #define NETWORKMODELCONTROLLER_H_ +#include + #include "action.h" #include "actioncollection.h" #include "messagefilter.h" +class QComboBox; +class QDialogButtonBox; +class QLineEdit; + class NetworkModelController : public QObject { Q_OBJECT @@ -38,6 +44,8 @@ public: NetworkMask = 0x0f, NetworkConnect = 0x01, NetworkDisconnect = 0x02, + NetworkConnectAll = 0x03, + NetworkDisconnectAll = 0x04, // Buffer actions BufferMask = 0xf0, @@ -54,6 +62,7 @@ public: HideNick = 0x0400, HideMode = 0x0500, HideDayChange = 0x0600, + HideTopic = 0x0700, HideUseDefaults = 0xe00, HideApplyToAll = 0xf00, @@ -79,6 +88,17 @@ public: NickKick = 0x0c0000, NickBan = 0x0d0000, NickKickBan = 0x0e0000, + NickIgnoreUser = 0x0f0000, + NickIgnoreHost = 0x100000, + NickIgnoreDomain = 0x200000, + NickIgnoreCustom = 0x300000, + // The next 5 types have stay together + // Don't change without reading ContextMenuActionProvider::addIgnoreMenu! + NickIgnoreToggleEnabled0 = 0x400000, + NickIgnoreToggleEnabled1 = 0x500000, + NickIgnoreToggleEnabled2 = 0x600000, + NickIgnoreToggleEnabled3 = 0x700000, + NickIgnoreToggleEnabled4 = 0x800000, // Actions that are handled externally // These emit a signal to the action requester, rather than being handled here @@ -110,8 +130,8 @@ protected: void setContextItem(const QString &); void setSlot(QObject *receiver, const char *method); - void registerAction(ActionType type, const QString &text, bool checkable = false); - void registerAction(ActionType type, const QPixmap &icon, const QString &text, bool checkable = false); + Action * registerAction(ActionType type, const QString &text, bool checkable = false); + Action * registerAction(ActionType type, const QPixmap &icon, const QString &text, bool checkable = false); bool checkRequirements(const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags(ActiveState | InactiveState)); QString nickName(const QModelIndex &index) const; @@ -124,16 +144,19 @@ protected slots: signals: void showChannelList(NetworkId); - void showIgnoreList(NetworkId); + void showIgnoreList(QString); -private: - void handleNetworkAction(ActionType, QAction *); - void handleBufferAction(ActionType, QAction *); - void handleHideAction(ActionType, QAction *); - void handleNickAction(ActionType, QAction *); - void handleGeneralAction(ActionType, QAction *); - void handleExternalAction(ActionType, QAction *); +protected: + virtual void handleNetworkAction(ActionType, QAction *); + virtual void handleBufferAction(ActionType, QAction *); + virtual void handleHideAction(ActionType, QAction *); + virtual void handleNickAction(ActionType, QAction *action); + virtual void handleGeneralAction(ActionType, QAction *); + virtual void handleExternalAction(ActionType, QAction *); + class JoinDlg; + +private: NetworkModel *_model; ActionCollection *_actionCollection; @@ -146,6 +169,26 @@ private: const char *_method; }; +//! Input dialog for joining a channel +class NetworkModelController::JoinDlg : public QDialog { + Q_OBJECT + +public: + JoinDlg(const QModelIndex &index, QWidget *parent = 0); + + QString channelName() const; + NetworkId networkId() const; + +private slots: + void on_channel_textChanged(const QString &); + +private: + QComboBox *networks; + QLineEdit *channel; + QDialogButtonBox *buttonBox; +}; + + // inlines ActionCollection *NetworkModelController::actionCollection() const { return _actionCollection; } Action *NetworkModelController::action(ActionType type) const { return _actionByType.value(type, 0); }