separate status buffer item is now only available when the view is restricted to...
authorMarcus Eggenberger <egs@quassel-irc.org>
Mon, 5 Jan 2009 17:50:38 +0000 (18:50 +0100)
committerMarcus Eggenberger <egs@quassel-irc.org>
Mon, 5 Jan 2009 17:50:38 +0000 (18:50 +0100)
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/bufferviewsettingspage.h
src/qtui/settingspages/bufferviewsettingspage.ui
src/uisupport/bufferviewfilter.cpp

index e839292..f0a8230 100644 (file)
@@ -61,6 +61,8 @@ BufferViewSettingsPage::BufferViewSettingsPage(QWidget *parent)
   connect(ui.hideInactiveBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
   connect(ui.networkSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
   connect(ui.minimumActivitySelector, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
+
+  connect(ui.networkSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(enableStatusBuffers(int)));
 }
 
 BufferViewSettingsPage::~BufferViewSettingsPage() {
@@ -279,6 +281,12 @@ void BufferViewSettingsPage::updateBufferView() {
     loadConfig(config);
 }
 
+void BufferViewSettingsPage::enableStatusBuffers(int networkIdx) {
+  // we don't show a status buffer if we show multiple networks as selecting
+  // the network is the same as selecting the status buffer.
+  ui.onlyStatusBuffers->setEnabled(networkIdx != 0);
+}
+
 void BufferViewSettingsPage::on_addBufferView_clicked() {
   if(!Client::bufferViewManager())
     return;
index 66764cb..b684de0 100644 (file)
@@ -50,6 +50,8 @@ private slots:
   void newBufferView(const QString &bufferViewName);
   void updateBufferView();
 
+  void enableStatusBuffers(int networkIdx);
+
   void on_addBufferView_clicked();
   void on_renameBufferView_clicked();
   void on_deleteBufferView_clicked();
index 6bba3c2..a7e5d3d 100644 (file)
         <layout class="QVBoxLayout" >
          <item>
           <widget class="QCheckBox" name="onlyStatusBuffers" >
+           <property name="toolTip" >
+            <string>This option is not available when all Networks are visible.
+In this mode no separate status buffer is displayed.</string>
+           </property>
            <property name="text" >
             <string>Status Buffers</string>
            </property>
index 0cd749a..4d4d47d 100644 (file)
@@ -281,7 +281,10 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex)
   if(config()->networkId().isValid() && config()->networkId() != source_bufferIndex.data(NetworkModel::NetworkIdRole).value<NetworkId>())
     return false;
 
-  if(!(config()->allowedBufferTypes() & (BufferInfo::Type)source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt()))
+  int allowedBufferTypes = config()->allowedBufferTypes();
+  if(!config()->networkId().isValid())
+    allowedBufferTypes &= ~BufferInfo::StatusBuffer;
+  if(!(allowedBufferTypes & source_bufferIndex.data(NetworkModel::BufferTypeRole).toInt()))
     return false;
 
   // the following dynamic filters may not trigger if the buffer is currently selected.