-HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
- : SettingsPage(tr("Interface"), tr("Highlight"), parent) {
- ui.setupUi(this);
- ui.highlightTable->verticalHeader()->hide();
- ui.highlightTable->setShowGrid(false);
-
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)->setToolTip("<b>RegEx</b>: This option determines if the highlight rule should be interpreted as a <b>regular expression</b> or just as a keyword.");
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)->setWhatsThis("<b>RegEx</b>: This option determines if the highlight rule should be interpreted as a <b>regular expression</b> or just as a keyword.");
-
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->setToolTip("<b>CS</b>: This option determines if the highlight rule should be interpreted <b>case sensitive</b>.");
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->setWhatsThis("<b>CS</b>: This option determines if the highlight rule should be interpreted <b>case sensitive</b>.");
-
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> in the beginning to negate. Case insensitive.");
- ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> in the beginning to negate. Case insensitive.");
-
- ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
- ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
- ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
- ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
- ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-
- connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow()));
- connect(ui.remove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedRows()));
- //TODO: search for a better signal (one that emits everytime a selection has been changed for one item)
- connect(ui.highlightTable, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(selectRow(QTableWidgetItem *)));
-
- connect(ui.highlightAllNicks, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.highlightCurrentNick, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.highlightNoNick, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.nicksCaseSensitive, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.add, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.remove, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
- connect(ui.highlightTable, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableChanged(QTableWidgetItem *)));
+HighlightSettingsPage::HighlightSettingsPage(QWidget* parent)
+ : SettingsPage(tr("Interface"), tr("Legacy Highlights"),
+ parent)
+{
+ ui.setupUi(this);
+ ui.highlightTable->verticalHeader()->hide();
+ ui.highlightTable->setShowGrid(false);
+
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::EnableColumn)->setToolTip(tr("Enable/disable this rule"));
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::EnableColumn)
+ ->setWhatsThis(ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::EnableColumn)->toolTip());
+
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::NameColumn)->setToolTip(tr("Phrase to match"));
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::NameColumn)
+ ->setWhatsThis(ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::NameColumn)->toolTip());
+
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)
+ ->setToolTip(tr("<b>RegEx</b>: This option determines if the highlight rule and <i>Channel</i> "
+ "should be interpreted as <b>regular expressions</b> or just as keywords."));
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)
+ ->setWhatsThis(ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)->toolTip());
+
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)
+ ->setToolTip(tr("<b>CS</b>: This option determines if the highlight rule and <i>Channel</i> "
+ "should be interpreted <b>case sensitive</b>."));
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)
+ ->setWhatsThis(ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->toolTip());
+
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)
+ ->setToolTip(tr("<p><b>Channel</b>: Semicolon separated list of channel/query names, leave "
+ "blank to match any name.</p>"
+ "<p><i>Example:</i><br />"
+ "<i>#quassel*; #foobar; !#quasseldroid</i><br />"
+ "would match on <i>#foobar</i> and any channel starting with <i>#quassel</i> "
+ "except for <i>#quasseldroid</i><br />"
+ "<p>If only inverted names are specified, it will match anything except for "
+ "what's specified (implicit wildcard).</p>"
+ "<p><i>Example:</i><br />"
+ "<i>!#quassel*; !#foobar</i><br />"
+ "would match anything except for <i>#foobar</i> or any channel starting with "
+ "<i>#quassel</i></p>"));
+ ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)
+ ->setWhatsThis(ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->toolTip());
+
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
+
+ // Information icon
+ ui.localHighlightsIcon->setPixmap(icon::get({"emblem-information", "dialog-information"}).pixmap(16));
+
+ connect(ui.add, &QAbstractButton::clicked, this, [this]() { addNewRow(); });
+ connect(ui.remove, &QAbstractButton::clicked, this, &HighlightSettingsPage::removeSelectedRows);
+ // TODO: search for a better signal (one that emits everytime a selection has been changed for one item)
+ connect(ui.highlightTable, &QTableWidget::itemClicked, this, &HighlightSettingsPage::selectRow);
+
+ connect(ui.highlightAllNicks, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightCurrentNick, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightNoNick, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.nicksCaseSensitive, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.add, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.remove, &QAbstractButton::clicked, this, &HighlightSettingsPage::widgetHasChanged);
+ connect(ui.highlightTable, &QTableWidget::itemChanged, this, &HighlightSettingsPage::tableChanged);