X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fhighlightsettingspage.cpp;h=7a000e9b742a7d3e1dc1fd9f8cfb153eb429f5e1;hp=6210f6f64f319026c8e3a8b972eef54b1da3e6af;hb=95700544764698a7e2a417c3616d9a6ff30a2fd6;hpb=b627af388d570f48a03fd22ab024c07e82e0d503 diff --git a/src/qtui/settingspages/highlightsettingspage.cpp b/src/qtui/settingspages/highlightsettingspage.cpp index 6210f6f6..7a000e9b 100644 --- a/src/qtui/settingspages/highlightsettingspage.cpp +++ b/src/qtui/settingspages/highlightsettingspage.cpp @@ -25,6 +25,7 @@ #include "uisettings.h" #include +#include HighlightSettingsPage::HighlightSettingsPage(QWidget *parent) : SettingsPage(tr("Interface"), tr("Local Highlights"), parent) @@ -74,6 +75,20 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent) ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents); #endif + // Information icon + ui.localHighlightsIcon->setPixmap(QIcon::fromTheme("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 highlights as it's identical to setting remote highlights. + ui.localHighlightsLabel->setText( + tr("Local Highlights are replaced by Remote 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) @@ -252,6 +267,41 @@ void HighlightSettingsPage::tableChanged(QTableWidgetItem *item) } +void HighlightSettingsPage::on_localHighlightsDetails_clicked() +{ + // Re-use translations of "Remote Highlights" as this is a word-for-word reference, forcing all + // spaces to non-breaking + const QString remoteHighlightsName = tr("Remote Highlights").replace(" ", " "); + QString localHighlightsMsgText; + + // 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 highlights as it's identical to setting remote highlights. + localHighlightsMsgText = + QString("

%1


%2


%3

" + ).arg(tr("Local Highlights are replaced by Remote 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(remoteHighlightsName)); + } else { + // We're running in client/split mode, allow for splitting the details. + localHighlightsMsgText = + 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(remoteHighlightsName)); + } + + QMessageBox::information(this, + tr("Local Highlights vs. Remote Highlights"), + localHighlightsMsgText); +} + + void HighlightSettingsPage::load() { NotificationSettings notificationSettings;