X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcorehighlightsettingspage.h;h=637c3ba586bb4cb1d1f1acf69b1f19124225be0a;hp=915ea7850083b2be66e8fd34f28ab06a87e29291;hb=12028f7dfb31ebf5694f5dae95bfc31bcde83b43;hpb=7678f2402fdb01b03b359a2266f1e7427894d82a diff --git a/src/qtui/settingspages/corehighlightsettingspage.h b/src/qtui/settingspages/corehighlightsettingspage.h index 915ea785..637c3ba5 100644 --- a/src/qtui/settingspages/corehighlightsettingspage.h +++ b/src/qtui/settingspages/corehighlightsettingspage.h @@ -18,57 +18,71 @@ * 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 { Q_OBJECT public: - CoreHighlightSettingsPage(QWidget *parent = 0); + explicit CoreHighlightSettingsPage(QWidget *parent = nullptr); + + bool hasDefaults() const override; - bool hasDefaults() const; + bool isSelectable() const override; public slots: - void save(); - void load(); - void defaults(); + void save() override; + void load() override; + void defaults() override; void revert(); void clientConnected(); private slots: + void coreConnectionStateChanged(bool state); void widgetHasChanged(); - void addNewRow(QString name = tr("highlight rule"), bool regex = false, bool cs = false, bool enable = true, bool inverse = false, QString chanName = "", bool self = false); - void removeSelectedRows(); - void selectRow(QTableWidgetItem *item); - void tableChanged(QTableWidgetItem *item); + void addNewHighlightRow(bool enable = true, 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, + bool cs = false, const QString &sender = "", const QString &chanName = "", bool self = false); + void removeSelectedHighlightRows(); + void removeSelectedIgnoredRows(); + void selectHighlightRow(QTableWidgetItem *item); + void selectIgnoredRow(QTableWidgetItem *item); + void highlightTableChanged(QTableWidgetItem *item); + void ignoredTableChanged(QTableWidgetItem *item); private: Ui::CoreHighlightSettingsPage ui; + HighlightRuleManager::HighlightRuleList highlightList; + HighlightRuleManager::HighlightRuleList ignoredList; + enum column { - NameColumn = 0, - RegExColumn = 1, - CsColumn = 2, - EnableColumn = 3, - InverseColumn = 4, + EnableColumn = 0, + NameColumn = 1, + RegExColumn = 2, + CsColumn = 3, + SenderColumn = 4, ChanColumn = 5, ColumnCount = 6 }; - void emptyTable(); + void emptyHighlightTable(); + void emptyIgnoredTable(); - bool _initialized; -}; + void setupRuleTable(QTableWidget *highlightTable) const; + void importRules(); -#endif + bool _initialized; +};