Redesign ChatMon settingspage a bit
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 17 Dec 2008 09:08:58 +0000 (10:08 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 19 Dec 2008 09:39:39 +0000 (10:39 +0100)
src/qtui/mainwin.cpp
src/qtui/settingspages/chatmonitorsettingspage.cpp
src/qtui/settingspages/chatmonitorsettingspage.h
src/qtui/settingspages/chatmonitorsettingspage.ui

index 1541a56..51d74d7 100644 (file)
@@ -66,8 +66,8 @@
 #include "settingspages/appearancesettingspage.h"
 #include "settingspages/backlogsettingspage.h"
 #include "settingspages/bufferviewsettingspage.h"
-#include "settingspages/colorsettingspage.h"
 #include "settingspages/chatmonitorsettingspage.h"
+#include "settingspages/colorsettingspage.h"
 #include "settingspages/fontssettingspage.h"
 #include "settingspages/generalsettingspage.h"
 #include "settingspages/highlightsettingspage.h"
index 54b5347..b78c74f 100644 (file)
@@ -3,16 +3,16 @@
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Blank Public License as published by  *
+ *   it under the terms of the GNU Blank Public License as published by    *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU Blank Public License for more details.                          *
+ *   GNU Blank Public License for more details.                            *
  *                                                                         *
- *   You should have received a copy of the GNU Blank Public License     *
+ *   You should have received a copy of the GNU Blank Public License       *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -32,7 +32,7 @@
 #include <QVariant>
 
 ChatMonitorSettingsPage::ChatMonitorSettingsPage(QWidget *parent)
-  : SettingsPage(tr("Behaviour"), tr("ChatMonitor"), parent) {
+  : SettingsPage(tr("General"), tr("Chat Monitor"), parent) {
   ui.setupUi(this);
 
   ui.activateBuffer->setIcon(SmallIcon("go-next"));
@@ -42,8 +42,8 @@ ChatMonitorSettingsPage::ChatMonitorSettingsPage(QWidget *parent)
   configActive = 0;
 
   // fill combobox with operation modes
-  ui.operationMode->addItem("Opt-In", ChatViewSettings::OptIn);
-  ui.operationMode->addItem("Opt-Out", ChatViewSettings::OptOut);
+  ui.operationMode->addItem(tr("Opt In"), ChatViewSettings::OptIn);
+  ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
 
   // connect slots
   connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), this, SLOT(switchOperationMode(int)));
@@ -55,7 +55,7 @@ bool ChatMonitorSettingsPage::hasDefaults() const {
 
 void ChatMonitorSettingsPage::defaults() {
   settings["OperationMode"] = ChatViewSettings::OptOut;
-  settings["HighlightAlways"] = false;
+  settings["ShowHighlights"] = false;
   settings["Buffers"] = QVariant();
   settings["Default"] = true;
   load();
@@ -72,7 +72,7 @@ void ChatMonitorSettingsPage::load() {
     loadSettings();
 
   ui.operationMode->setCurrentIndex(settings["OperationMode"].toInt() - 1);
-  ui.highlightAlways->setChecked(settings["HighlightAlways"].toBool());
+  ui.showHighlights->setChecked(settings["ShowHighlights"].toBool());
 
   // setup available buffers config (for the bufferview on the left)
   configAvailable = new BufferViewConfig(-667);
@@ -117,7 +117,7 @@ void ChatMonitorSettingsPage::loadSettings() {
     switchOperationMode(ui.operationMode->findData(ChatViewSettings::OptOut));
     settings["OperationMode"] == ChatViewSettings::OptOut;
   }
-  settings["HighlightAlways"] = chatViewSettings.value("HighlightAlways", false);
+  settings["ShowHighlights"] = chatViewSettings.value("ShowHighlights", false);
   settings["Buffers"] = chatViewSettings.value("Buffers", QVariantList());
 }
 
@@ -125,10 +125,10 @@ void ChatMonitorSettingsPage::save() {
   ChatViewSettings chatViewSettings("ChatMonitor");
   // save operation mode
   chatViewSettings.setValue("OperationMode", settings["OperationMode"]);
-  chatViewSettings.setValue("HighlightAlways", settings["HighlightAlways"]);
+  chatViewSettings.setValue("ShowHighlights", settings["ShowHighlights"]);
 
   // save list of active buffers
-  QVariantList saveableBufferIdList; 
+  QVariantList saveableBufferIdList;
   foreach(BufferId id, configActive->bufferList()) {
     saveableBufferIdList << QVariant::fromValue<BufferId>(id);
   }
@@ -162,7 +162,7 @@ void ChatMonitorSettingsPage::toggleBuffers(BufferView *inView, BufferViewConfig
   foreach (QModelIndex index, inView->selectionModel()->selectedIndexes()) {
     BufferId inBufferId = index.data(NetworkModel::BufferIdRole).value<BufferId>();
     if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType) {
-      // TODO: 
+      // TODO:
       //  If item is a network: move over all children and skip other selected items of this node
     }
     else if (index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType) {
@@ -210,9 +210,9 @@ void ChatMonitorSettingsPage::on_deactivateBuffer_clicked() {
   }
 }
 
-void ChatMonitorSettingsPage::on_highlightAlways_toggled(bool state)
+void ChatMonitorSettingsPage::on_showHighlights_toggled(bool state)
 {
-  settings["HighlightAlways"] = state;
+  settings["ShowHighlights"] = state;
   widgetHasChanged();
 }
 
@@ -225,7 +225,7 @@ void ChatMonitorSettingsPage::switchOperationMode(int modeIndex) {
 
   if(newMode == ChatViewSettings::OptIn) {
     ui.labelActiveBuffers->setText(tr("Show:"));
-  } 
+  }
   else if(newMode == ChatViewSettings::OptOut) {
     ui.labelActiveBuffers->setText(tr("Ignore:"));
   }
index 9ce8fb9..5ca086f 100644 (file)
@@ -45,9 +45,9 @@ class ChatMonitorSettingsPage : public SettingsPage {
     void widgetHasChanged();
     void on_activateBuffer_clicked();
     void on_deactivateBuffer_clicked();
-    void on_highlightAlways_toggled(bool state);
+    void on_showHighlights_toggled(bool state);
     void switchOperationMode(int modeIndex);
-    
+
   private:
     Ui::ChatMonitorSettingsPage ui;
     QHash<QString, QVariant> settings;
index 999ed2e..bd89270 100644 (file)
@@ -5,29 +5,16 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>672</width>
-    <height>529</height>
+    <width>553</width>
+    <height>444</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_3" >
+  <layout class="QVBoxLayout" name="verticalLayout_4" >
    <item>
-    <layout class="QVBoxLayout" name="verticalLayout_3" >
-     <item>
-      <spacer name="verticalSpacer_4" >
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2" >
      <item>
       <widget class="QLabel" name="label" >
        <property name="text" >
       </widget>
      </item>
      <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_2" >
-       <item>
-        <widget class="QComboBox" name="operationMode" >
-         <property name="toolTip" >
-          <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+      <widget class="QComboBox" name="operationMode" >
+       <property name="toolTip" >
+        <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
 &lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
 p, li { white-space: pre-wrap; }
 &lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
 &lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Operation modes:&lt;/span>&lt;/p>
 &lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;">&lt;span style=" font-weight:400; text-decoration: underline;">Opt-In:&lt;/span> &lt;span style=" font-weight:400;">Only buffers on the right side are shown in chatmonitor&lt;/span>&lt;/p>
 &lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" text-decoration: underline;">Opt-Out:&lt;/span> Buffers on the right side will be ignored in chatmonitor&lt;/p>&lt;/body>&lt;/html></string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="horizontalSpacer_2" >
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0" >
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <widget class="QCheckBox" name="highlightAlways" >
-       <property name="toolTip" >
-        <string>Show highlights in chatmonitor even if the originating buffer is ignored</string>
-       </property>
-       <property name="text" >
-        <string>Highlights always</string>
        </property>
       </widget>
      </item>
      <item>
-      <spacer name="verticalSpacer_3" >
+      <spacer name="horizontalSpacer" >
        <property name="orientation" >
-        <enum>Qt::Vertical</enum>
+        <enum>Qt::Horizontal</enum>
        </property>
        <property name="sizeHint" stdset="0" >
         <size>
-         <width>20</width>
-         <height>338</height>
+         <width>40</width>
+         <height>20</height>
         </size>
        </property>
       </spacer>
@@ -91,99 +51,73 @@ p, li { white-space: pre-wrap; }
     </layout>
    </item>
    <item>
-    <layout class="QVBoxLayout" >
+    <layout class="QHBoxLayout" name="horizontalLayout" >
      <item>
-      <widget class="QLabel" name="labelAvailableBuffers" >
-       <property name="text" >
-        <string>Available Buffers:</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="BufferView" name="availableBuffers" />
-     </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" name="verticalLayout" >
-     <item>
-      <spacer name="verticalSpacer" >
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="deactivateBuffer" >
-       <property name="toolTip" >
-        <string>Move selected buffers to the left</string>
-       </property>
-       <property name="text" >
-        <string/>
-       </property>
-       <property name="icon" >
-        <iconset>
-         <normaloff>:/16x16/actions/oxygen/16x16/actions/go-previous.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-previous.png
-        </iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="activateBuffer" >
-       <property name="toolTip" >
-        <string>Move selected buffers to the right</string>
-       </property>
-       <property name="text" >
-        <string/>
-       </property>
-       <property name="icon" >
-        <iconset>
-         <normaloff>:/16x16/actions/oxygen/16x16/actions/go-next.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-next.png
-        </iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer_2" >
-       <property name="orientation" >
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0" >
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
+      <layout class="QVBoxLayout" name="verticalLayout_3" >
+       <item>
+        <widget class="QLabel" name="labelAvailableBuffers" >
+         <property name="text" >
+          <string>Available Buffers:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="BufferView" name="availableBuffers" />
+       </item>
+      </layout>
      </item>
-    </layout>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" name="verticalLayout_2" >
      <item>
-      <layout class="QHBoxLayout" name="horizontalLayout" >
+      <layout class="QVBoxLayout" name="verticalLayout" >
        <item>
-        <widget class="QLabel" name="labelActiveBuffers" >
+        <spacer name="verticalSpacer" >
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QPushButton" name="deactivateBuffer" >
+         <property name="toolTip" >
+          <string>Move selected buffers to the left</string>
+         </property>
          <property name="text" >
-          <string>Show:</string>
+          <string/>
+         </property>
+         <property name="icon" >
+          <iconset>
+           <normaloff>:/16x16/actions/oxygen/16x16/actions/go-previous.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-previous.png</iconset>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QPushButton" name="activateBuffer" >
+         <property name="toolTip" >
+          <string>Move selected buffers to the right</string>
+         </property>
+         <property name="text" >
+          <string/>
+         </property>
+         <property name="icon" >
+          <iconset>
+           <normaloff>:/16x16/actions/oxygen/16x16/actions/go-next.png</normaloff>:/16x16/actions/oxygen/16x16/actions/go-next.png</iconset>
          </property>
         </widget>
        </item>
        <item>
-        <spacer name="horizontalSpacer" >
+        <spacer name="verticalSpacer_2" >
          <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
+          <enum>Qt::Vertical</enum>
          </property>
          <property name="sizeHint" stdset="0" >
           <size>
-           <width>40</width>
-           <height>20</height>
+           <width>20</width>
+           <height>40</height>
           </size>
          </property>
         </spacer>
@@ -191,10 +125,38 @@ p, li { white-space: pre-wrap; }
       </layout>
      </item>
      <item>
-      <widget class="BufferView" name="activeBuffers" />
+      <layout class="QVBoxLayout" name="verticalLayout_2" >
+       <item>
+        <widget class="QLabel" name="labelActiveBuffers" >
+         <property name="text" >
+          <string>Show:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="BufferView" name="activeBuffers" />
+       </item>
+      </layout>
      </item>
     </layout>
    </item>
+   <item>
+    <widget class="QCheckBox" name="showHighlights" >
+     <property name="toolTip" >
+      <string>Show highlights in chatmonitor even if the originating buffer is ignored</string>
+     </property>
+     <property name="text" >
+      <string>Always show highlighted messages</string>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="showOwnMessages" >
+     <property name="text" >
+      <string>Show own messages</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>
@@ -204,6 +166,6 @@ p, li { white-space: pre-wrap; }
    <header>bufferview.h</header>
   </customwidget>
  </customwidgets>
-<resources/>
+ <resources/>
  <connections/>
 </ui>