/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2022 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#pragma once
-#include <QVariantList>
#include <QTableWidgetItem>
+#include <QVariantList>
#include "highlightrulemanager.h"
#include "settingspage.h"
Q_OBJECT
public:
- explicit CoreHighlightSettingsPage(QWidget *parent = nullptr);
+ explicit CoreHighlightSettingsPage(QWidget* parent = nullptr);
bool hasDefaults() const override;
void revert();
void clientConnected();
+signals:
+ /**
+ * Signals the local highlight settings have been changed as part of cleaning up after
+ * importing the rules locally.
+ *
+ * @see CoreHighlightSettingsPage::importRules()
+ */
+ void localHighlightsChanged();
+
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
*
void importRules();
/**
- * Event handler for core unspported Details button
+ * Event handler for core unsupported Details button
*/
void on_coreUnsupportedDetails_clicked();
HighlightRuleManager::HighlightRuleList highlightList;
HighlightRuleManager::HighlightRuleList ignoredList;
- enum column {
+ enum column
+ {
EnableColumn = 0,
NameColumn = 1,
RegExColumn = 2,
void emptyHighlightTable();
void emptyIgnoredTable();
- void setupRuleTable(QTableWidget *highlightTable) const;
+ void setupRuleTable(QTableWidget* highlightTable) const;
/**
* Get tooltip for the specified rule table column
* @param senderWidget Sender name
* @param chanWidget Channel name
*/
- void setupTableTooltips(QWidget *enableWidget, QWidget *nameWidget, QWidget *regExWidget,
- QWidget *csWidget, QWidget *senderWidget, QWidget *chanWidget) const;
+ 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 senderWidget Sender name
* @param chanWidget Channel name
*/
- void setupTableTooltips(QTableWidgetItem *enableWidget, QTableWidgetItem *nameWidget,
- QTableWidgetItem *regExWidget, QTableWidgetItem *csWidget,
- QTableWidgetItem *senderWidget, QTableWidgetItem *chanWidget) const;
+ void setupTableTooltips(QTableWidgetItem* enableWidget,
+ QTableWidgetItem* nameWidget,
+ QTableWidgetItem* regExWidget,
+ QTableWidgetItem* csWidget,
+ QTableWidgetItem* senderWidget,
+ QTableWidgetItem* chanWidget) const;
/** Update the UI to show core support for highlights
*