From: Manuel Nickschas Date: Wed, 17 Dec 2008 09:08:58 +0000 (+0100) Subject: Redesign ChatMon settingspage a bit X-Git-Tag: 0.4.0~360 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=34b122262eb2ca56832f763f046cf67f1f1e77de Redesign ChatMon settingspage a bit --- diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 1541a567..51d74d78 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -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" diff --git a/src/qtui/settingspages/chatmonitorsettingspage.cpp b/src/qtui/settingspages/chatmonitorsettingspage.cpp index 54b5347d..b78c74f0 100644 --- a/src/qtui/settingspages/chatmonitorsettingspage.cpp +++ b/src/qtui/settingspages/chatmonitorsettingspage.cpp @@ -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 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(id); } @@ -162,7 +162,7 @@ void ChatMonitorSettingsPage::toggleBuffers(BufferView *inView, BufferViewConfig foreach (QModelIndex index, inView->selectionModel()->selectedIndexes()) { BufferId inBufferId = index.data(NetworkModel::BufferIdRole).value(); 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:")); } diff --git a/src/qtui/settingspages/chatmonitorsettingspage.h b/src/qtui/settingspages/chatmonitorsettingspage.h index 9ce8fb9a..5ca086fd 100644 --- a/src/qtui/settingspages/chatmonitorsettingspage.h +++ b/src/qtui/settingspages/chatmonitorsettingspage.h @@ -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 settings; diff --git a/src/qtui/settingspages/chatmonitorsettingspage.ui b/src/qtui/settingspages/chatmonitorsettingspage.ui index 999ed2e9..bd892709 100644 --- a/src/qtui/settingspages/chatmonitorsettingspage.ui +++ b/src/qtui/settingspages/chatmonitorsettingspage.ui @@ -5,29 +5,16 @@ 0 0 - 672 - 529 + 553 + 444 Form - + - - - - - Qt::Vertical - - - - 20 - 40 - - - - + @@ -36,54 +23,27 @@ - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Operation modes:</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;"><span style=" font-weight:400; text-decoration: underline;">Opt-In:</span> <span style=" font-weight:400;">Only buffers on the right side are shown in chatmonitor</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" text-decoration: underline;">Opt-Out:</span> Buffers on the right side will be ignored in chatmonitor</p></body></html> - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Show highlights in chatmonitor even if the originating buffer is ignored - - - Highlights always - + - Qt::Vertical + Qt::Horizontal - 20 - 338 + 40 + 20 @@ -91,99 +51,73 @@ p, li { white-space: pre-wrap; } - + - - - Available Buffers: - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Move selected buffers to the left - - - - - - - :/16x16/actions/oxygen/16x16/actions/go-previous.png:/16x16/actions/oxygen/16x16/actions/go-previous.png - - - - - - - - Move selected buffers to the right - - - - - - - :/16x16/actions/oxygen/16x16/actions/go-next.png:/16x16/actions/oxygen/16x16/actions/go-next.png - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - + + + + + Available Buffers: + + + + + + + - - - - - + - + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Move selected buffers to the left + - Show: + + + + + :/16x16/actions/oxygen/16x16/actions/go-previous.png:/16x16/actions/oxygen/16x16/actions/go-previous.png + + + + + + + Move selected buffers to the right + + + + + + + :/16x16/actions/oxygen/16x16/actions/go-next.png:/16x16/actions/oxygen/16x16/actions/go-next.png - + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 20 + 40 @@ -191,10 +125,38 @@ p, li { white-space: pre-wrap; } - + + + + + Show: + + + + + + + + + + + Show highlights in chatmonitor even if the originating buffer is ignored + + + Always show highlighted messages + + + + + + + Show own messages + + + @@ -204,6 +166,6 @@ p, li { white-space: pre-wrap; }
bufferview.h
- +