diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2567d459..c413f673 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,248 +1,249 @@ include(ECMAddAppIcon) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/config) include_directories(config dcc irc viewer upnp) set(core_SRCS #==================================== #=== Application config/preferences.cpp application.cpp dbus.cpp mainwindow.cpp main.cpp common.cpp sound.cpp ssllabel.cpp statusbar.cpp bookmarkhandler.cpp scriptlauncher.cpp konsolepanel.cpp notificationhandler.cpp awaymanager.cpp connectionmanager.cpp connectionsettings.cpp identity.cpp identitydialog.cpp #=== GUI urlcatcher.cpp queuetuner.cpp quickconnectdialog.cpp ) set (irc_SRCS #== IRC irc/server.cpp irc/query.cpp irc/channel.cpp irc/channellistpanel.cpp irc/channelnick.cpp irc/modebutton.cpp irc/joinchanneldialog.cpp irc/invitedialog.cpp irc/topichistorymodel.cpp irc/irccharsets.cpp irc/nick.cpp irc/nickinfo.cpp irc/nicklistview.cpp irc/nicksonline.cpp irc/nicksonlineitem.cpp #=== Server irc/inputfilter.cpp irc/outputfilter.cpp irc/outputfilterresolvejob.cpp irc/ircqueue.cpp irc/servergroupdialog.cpp irc/servergroupsettings.cpp irc/serverison.cpp irc/serverlistdialog.cpp irc/serverlistview.cpp irc/serversettings.cpp ) ki18n_wrap_ui(irc_SRCS irc/channellistpanelui.ui irc/channeldialogui.ui irc/joinchannelui.ui irc/serverdialogui.ui irc/servergroupdialogui.ui irc/serverlistdialogui.ui irc/invitedialog.ui ) #=== Configuration dialog pages set(config_SRCS config/configdialog.cpp config/settingsdialog.cpp config/alias_config.cpp config/autoreplace_config.cpp config/dcc_config.cpp config/highlight_config.cpp config/ignore_config.cpp config/nicklistbehavior_config.cpp config/osd_config.cpp config/tabs_config.cpp config/theme_config.cpp config/quickbuttons_config.cpp config/warnings_config.cpp config/connectionbehavior_config.cpp + config/colorsappearance_config.cpp ) ki18n_wrap_ui(config_SRCS config/alias_configui.ui config/autoreplace_configui.ui config/chatwindowappearance_config.ui config/chatwindowbehaviour_config.ui config/colorsappearance_config.ui config/connectionbehavior_config.ui config/dcc_configui.ui config/fontappearance_config.ui config/generalbehavior_configui.ui config/highlight_configui.ui config/ignore_configui.ui config/log_config.ui config/nicklistbehavior_configui.ui config/osd_configui.ui config/quickbuttons_configui.ui config/tabnotifications_config.ui config/tabs_configui.ui config/theme_configui.ui config/warnings_configui.ui config/watchednicknames_configui.ui ) #=== Viewer set(viewer_SRCS viewer/ircinput.cpp viewer/ircview.cpp viewer/chatwindow.cpp viewer/rawlog.cpp viewer/statuspanel.cpp viewer/ircviewbox.cpp viewer/viewcontainer.cpp viewer/pasteeditor.cpp viewer/highlight.cpp viewer/highlightviewitem.cpp viewer/ignore.cpp viewer/ignorelistviewitem.cpp viewer/irccolorchooser.cpp viewer/logfilereader.cpp viewer/insertchardialog.cpp viewer/osd.cpp viewer/topiclabel.cpp viewer/awaylabel.cpp viewer/editnotifydialog.cpp viewer/emoticons.cpp viewer/images.cpp viewer/quickbutton.cpp viewer/searchbar.cpp viewer/irccontextmenus.cpp viewer/trayicon.cpp viewer/viewspringloader.cpp viewer/channeloptionsdialog.cpp viewer/topicedit.cpp viewer/topichistoryview.cpp viewer/viewtree.cpp ) ki18n_wrap_ui(viewer_SRCS viewer/channeloptionsui.ui viewer/irccolorchooserui.ui viewer/pasteeditor.ui ) #=== DCC set(dcc_SRCS dcc/chat.cpp dcc/chatcontainer.cpp dcc/dcccommon.cpp dcc/dccfiledialog.cpp dcc/recipientdialog.cpp dcc/resumedialog.cpp dcc/transfer.cpp dcc/transferdetailedinfopanel.cpp dcc/transfermanager.cpp dcc/transferpanel.cpp dcc/transferrecv.cpp dcc/transfersend.cpp dcc/transferlistmodel.cpp dcc/transferview.cpp dcc/whiteboard.cpp dcc/whiteboardcolorchooser.cpp dcc/whiteboardfontchooser.cpp dcc/whiteboardglobals.cpp dcc/whiteboardpaintarea.cpp dcc/whiteboardtoolbar.cpp ) ki18n_wrap_ui(dcc_SRCS dcc/transferdetailedinfopanelui.ui dcc/transferdetailedtimeinfopanelui.ui dcc/whiteboardtoolbarui.ui dcc/whiteboardfontchooserui.ui ) if (Qca-qt5_FOUND) set(cipher_SRCS cipher.cpp) endif (Qca-qt5_FOUND) set(upnp_SRCS upnp/soap.cpp upnp/upnpdescriptionparser.cpp upnp/upnpmcastsocket.cpp upnp/upnprouter.cpp ) set (completed_SRCS ${core_SRCS} ${irc_SRCS} ${viewer_SRCS} ${config_SRCS} ${cipher_SRCS} ${upnp_SRCS} ${dcc_SRCS}) set (konversation_SRCS ${completed_SRCS}) ki18n_wrap_ui(konversation_SRCS identitydialog.ui queuetunerbase.ui viewer/searchbarbase.ui ) kconfig_add_kcfg_files(konversation_SRCS config/preferences_base.kcfgc) # Sets the icon on Windows and OSX file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../data/images/icons/*apps-konversation.png") ecm_add_app_icon(konversation_SRCS ICONS ${ICONS_SRCS}) add_executable(konversation ${konversation_SRCS}) target_link_libraries(konversation Qt5::Widgets KF5::Archive KF5::Bookmarks KF5::ConfigWidgets KF5::Crash KF5::Emoticons KF5::I18n KF5::IdleTime KF5::NotifyConfig KF5::KIOFileWidgets KF5::KIOWidgets KF5::Parts KF5::Solid KF5::Wallet KF5::WidgetsAddons KF5::GlobalAccel KF5::DBusAddons KF5::CoreAddons KF5::Notifications KF5::WindowSystem KF5::IconThemes KF5::ItemViews Phonon::phonon4qt5) if (Qca-qt5_FOUND) target_link_libraries(konversation qca-qt5) endif () install(TARGETS konversation ${INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/src/config/colorsappearance_config.cpp b/src/config/colorsappearance_config.cpp new file mode 100644 index 00000000..ff9e183b --- /dev/null +++ b/src/config/colorsappearance_config.cpp @@ -0,0 +1,161 @@ +#include "colorsappearance_config.h" + +#include +#include +#include +#include +#include +#include + +ColorsAppearance_Config::ColorsAppearance_Config(QWidget *parent, const char *name) : QWidget(parent) +{ + setObjectName(name); + setupUi(this); + + saveThemeButton->setIcon(QIcon::fromTheme("document-save")); + connect(saveThemeButton, &QToolButton::clicked, this, &ColorsAppearance_Config::saveTheme); + + loadThemes(); + connect(themeCombo, SIGNAL(activated(int)), this, SLOT(applyTheme(int))); +} + +void ColorsAppearance_Config::saveTheme() +{ + bool ok = false; + QString themeName = QInputDialog::getText(this, i18n("Save Color Theme"), i18n("Theme name:"), QLineEdit::Normal, QString(), &ok); + + if(ok) + { + QString themePath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/konversation/colorthemes/"); + QSettings colorSettings(themePath + themeName, QSettings::IniFormat); + colorSettings.setValue("KonversationTheme/Name", themeName); + + colorSettings.beginGroup("CustomColors"); + colorSettings.setValue("Action", kcfg_ActionMessageColor->color().name()); + colorSettings.setValue("ChannelMessage", kcfg_ChannelMessageColor->color().name()); + colorSettings.setValue("Hyperlink", kcfg_HyperlinkColor->color().name()); + colorSettings.setValue("ServerMessage", kcfg_ServerMessageColor->color().name()); + colorSettings.setValue("Background", kcfg_TextViewBackgroundColor->color().name()); + colorSettings.setValue("Backlog", kcfg_BacklogMessageColor->color().name()); + colorSettings.setValue("CommandMessage", kcfg_CommandMessageColor->color().name()); + colorSettings.setValue("QueryMessage", kcfg_QueryMessageColor->color().name()); + colorSettings.setValue("Timestamp", kcfg_TimeColor->color().name()); + colorSettings.setValue("AlternateBackground", kcfg_AlternateBackgroundColor->color().name()); + colorSettings.setValue("InputCustomColors", kcfg_InputFieldsBackgroundColor->isChecked()); + colorSettings.endGroup(); + + colorSettings.beginGroup("NickColors"); + colorSettings.setValue("Enabled", kcfg_UseColoredNicks->isChecked()); + colorSettings.setValue("NickColor0", kcfg_NickColor0->color().name()); + colorSettings.setValue("NickColor1", kcfg_NickColor1->color().name()); + colorSettings.setValue("NickColor2", kcfg_NickColor2->color().name()); + colorSettings.setValue("NickColor3", kcfg_NickColor3->color().name()); + colorSettings.setValue("NickColor4", kcfg_NickColor4->color().name()); + colorSettings.setValue("NickColor5", kcfg_NickColor5->color().name()); + colorSettings.setValue("NickColor6", kcfg_NickColor6->color().name()); + colorSettings.setValue("NickColor7", kcfg_NickColor7->color().name()); + colorSettings.setValue("OwnNick", kcfg_NickColor8->color().name()); + colorSettings.endGroup(); + + colorSettings.beginGroup("IrcColors"); + colorSettings.setValue("Enabled", kcfg_AllowColorCodes->isChecked()); + colorSettings.setValue("IRCColor0", kcfg_IrcColorCode0->color().name()); + colorSettings.setValue("IRCColor1", kcfg_IrcColorCode1->color().name()); + colorSettings.setValue("IRCColor2", kcfg_IrcColorCode2->color().name()); + colorSettings.setValue("IRCColor3", kcfg_IrcColorCode3->color().name()); + colorSettings.setValue("IRCColor4", kcfg_IrcColorCode4->color().name()); + colorSettings.setValue("IRCColor5", kcfg_IrcColorCode5->color().name()); + colorSettings.setValue("IRCColor6", kcfg_IrcColorCode6->color().name()); + colorSettings.setValue("IRCColor7", kcfg_IrcColorCode7->color().name()); + colorSettings.setValue("IRCColor8", kcfg_IrcColorCode8->color().name()); + colorSettings.setValue("IRCColor9", kcfg_IrcColorCode9->color().name()); + colorSettings.setValue("IRCColor10", kcfg_IrcColorCode10->color().name()); + colorSettings.setValue("IRCColor11", kcfg_IrcColorCode11->color().name()); + colorSettings.setValue("IRCColor12", kcfg_IrcColorCode12->color().name()); + colorSettings.setValue("IRCColor13", kcfg_IrcColorCode13->color().name()); + colorSettings.setValue("IRCColor14", kcfg_IrcColorCode14->color().name()); + colorSettings.setValue("IRCColor15", kcfg_IrcColorCode15->color().name()); + colorSettings.endGroup(); + } +} + +void ColorsAppearance_Config::loadThemes() +{ + // get list of theme dirs + QStringList paths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "konversation/colorthemes/", QStandardPaths::LocateDirectory); + + foreach(const QString& path, paths) + { + QDir dir(path); + + foreach(const QString& fileName, dir.entryList(QDir::Files)) + { + QFileInfo file(path + fileName); + + if(file.exists()) + { + QSettings theme(file.absoluteFilePath(), QSettings::IniFormat); + QString themeName = theme.value("KonversationTheme/Name").toString(); + + if(!themeName.isEmpty()) + themeCombo->addItem(themeName, file.absoluteFilePath()); + } + } + } +} + +void ColorsAppearance_Config::applyTheme(int index) +{ + if (index < 0) + return; + + QString themePath = themeCombo->itemData(index).toString(); + QSettings colorSettings(themePath, QSettings::IniFormat); + + colorSettings.beginGroup("CustomColors"); + kcfg_ActionMessageColor->setColor(colorSettings.value("Action").toString()); + kcfg_ChannelMessageColor->setColor(colorSettings.value("ChannelMessage").toString()); + kcfg_HyperlinkColor->setColor(colorSettings.value("Hyperlink").toString()); + kcfg_ServerMessageColor->setColor(colorSettings.value("ServerMessage").toString()); + kcfg_TextViewBackgroundColor->setColor(colorSettings.value("Background").toString()); + kcfg_BacklogMessageColor->setColor(colorSettings.value("Backlog").toString()); + kcfg_CommandMessageColor->setColor(colorSettings.value("CommandMessage").toString()); + kcfg_QueryMessageColor->setColor(colorSettings.value("QueryMessage").toString()); + kcfg_TimeColor->setColor(colorSettings.value("Timestamp").toString()); + kcfg_AlternateBackgroundColor->setColor(colorSettings.value("AlternateBackground").toString()); + kcfg_InputFieldsBackgroundColor->setChecked(colorSettings.value("InputCustomColors").toBool()); + colorSettings.endGroup(); + + colorSettings.beginGroup("NickColors"); + kcfg_UseColoredNicks->setChecked(colorSettings.value("Enabled").toBool()); + kcfg_NickColor0->setColor(colorSettings.value("NickColor0").toString()); + kcfg_NickColor1->setColor(colorSettings.value("NickColor1").toString()); + kcfg_NickColor2->setColor(colorSettings.value("NickColor2").toString()); + kcfg_NickColor3->setColor(colorSettings.value("NickColor3").toString()); + kcfg_NickColor4->setColor(colorSettings.value("NickColor4").toString()); + kcfg_NickColor5->setColor(colorSettings.value("NickColor5").toString()); + kcfg_NickColor6->setColor(colorSettings.value("NickColor6").toString()); + kcfg_NickColor7->setColor(colorSettings.value("NickColor7").toString()); + kcfg_NickColor8->setColor(colorSettings.value("OwnNick").toString()); + colorSettings.endGroup(); + + colorSettings.beginGroup("IrcColors"); + kcfg_AllowColorCodes->setChecked(colorSettings.value("Enabled").toBool()); + kcfg_IrcColorCode0->setColor(colorSettings.value("IRCColor0").toString()); + kcfg_IrcColorCode1->setColor(colorSettings.value("IRCColor1").toString()); + kcfg_IrcColorCode2->setColor(colorSettings.value("IRCColor2").toString()); + kcfg_IrcColorCode3->setColor(colorSettings.value("IRCColor3").toString()); + kcfg_IrcColorCode4->setColor(colorSettings.value("IRCColor4").toString()); + kcfg_IrcColorCode5->setColor(colorSettings.value("IRCColor5").toString()); + kcfg_IrcColorCode6->setColor(colorSettings.value("IRCColor6").toString()); + kcfg_IrcColorCode7->setColor(colorSettings.value("IRCColor7").toString()); + kcfg_IrcColorCode8->setColor(colorSettings.value("IRCColor8").toString()); + kcfg_IrcColorCode9->setColor(colorSettings.value("IRCColor9").toString()); + kcfg_IrcColorCode10->setColor(colorSettings.value("IRCColor10").toString()); + kcfg_IrcColorCode11->setColor(colorSettings.value("IRCColor11").toString()); + kcfg_IrcColorCode12->setColor(colorSettings.value("IRCColor12").toString()); + kcfg_IrcColorCode13->setColor(colorSettings.value("IRCColor13").toString()); + kcfg_IrcColorCode14->setColor(colorSettings.value("IRCColor14").toString()); + kcfg_IrcColorCode15->setColor(colorSettings.value("IRCColor15").toString()); + colorSettings.endGroup(); +} diff --git a/src/config/colorsappearance_config.h b/src/config/colorsappearance_config.h new file mode 100644 index 00000000..02487055 --- /dev/null +++ b/src/config/colorsappearance_config.h @@ -0,0 +1,22 @@ +#ifndef COLORSAPPEARANCE_CONFIG_H +#define COLORSAPPEARANCE_CONFIG_H + +#include "ui_colorsappearance_config.h" + +#include + +class ColorsAppearance_Config : public QWidget, private Ui::ColorsAppearance_Config +{ + Q_OBJECT +public: + explicit ColorsAppearance_Config(QWidget *parent, const char *name = 0); + +private slots: + void saveTheme(); + void applyTheme(int index); + +private: + void loadThemes(); +}; + +#endif // COLORSAPPEARANCE_CONFIG_H diff --git a/src/config/colorsappearance_config.ui b/src/config/colorsappearance_config.ui index d0348c29..4b323735 100644 --- a/src/config/colorsappearance_config.ui +++ b/src/config/colorsappearance_config.ui @@ -1,1366 +1,1410 @@ - + + İsmail Dönmez 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) any later version. ColorsAppearance_Config - - + + 0 0 457 558 - - + + 0 - - - - + + 0 + + + 0 + + + 0 + + + + + + 1 + 0 + + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 0 + + + + + + + + Color theme: + + + + + + + Save Color Theme + + + ... + + + + + + + Qt::Horizontal + + + + + + + 0 0 - + Custom Colors - - - - - &Use custom colors for input box, nickname list and tab list + + + + + &Query message: + + + false + + + kcfg_QueryMessageColor - - - - + + + + &Timestamp: + + + false + + + kcfg_TimeColor - - - - + + + + A&lternate background: + + + false + + + kcfg_AlternateBackgroundColor - - - - + + + + Channel &message: + + + false + + + kcfg_ChannelMessageColor - - - - + + + + Actio&n: + + + false + + + kcfg_ActionMessageColor - - - - + + + + Bac&klog: + + + false + + + kcfg_BacklogMessageColor - - - - + + + + Comman&d message: + + + false + + + kcfg_CommandMessageColor - - - - + + + + &Use custom colors for input box, nickname list and tab list - - - + + + - - - + + + - - - + + + - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + + + + + + + + + + + + + + + + + + + + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + + &Background: + + + false + + + kcfg_TextViewBackgroundColor + + + + + + + Ser&ver message: + + + false + + + kcfg_ServerMessageColor + + + + + + + H&yperlink: + + + false + + + kcfg_HyperlinkColor + + + + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 - - - - &Background: - - - false - - - kcfg_TextViewBackgroundColor - - - - - - - &Server message: - - - false - - - kcfg_ServerMessageColor - - - - - - - H&yperlink: - - - false - - - kcfg_HyperlinkColor - - - - - - - Channel &message: - - - false - - - kcfg_ChannelMessageColor - - - - - - - Actio&n: - - - false - - - kcfg_ActionMessageColor - - - - - - - Bac&klog: - - - false - - - kcfg_BacklogMessageColor - - - - - - - Comman&d message: - - - false - - - kcfg_CommandMessageColor + + + + - - - - &Query message: - - - false - - - kcfg_QueryMessageColor + + + + - - - - &Timestamp: - - - false - - - kcfg_TimeColor + + + + - - - - A&lternate background: - - - false - - - kcfg_AlternateBackgroundColor + + + + - - - + + + true - - Colored Nicks + + Co&lored Nicks - + true - - - - - + + + + + 0 0 - + 5: - + false - - - + + + - - - - + + + + 0 0 - + 4: - + false - - - - - - - - - - - + + + + 0 0 - - 3: + + 0: - + false - - - + + + - - - + + + - - - - + + + + 0 0 - - 2: + + 1: - + false - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - + + + + + + Own &nick color: + + + false + + + kcfg_NickColor8 + + + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 271 + 20 + + + + + + + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - - - - - - - - - - 0 - 0 - - - - 0: - - - false - - - - - - - - - - - - - - - 0 - 0 - - - - 1: - - - false - - - - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 40 20 - - - + + + - - - + + + - - - - + + + + 0 0 - + 7: - + false - - - - + + + + 0 0 - + 6: - + false - - - - - - &Own nick color: - - - false - - - kcfg_NickColor8 - - - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 271 - 20 - - - - - + + + + + + + + + + + + 0 + 0 + + + + 3: + + + false + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + + + + 2: + + + false + + - - - + + + true - - By enabling this option, color codes added to IRC messages will be displayed in your chat window as colored text. You can add color codes to your messages, by selecting Insert -> IRC Color + + By enabling this option, color codes added to IRC messages will be displayed in your chat window as colored text. You can add color codes to your messages, by selecting Insert -> IRC Color - - &Allow Colored Text in IRC Messages + + Allow Colored Te&xt in IRC Messages - + true - - - - - + + + + + 0 0 - + 1: - + false - - - - + + + + 0 0 - + 2: - + false - - - - + + + + 0 0 - + 3: - + false - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + 0 0 - + 0: - + false - - - + + + 7: - + false - - - + + + 6: - + false - - - + + + 5: - + false - - - + + + 4: - + false - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + - - - + + + 11: - + false - - - + + + - - - + + + - - - + + + - - - + + + 9: - + false - - - + + + 8: - + false - - - + + + 10: - + false - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + Qt::Horizontal - + QSizePolicy::Expanding - + 50 20 - - - + + + - - - + + + 12: - + false - - - + + + - - - + + + 15: - + false - - - + + + - - - + + + - - - + + + 14: - + false - - - + + + 13: - + false - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 0 - - - - - + KColorButton QPushButton
kcolorbutton.h
kcfg_ActionMessageColor kcfg_ChannelMessageColor kcfg_HyperlinkColor kcfg_ServerMessageColor kcfg_TextViewBackgroundColor kcfg_BacklogMessageColor kcfg_CommandMessageColor kcfg_QueryMessageColor kcfg_TimeColor kcfg_AlternateBackgroundColor kcfg_InputFieldsBackgroundColor kcfg_UseColoredNicks kcfg_NickColor0 kcfg_NickColor1 kcfg_NickColor2 kcfg_NickColor3 kcfg_NickColor4 kcfg_NickColor5 kcfg_NickColor6 kcfg_NickColor7 kcfg_NickColor8 kcfg_AllowColorCodes kcfg_IrcColorCode0 kcfg_IrcColorCode1 kcfg_IrcColorCode2 kcfg_IrcColorCode3 kcfg_IrcColorCode4 kcfg_IrcColorCode5 kcfg_IrcColorCode6 kcfg_IrcColorCode7 kcfg_IrcColorCode8 kcfg_IrcColorCode9 kcfg_IrcColorCode10 kcfg_IrcColorCode11 kcfg_IrcColorCode12 kcfg_IrcColorCode13 kcfg_IrcColorCode14 kcfg_IrcColorCode15 - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h - kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h + kcolorbutton.h kcfg_InputFieldsBackgroundColor toggled(bool) kcfg_AlternateBackgroundColor setEnabled(bool) - + 20 20 - + 20 20
diff --git a/src/config/settingsdialog.cpp b/src/config/settingsdialog.cpp index f2dc2be1..a01f1fbb 100644 --- a/src/config/settingsdialog.cpp +++ b/src/config/settingsdialog.cpp @@ -1,252 +1,250 @@ /* 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) any later version. */ /* Copyright (C) 2006 John Tapsell Copyright (C) 2006 Eike Hein */ #include "settingsdialog.h" #include "preferences.h" #include "ui_chatwindowappearance_config.h" #include "connectionbehavior_config.h" #include "highlight_config.h" #include "warnings_config.h" #include "ui_log_config.h" #include "quickbuttons_config.h" #include "autoreplace_config.h" #include "ui_chatwindowbehaviour_config.h" #include "ui_fontappearance_config.h" #include "nicklistbehavior_config.h" #include "tabs_config.h" -#include "ui_colorsappearance_config.h" +#include "colorsappearance_config.h" #include "ui_generalbehavior_configui.h" #include "dcc_config.h" #include "osd_config.h" #include "theme_config.h" #include "alias_config.h" #include "ignore_config.h" #include "ui_watchednicknames_configui.h" #include "ui_tabnotifications_config.h" #include #include #include #include KonviSettingsDialog::KonviSettingsDialog( QWidget *parent) : ConfigDialog( parent, QLatin1String("settings"), Preferences::self()) { setFaceType(KPageDialog::Tree); m_modified = false; KPageWidgetItem* interfaceGroup = new KPageWidgetItem(new QWidget(this), i18n("Interface")); interfaceGroup->setIcon(QIcon::fromTheme("preferences-desktop-theme")); KPageDialog::addPage(interfaceGroup); KPageWidgetItem* behaviorGroup = new KPageWidgetItem(new QWidget(this), i18n("Behavior")); behaviorGroup->setIcon(QIcon::fromTheme("configure")); KPageDialog::addPage(behaviorGroup); KPageWidgetItem* notificationGroup = new KPageWidgetItem(new QWidget(this), i18n("Notifications")); notificationGroup->setIcon(QIcon::fromTheme("preferences-desktop-notification")); KPageDialog::addPage(notificationGroup); QWidget *w = 0; //Interface/Chat Window Ui::ChatWindowAppearance_Config confChatWindowAppearance; w = new QWidget(); confChatWindowAppearance.setupUi(w); confChatWindowAppearance.kcfg_TimestampFormat->addItem("hh:mm"); confChatWindowAppearance.kcfg_TimestampFormat->addItem("hh:mm:ss"); confChatWindowAppearance.kcfg_TimestampFormat->addItem("h:m ap"); konviAddSubPage(interfaceGroup, w, i18n("Chat Window"), QLatin1String("view-list-text")); //Interface/Themes m_confThemeWdg = new Theme_Config( this, "Theme" ); konviAddSubPage(interfaceGroup, m_confThemeWdg, i18n("Nicklist Themes"), QLatin1String("preferences-desktop-icons")); m_pages.append(m_confThemeWdg); connect(m_confThemeWdg, &Theme_Config::modified, this, &KonviSettingsDialog::modifiedSlot); //Interface/Colors - Ui::ColorsAppearance_Config confColorsAppearance; - w = new QWidget(); - confColorsAppearance.setupUi(w); - konviAddSubPage(interfaceGroup, w, i18n("Colors"), QLatin1String("preferences-desktop-color")); + ColorsAppearance_Config *colorConfig = new ColorsAppearance_Config(this, "Colors"); + konviAddSubPage(interfaceGroup, colorConfig, i18n("Colors"), QLatin1String("preferences-desktop-color")); //Interface/Fonts Ui::FontAppearance_Config confFontAppearance; w = new QWidget(); confFontAppearance.setupUi(w); konviAddSubPage(interfaceGroup, w, i18n("Fonts"), QLatin1String("preferences-desktop-font")); //Interface/Quick Buttons m_confQuickButtonsWdg = new QuickButtons_Config( this, "QuickButtons" ); konviAddSubPage(interfaceGroup, m_confQuickButtonsWdg, i18n("Quick Buttons"), QLatin1String("preferences-desktop-keyboard")); m_pages.append(m_confQuickButtonsWdg); connect(m_confQuickButtonsWdg, &QuickButtons_Config::modified, this, &KonviSettingsDialog::modifiedSlot); //Interface/Tabs m_confTabBarWdg = new Tabs_Config( this, "TabBar" ); konviAddSubPage(interfaceGroup, m_confTabBarWdg, i18n("Tabs"), QLatin1String("tab-new")); //Behavior/General Ui::GeneralBehavior_ConfigUI confGeneralBehavior; w = new QWidget(); confGeneralBehavior.setupUi(w); konviAddSubPage(behaviorGroup, w, i18n("General Behavior"), QLatin1String("configure")); //Behavior/Connection ConnectionBehavior_Config* confConnectionBehavior = new ConnectionBehavior_Config(this); confConnectionBehavior->setObjectName("ConnectionBehavior"); konviAddSubPage(behaviorGroup, confConnectionBehavior, i18n("Connection"), QLatin1String("network-connect")); m_pages.append(confConnectionBehavior); //Behaviour/Chat Window Ui::ChatwindowBehaviour_Config confChatwindowBehaviour; w = new QWidget(); confChatwindowBehaviour.setupUi(w); confChatwindowBehaviour.kcfg_ScrollbackMax->setSuffix(ki18np(" line", " lines")); confChatwindowBehaviour.kcfg_AutoWhoNicksLimit->setSuffix(ki18np(" nick", " nicks")); confChatwindowBehaviour.kcfg_AutoWhoContinuousInterval->setSuffix(ki18np(" second", " seconds")); konviAddSubPage(behaviorGroup, w, i18n("Chat Window"), QLatin1String("view-list-text")); //Behaviour/Nickname List m_confNicklistBehaviorWdg = new NicklistBehavior_Config( this, "NicklistBehavior" ); konviAddSubPage(behaviorGroup, m_confNicklistBehaviorWdg, i18n("Nickname List"), QLatin1String("preferences-contact-list")); connect(m_confNicklistBehaviorWdg, &NicklistBehavior_Config::modified, this, &KonviSettingsDialog::modifiedSlot); m_pages.append(m_confNicklistBehaviorWdg); //Behaviour/Command Aliases m_confAliasWdg = new Alias_Config( this, "Alias" ); konviAddSubPage(behaviorGroup, m_confAliasWdg, i18n("Command Aliases"), QLatin1String("edit-rename")); m_pages.append(m_confAliasWdg); connect(m_confAliasWdg, &Alias_Config::modified, this, &KonviSettingsDialog::modifiedSlot); //Behaviour/Auto Replace m_confAutoreplaceWdg = new Autoreplace_Config( this, "Autoreplace" ); konviAddSubPage(behaviorGroup, m_confAutoreplaceWdg, i18n("Auto Replace"), QLatin1String("edit-rename")); m_pages.append(m_confAutoreplaceWdg); connect(m_confAutoreplaceWdg, &Autoreplace_Config::modified, this, &KonviSettingsDialog::modifiedSlot); //Behaviour/Ignore m_confIgnoreWdg = new Ignore_Config(this, "Ignore"); konviAddSubPage(behaviorGroup, m_confIgnoreWdg, i18nc("@title:tab", "Ignore"), QLatin1String("process-stop")); connect(m_confIgnoreWdg, &Ignore_Config::modified, this, &KonviSettingsDialog::modifiedSlot); m_pages.append(m_confIgnoreWdg); //Behaviour/Logging Ui::Log_Config confLog; w = new QWidget(); confLog.setupUi(w); confLog.kcfg_LogfilePath->setMode(KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly); konviAddSubPage(behaviorGroup, w, i18n("Logging"), QLatin1String("text-plain")); //DCC m_confDCCWdg = new DCC_Config(this, "DCC"); konviAddSubPage(behaviorGroup, m_confDCCWdg, i18nc("@title:tab", "DCC"), QLatin1String("arrow-right-double")); //Notifications/Tab Bar Ui::TabNotifications_Config confTabNotifications; w = new QWidget(); confTabNotifications.setupUi(w); konviAddSubPage(notificationGroup, w, i18n("Tabs"), QLatin1String("tab-new")); //Notification/Highlighting m_confHighlightWdg = new Highlight_Config( this, "Highlight" ); konviAddSubPage(notificationGroup, m_confHighlightWdg, i18n("Highlight"), QLatin1String("flag-red")); connect(m_confHighlightWdg, &Highlight_Config::modified, this, &KonviSettingsDialog::modifiedSlot); m_pages.append(m_confHighlightWdg); //Notification/Watched Nicknames Ui::WatchedNicknames_ConfigUI confWatchedNicks; w = new QWidget(); confWatchedNicks.setupUi(w); konviAddSubPage(notificationGroup, w, i18n("Watched Nicknames"), QLatin1String("edit-find-user")); //Notification/On Screen Display m_confOSDWdg = new OSD_Config( this, "OSD" ); konviAddSubPage(notificationGroup, m_confOSDWdg, i18n("On Screen Display"), QLatin1String("video-display")); //no modified connection needed - it's all kcfg widgets m_pages.append(m_confOSDWdg); //Notification/Warning Dialogs m_confWarningsWdg = new Warnings_Config( this, "Warnings" ); konviAddSubPage(notificationGroup, m_confWarningsWdg, i18n("Warning Dialogs"), QLatin1String("dialog-warning")); m_pages.append(m_confWarningsWdg); connect(m_confWarningsWdg, &Warnings_Config::modified, this, &KonviSettingsDialog::modifiedSlot); } void KonviSettingsDialog::modifiedSlot() { // this is for the non KConfigXT parts to tell us, if the user actually changed // something or went back to the old settings // qDebug(); m_modified = false; foreach (KonviSettingsPage *page, m_pages) { if (page->hasChanged()) { m_modified = true; // qDebug() << "modified!"; break; } } updateButtons(); } KonviSettingsDialog::~KonviSettingsDialog() { } void KonviSettingsDialog::updateSettings() { foreach (KonviSettingsPage *page, m_pages) { // this is for the non KConfigXT parts to update the UI (like quick buttons) page->saveSettings(); } m_modified = false; emit settingsChanged(QLatin1String("settings")); } void KonviSettingsDialog::updateWidgets() { foreach (KonviSettingsPage *page, m_pages) { page->loadSettings(); } m_modified = false; } void KonviSettingsDialog::updateWidgetsDefault() { foreach (KonviSettingsPage *page, m_pages) { page->restorePageToDefaults(); } m_modified = true; } // accessor method - will be used by KonviConfigDialog::updateButtons() bool KonviSettingsDialog::hasChanged() { return m_modified; } // accessor method - will be used by KonviConfigDialog::updateButtons() bool KonviSettingsDialog::isDefault() { return true; }