From c48313654848b755982179d1252cc27a8c621b91 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Tue, 29 Jan 2008 17:16:54 +0000 Subject: [PATCH 1/1] - Network Connection state is now reflected in the BufferViews - InputLine is deactivated when a Buffer is not active (still gets focus though as FocusProxy seem to be quite radical...) --- src/client/networkmodel.cpp | 13 ++++++++++++- src/client/networkmodel.h | 2 ++ src/qtui/inputwidget.cpp | 2 ++ version.inc | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 04ade524..920b2d8f 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -283,8 +283,16 @@ quint64 NetworkItem::id() const { return _networkId.toInt(); } +void NetworkItem::setActive(bool connected) { + Q_UNUSED(connected); + emit dataChanged(); +} + bool NetworkItem::isActive() const { - return _network; + if(_network) + return _network->isConnected(); + else + return false; } QString NetworkItem::networkName() const { @@ -320,6 +328,9 @@ void NetworkItem::attachNetwork(Network *network) { this, SLOT(setCurrentServer(QString))); connect(network, SIGNAL(ircChannelAdded(QString)), this, SLOT(attachIrcChannel(QString))); + connect(network, SIGNAL(connectedSet(bool)), + this, SLOT(setActive(bool))); + // FIXME: connect this and that... emit dataChanged(); diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index 5326a4b3..bc4a17bc 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -132,6 +132,8 @@ public slots: void attachNetwork(Network *network); void attachIrcChannel(const QString &channelName); + + void setActive(bool connected); private: NetworkId _networkId; diff --git a/src/qtui/inputwidget.cpp b/src/qtui/inputwidget.cpp index c1086287..55fc20ec 100644 --- a/src/qtui/inputwidget.cpp +++ b/src/qtui/inputwidget.cpp @@ -69,6 +69,8 @@ void InputWidget::currentChanged(const QModelIndex ¤t, const QModelIndex & currentBufferInfo = current.data(NetworkModel::BufferInfoRole).value(); updateNickSelector(); + + ui.inputEdit->setEnabled(current.data(NetworkModel::ItemActiveRole).value()); } const Network *InputWidget::currentNetwork() const { diff --git a/version.inc b/version.inc index 375e5e8a..29c85b7b 100644 --- a/version.inc +++ b/version.inc @@ -5,7 +5,7 @@ quasselVersion = "0.2.0-pre"; quasselDate = "2008-01-29"; - quasselBuild = 409; + quasselBuild = 410; //! Minimum client build number the core needs clientBuildNeeded = 358; -- 2.20.1