X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcorehighlightsettingspage.h;h=0d9150da464bed00d2aeaddb6fa7fd90ef67c249;hb=b40672ab5c48b577b31371c159e60d330fdd7ce5;hp=9ef0bc21c559f95da40f133c5087a1234e94a022;hpb=6a51298c1f18613e9b64ee746e7f846dfcd05290;p=quassel.git diff --git a/src/qtui/settingspages/corehighlightsettingspage.h b/src/qtui/settingspages/corehighlightsettingspage.h index 9ef0bc21..0d9150da 100644 --- a/src/qtui/settingspages/corehighlightsettingspage.h +++ b/src/qtui/settingspages/corehighlightsettingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,16 +18,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _COREHIGHLIGHTSETTINGSPAGE_H_ -#define _COREHIGHLIGHTSETTINGSPAGE_H_ +#pragma once #include #include -#include -#include +#include "highlightrulemanager.h" #include "settingspage.h" -#include "ui_highlightsettingspage.h" + +#include "ui_corehighlightsettingspage.h" class CoreHighlightSettingsPage : public SettingsPage { @@ -38,6 +37,8 @@ public: bool hasDefaults() const override; + bool isSelectable() const override; + public slots: void save() override; void load() override; @@ -46,23 +47,38 @@ public slots: void clientConnected(); private slots: + void coreConnectionStateChanged(bool state); void widgetHasChanged(); - void addNewHighlightRow(bool enable = true, const QString &name = tr("highlight rule"), bool regex = false, + void addNewHighlightRow(bool enable = true, int id = -1, const QString &name = tr("highlight rule"), bool regex = false, bool cs = false, const QString &sender = "", const QString &chanName = "", bool self = false); - void addNewIgnoredRow(bool enable = true, const QString &name = tr("highlight rule"), bool regex = false, + void addNewIgnoredRow(bool enable = true, int id = -1, const QString &name = tr("highlight rule"), bool regex = false, bool cs = false, const QString &sender = "", const QString &chanName = "", bool self = false); void removeSelectedHighlightRows(); void removeSelectedIgnoredRows(); + void highlightNicksChanged(int index); void selectHighlightRow(QTableWidgetItem *item); void selectIgnoredRow(QTableWidgetItem *item); void highlightTableChanged(QTableWidgetItem *item); void ignoredTableChanged(QTableWidgetItem *item); + /** Import local Highlight rules into the Core Highlight rules + * + * Iterates through all local highlight rules, converting each into core-side highlight rules. + */ + void importRules(); + + /** + * Event handler for core unspported Details button + */ + void on_coreUnsupportedDetails_clicked(); + private: Ui::CoreHighlightSettingsPage ui; + HighlightRuleManager::HighlightRuleList highlightList; HighlightRuleManager::HighlightRuleList ignoredList; + enum column { EnableColumn = 0, NameColumn = 1, @@ -78,8 +94,51 @@ private: void setupRuleTable(QTableWidget *highlightTable) const; - bool _initialized; -}; + /** + * Get tooltip for the specified rule table column + * + * @param tableColumn Column to retrieve tooltip + * @return Translated tooltip for the specified column + */ + QString getTableTooltip(column tableColumn) const; + + /** + * Setup tooltips and "What's this?" prompts for table entries + * + * @param enableWidget Enabled checkbox + * @param nameWidget Rule name + * @param regExWidget RegEx enabled + * @param csWidget Case-sensitive + * @param senderWidget Sender name + * @param chanWidget Channel name + */ + void setupTableTooltips(QWidget *enableWidget, QWidget *nameWidget, QWidget *regExWidget, + QWidget *csWidget, QWidget *senderWidget, QWidget *chanWidget) const; + + /** + * Setup tooltips and "What's this?" prompts for table entries + * + * @param enableWidget Enabled checkbox + * @param nameWidget Rule name + * @param regExWidget RegEx enabled + * @param csWidget Case-sensitive + * @param senderWidget Sender name + * @param chanWidget Channel name + */ + void setupTableTooltips(QTableWidgetItem *enableWidget, QTableWidgetItem *nameWidget, + QTableWidgetItem *regExWidget, QTableWidgetItem *csWidget, + QTableWidgetItem *senderWidget, QTableWidgetItem *chanWidget) const; + /** Update the UI to show core support for highlights + * + * Shows or hides the UI warnings around core-side highlights according to core connection and + * core feature support. + * + * @param state True if connected to core, otherwise false + */ + void updateCoreSupportStatus(bool state); -#endif + int nextId(); + + bool _initialized; +};