X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fhighlightsettingspage.cpp;h=db5982e9eb76906f389837d158e0184c15f0da2e;hb=b40672ab5c48b577b31371c159e60d330fdd7ce5;hp=6210f6f64f319026c8e3a8b972eef54b1da3e6af;hpb=0eb413175783a04999ce04c5db8a9b9132ea0d8c;p=quassel.git diff --git a/src/qtui/settingspages/highlightsettingspage.cpp b/src/qtui/settingspages/highlightsettingspage.cpp index 6210f6f6..db5982e9 100644 --- a/src/qtui/settingspages/highlightsettingspage.cpp +++ b/src/qtui/settingspages/highlightsettingspage.cpp @@ -20,42 +20,61 @@ #include "highlightsettingspage.h" +#include +#include + #include "client.h" +#include "icon.h" #include "qtui.h" #include "uisettings.h" -#include HighlightSettingsPage::HighlightSettingsPage(QWidget *parent) - : SettingsPage(tr("Interface"), tr("Local Highlights"), parent) + : SettingsPage(tr("Interface"), + // In Monolithic mode, local highlights are replaced by remote highlights + Quassel::runMode() == Quassel::Monolithic ? + tr("Legacy Highlights") : tr("Local 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("RegEx: This option determines if the highlight rule should be " - "interpreted as a regular expression or just as a keyword.")); + tr("RegEx: This option determines if the highlight rule and Channel " + "should be interpreted as regular expressions or just as keywords.")); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)->setWhatsThis( ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::RegExColumn)->toolTip()); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->setToolTip( - tr("CS: This option determines if the highlight rule should be interpreted " - "case sensitive.")); + tr("CS: This option determines if the highlight rule and Channel " + "should be interpreted case sensitive.")); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->setWhatsThis( ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::CsColumn)->toolTip()); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip( - tr("

Channel: Semicolon separated list of channel names.

" + tr("

Channel: Semicolon separated list of channel/query names, leave " + "blank to match any name.

" "

Example:
" "#quassel*; #foobar; !#quasseldroid
" - "would match on #foobar and on any channel starting with #quassel except " - "for #quasseldroid
" + "would match on #foobar and any channel starting with #quassel " + "except for #quasseldroid
" "

If only inverted names are specified, it will match anything except for " "what's specified (implicit wildcard).

" "

Example:
" "!#quassel*; !#foobar
" - "would match anything except for #foobar or any channel starting with " + "would match anything except for #foobar or any channel starting with " "#quassel

")); ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis( ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->toolTip()); @@ -74,6 +93,20 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent) ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents); #endif + // Information icon + ui.localHighlightsIcon->setPixmap(icon::get("dialog-information").pixmap(16)); + + // Set up client/monolithic local highlights information + if (Quassel::runMode() == Quassel::Monolithic) { + // We're running in Monolithic mode, core/client version in total sync. Discourage the use + // of local (legacy) highlights as it's identical to setting remote highlights. + ui.localHighlightsLabel->setText( + tr("Legacy Highlights are replaced by Highlights")); + } else { + // We're running in client/split mode, allow for splitting the details. + ui.localHighlightsLabel->setText(tr("Local Highlights apply to this device only")); + } + 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) @@ -97,7 +130,7 @@ bool HighlightSettingsPage::hasDefaults() const void HighlightSettingsPage::defaults() { - ui.highlightNoNick->setChecked(true); + ui.highlightCurrentNick->setChecked(true); ui.nicksCaseSensitive->setChecked(false); emptyTable(); @@ -137,22 +170,23 @@ void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool en enableItem->setToolTip(tr("Enable/disable this rule")); nameItem->setToolTip(tr("Phrase to match")); regexItem->setToolTip( - tr("RegEx: This option determines if the highlight rule should be " - "interpreted as a regular expression or just as a keyword.")); + tr("RegEx: This option determines if the highlight rule and Channel " + "should be interpreted as regular expressions or just as keywords.")); csItem->setToolTip( - tr("CS: This option determines if the highlight rule should be interpreted " - "case sensitive.")); + tr("CS: This option determines if the highlight rule and Channel " + "should be interpreted case sensitive.")); chanNameItem->setToolTip( - tr("

Channel: Semicolon separated list of channel names.

" + tr("

Channel: Semicolon separated list of channel/query names, leave " + "blank to match any name.

" "

Example:
" "#quassel*; #foobar; !#quasseldroid
" - "would match on #foobar and on any channel starting with #quassel except " - "for #quasseldroid
" + "would match on #foobar and any channel starting with #quassel " + "except for #quasseldroid
" "

If only inverted names are specified, it will match anything except for " "what's specified (implicit wildcard).

" "

Example:
" "!#quassel*; !#foobar
" - "would match anything except for #foobar or any channel starting with " + "would match anything except for #foobar or any channel starting with " "#quassel

")); int lastRow = ui.highlightTable->rowCount()-1; @@ -252,6 +286,38 @@ void HighlightSettingsPage::tableChanged(QTableWidgetItem *item) } +void HighlightSettingsPage::on_localHighlightsDetails_clicked() +{ + // Show information specific to client/monolithic differences + if (Quassel::runMode() == Quassel::Monolithic) { + // We're running in Monolithic mode, core/client version in total sync. Discourage the use + // of local (legacy) highlights as it's identical to setting remote highlights. + QMessageBox::information( + this, + tr("Legacy Highlights vs. Highlights"), + QString("

%1


%2


%3

") + .arg(tr("Legacy Highlights are replaced by Highlights"), + tr("These highlights will keep working for now, but you should move to " + "the improved highlight rules when you can."), + tr("Configure the new style of highlights in " + "%1.").arg(tr("Highlights")))); + } else { + // We're running in client/split mode, allow for splitting the details. + QMessageBox::information( + this, + tr("Local Highlights vs. Remote Highlights"), + QString("

%1


%2


%3

") + .arg(tr("Local Highlights apply to this device only"), + tr("Highlights configured on this page only apply to your current " + "device."), + tr("Configure highlights for all of your devices in " + "%1.").arg(tr("Remote Highlights").replace(" ", " ")))); + // Re-use translations of "Remote Highlights" as this is a word-for-word reference, forcing + // all spaces to be non-breaking + } +} + + void HighlightSettingsPage::load() { NotificationSettings notificationSettings;