From: Marcus Eggenberger Date: Tue, 29 Jan 2008 17:16:54 +0000 (+0000) Subject: - Network Connection state is now reflected in the BufferViews X-Git-Tag: 0.2.0-alpha1~170 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=c48313654848b755982179d1252cc27a8c621b91 - 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...) --- 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;