From: Manuel Nickschas Date: Tue, 28 Jul 2009 15:45:28 +0000 (+0200) Subject: Introduce the new ChatViewSettingsPage X-Git-Tag: 0.5-rc1~117 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=5faebde94b5a6be7e0865c9e3ab90cbcb50ad9c3 Introduce the new ChatViewSettingsPage This is supposed to group the ChatView-related settings in once place, including fonts and colors. Oh, and you now also can configure the timestamp format :) We've reduced the number of configurable colors, simply because more fancy stuff can and should be done via stylesheets. Note that the style settings, while stored, are still unbeknownst to the style engine until we start actually generating stylesheets. --- diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 040b14e3..5dacbc2a 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -98,6 +98,7 @@ #include "settingspages/backlogsettingspage.h" #include "settingspages/bufferviewsettingspage.h" #include "settingspages/chatmonitorsettingspage.h" +#include "settingspages/chatviewsettingspage.h" #include "settingspages/connectionsettingspage.h" #include "settingspages/generalsettingspage.h" #include "settingspages/highlightsettingspage.h" @@ -808,6 +809,7 @@ void MainWin::showSettingsDlg() { //Category: Appearance dlg->registerSettingsPage(new AppearanceSettingsPage(dlg)); + dlg->registerSettingsPage(new ChatViewSettingsPage(dlg)); dlg->registerSettingsPage(new HighlightSettingsPage(dlg)); dlg->registerSettingsPage(new NotificationsSettingsPage(dlg)); dlg->registerSettingsPage(new BacklogSettingsPage(dlg)); diff --git a/src/qtui/settingspages/chatviewsettingspage.cpp b/src/qtui/settingspages/chatviewsettingspage.cpp new file mode 100644 index 00000000..82671737 --- /dev/null +++ b/src/qtui/settingspages/chatviewsettingspage.cpp @@ -0,0 +1,31 @@ +/*************************************************************************** + * Copyright (C) 2005-09 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General 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. * + ***************************************************************************/ + +#include "chatviewsettingspage.h" + +#include "colorbutton.h" + +ChatViewSettingsPage::ChatViewSettingsPage(QWidget *parent) + : SettingsPage(tr("Appearance"), tr("Chat View"), parent) +{ + ui.setupUi(this); + + initAutoWidgets(); +} diff --git a/src/qtui/settingspages/chatviewsettingspage.h b/src/qtui/settingspages/chatviewsettingspage.h new file mode 100644 index 00000000..757e0cd5 --- /dev/null +++ b/src/qtui/settingspages/chatviewsettingspage.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2005-09 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General 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. * + ***************************************************************************/ + +#ifndef CHATVIEWSETTINGSPAGE_H_ +#define CHATVIEWSETTINGSPAGE_H_ + +#include "settingspage.h" +#include "ui_chatviewsettingspage.h" + +class ColorButton; + +class ChatViewSettingsPage : public SettingsPage { + Q_OBJECT + + public: + ChatViewSettingsPage(QWidget *parent = 0); + + inline bool hasDefaults() const { return true; } + + private: + Ui::ChatViewSettingsPage ui; + + inline QString settingsKey() const { return QString("QtUi/ChatView/__default__"); } +}; + +#endif diff --git a/src/qtui/settingspages/chatviewsettingspage.ui b/src/qtui/settingspages/chatviewsettingspage.ui new file mode 100644 index 00000000..164b644c --- /dev/null +++ b/src/qtui/settingspages/chatviewsettingspage.ui @@ -0,0 +1,743 @@ + + + ChatViewSettingsPage + + + + 0 + 0 + 486 + 475 + + + + Form + + + + + + + + Timestamp format: + + + + + + + + + + [hh:mm:ss] + + + TimestampFormat + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Chat window font: + + + Font + + + + Monospace + + + + + + + + Allow colored text (mIRC color codes) + + + true + + + true + + + AllowMircColors + + + + + + + Show a website preview window when hovering the mouse over a web address + + + Show previews of webpages on URL hover + + + true + + + true + + + ShowWebPreview + + + + + + + Custom Colors + + + true + + + false + + + Colors/UseChatViewColors + + + false + + + + + + Action: + + + + + + + ... + + + Colors/ActionMsg + + + + 0 + 0 + 255 + + + + + + + + Timestamp: + + + + + + + ... + + + Colors/Timestamp + + + + 112 + 124 + 112 + + + + + + + + Channel message: + + + + + + + ... + + + Colors/ChannelMsg + + + + 0 + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 134 + 20 + + + + + + + + Highlight foreground: + + + + + + + ... + + + Colors/Highlight + + + + 0 + 0 + 0 + + + + + + + + Command message: + + + + + + + ... + + + Colors/CommandMsg + + + + 150 + 0 + 150 + + + + + + + + Highlight background: + + + + + + + Server message: + + + + + + + ... + + + Colors/ServerMsg + + + + 145 + 100 + 9 + + + + + + + + Marker line: + + + + + + + ... + + + Colors/MarkerLine + + + + 255 + 0 + 0 + + + + + + + + Error message: + + + + + + + ... + + + Colors/ErrorMsg + + + + 145 + 100 + 9 + + + + + + + + Background: + + + + + + + ... + + + Colors/ChatViewBackground + + + + 255 + 255 + 255 + + + + + + + + ... + + + Colors/HighlightBackground + + + + 255 + 128 + 0 + + + + + + + + + + + Use Sender Coloring + + + true + + + /Colors/UseSenderColors + + + true + + + + + + + + ... + + + Colors/Sender00 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender02 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender04 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender05 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender06 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender07 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender08 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender09 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender10 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender11 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender12 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender13 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender14 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender15 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender01 + + + + 0 + 0 + 0 + + + + + + + + ... + + + Colors/Sender03 + + + + 0 + 0 + 0 + + + + + + + + + + + + Own messages: + + + + + + + ... + + + /Colors/SenderSelf + + + + 0 + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 19 + + + + + + + + + ColorButton + QToolButton +
colorbutton.h
+
+ + FontSelector + QWidget +
fontselector.h
+ 1 +
+
+ + +
diff --git a/src/qtui/settingspages/settingspages.inc b/src/qtui/settingspages/settingspages.inc index 81ffa5b8..b993cdc3 100644 --- a/src/qtui/settingspages/settingspages.inc +++ b/src/qtui/settingspages/settingspages.inc @@ -1,7 +1,7 @@ # Putting $FOO in SETTINGSPAGES automatically includes # $FOOsettingspage.cpp, $FOOsettingspage.h and $FOOsettingspage.ui -set(SETTINGSPAGES aliases appearance backlog bufferview connection chatmonitor general highlight identities networks) +set(SETTINGSPAGES aliases appearance backlog bufferview chatview connection chatmonitor general highlight identities networks) # Specify additional files (e.g. for subdialogs) here! set(SP_SOURCES aliasesmodel.cpp identityeditwidget.cpp notificationssettingspage.cpp)