- Network Connection state is now reflected in the BufferViews
authorMarcus Eggenberger <egs@quassel-irc.org>
Tue, 29 Jan 2008 17:16:54 +0000 (17:16 +0000)
committerMarcus Eggenberger <egs@quassel-irc.org>
Tue, 29 Jan 2008 17:16:54 +0000 (17:16 +0000)
- InputLine is deactivated when a Buffer is not active (still gets focus though as FocusProxy seem to be quite radical...)

src/client/networkmodel.cpp
src/client/networkmodel.h
src/qtui/inputwidget.cpp
version.inc

index 04ade52..920b2d8 100644 (file)
@@ -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();
index 5326a4b..bc4a17b 100644 (file)
@@ -132,6 +132,8 @@ public slots:
 
   void attachNetwork(Network *network);
   void attachIrcChannel(const QString &channelName);
+
+  void setActive(bool connected);
   
 private:
   NetworkId _networkId;
index c108628..55fc20e 100644 (file)
@@ -69,6 +69,8 @@ void InputWidget::currentChanged(const QModelIndex &current, const QModelIndex &
 
   currentBufferInfo  = current.data(NetworkModel::BufferInfoRole).value<BufferInfo>();
   updateNickSelector();
+
+  ui.inputEdit->setEnabled(current.data(NetworkModel::ItemActiveRole).value<bool>());
 }
 
 const Network *InputWidget::currentNetwork() const {
index 375e5e8..29c85b7 100644 (file)
@@ -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;