X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcorehighlightsettingspage.h;h=b229a20758400bb2272ec181fb2e5066104bd9f1;hp=d4682ec1c29fdfdafa43f16dd53b9823fa1658fa;hb=9188f1a4880dc7f4c26612a265c1d874f6df5a8c;hpb=17c39210b1bce04795046657642de66292518fe6 diff --git a/src/qtui/settingspages/corehighlightsettingspage.h b/src/qtui/settingspages/corehighlightsettingspage.h index d4682ec1..b229a207 100644 --- a/src/qtui/settingspages/corehighlightsettingspage.h +++ b/src/qtui/settingspages/corehighlightsettingspage.h @@ -20,8 +20,8 @@ #pragma once -#include #include +#include #include "highlightrulemanager.h" #include "settingspage.h" @@ -33,34 +33,45 @@ class CoreHighlightSettingsPage : public SettingsPage Q_OBJECT public: - explicit CoreHighlightSettingsPage(QWidget *parent = nullptr); + explicit CoreHighlightSettingsPage(QWidget* parent = nullptr); bool hasDefaults() const override; bool isSelectable() const override; public slots: - void save() override; - void load() override; - void defaults() override; + void save() final override; + void load() final override; + void defaults() final override; void revert(); void clientConnected(); private slots: void coreConnectionStateChanged(bool state); void widgetHasChanged(); - 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 = "", + 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, 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, + 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); + 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 * @@ -79,7 +90,8 @@ private: HighlightRuleManager::HighlightRuleList highlightList; HighlightRuleManager::HighlightRuleList ignoredList; - enum column { + enum column + { EnableColumn = 0, NameColumn = 1, RegExColumn = 2, @@ -92,7 +104,45 @@ private: void emptyHighlightTable(); void emptyIgnoredTable(); - void setupRuleTable(QTableWidget *highlightTable) const; + void setupRuleTable(QTableWidget* highlightTable) const; + + /** + * 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 *