X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fcorehighlightsettingspage.cpp;h=8368953ee74b800617d4ab220baab330adc4bc79;hb=806cf7f602f512158a561f098bf69396cabc52db;hp=78805cf3c6a47ac3c263e0f41ec451f973ac6dbd;hpb=d261638f2e30aa47a08f1c3f43372da0c0e8d13f;p=quassel.git diff --git a/src/qtui/settingspages/corehighlightsettingspage.cpp b/src/qtui/settingspages/corehighlightsettingspage.cpp index 78805cf3..8368953e 100644 --- a/src/qtui/settingspages/corehighlightsettingspage.cpp +++ b/src/qtui/settingspages/corehighlightsettingspage.cpp @@ -27,7 +27,11 @@ #include "qtui.h" CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent) - : SettingsPage(tr("Interface"), tr("Remote Highlights"), parent) + : SettingsPage(tr("Interface"), + // In Monolithic mode, local highlights are replaced by remote highlights + Quassel::runMode() == Quassel::Monolithic ? + tr("Highlights") : tr("Remote Highlights"), + parent) { ui.setupUi(this); @@ -87,6 +91,23 @@ CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent) // Warning icon ui.coreUnsupportedIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16)); + + // Set up client/monolithic remote highlights information + if (Quassel::runMode() == Quassel::Monolithic) { + // We're running in Monolithic mode, local highlights are considered legacy + ui.highlightImport->setText(tr("Import Legacy")); + ui.highlightImport->setToolTip(tr("Import highlight rules configured in %1.") + .arg(tr("Legacy Highlights").replace(" ", " "))); + // Re-use translations of "Legacy Highlights" as this is a word-for-word reference, forcing + // all spaces to be non-breaking + } else { + // We're running in client/split mode, local highlights are distinguished from remote + ui.highlightImport->setText(tr("Import Local")); + ui.highlightImport->setToolTip(tr("Import highlight rules configured in %1.") + .arg(tr("Local Highlights").replace(" ", " "))); + // Re-use translations of "Local Highlights" as this is a word-for-word reference, forcing + // all spaces to be non-breaking + } } void CoreHighlightSettingsPage::coreConnectionStateChanged(bool state) @@ -633,28 +654,33 @@ void CoreHighlightSettingsPage::importRules() { const auto localHighlightList = notificationSettings.highlightList(); - // Re-use translations of "Local Highlights" as this is a word-for-word reference, forcing all - // spaces to non-breaking - const QString localHighlightsName = tr("Local Highlights").replace(" ", " "); + // Re-use translations of "Legacy/Local Highlights" as this is a word-for-word reference, + // forcing all spaces to non-breaking + QString localHighlightsName; + if (Quassel::runMode() == Quassel::Monolithic) { + localHighlightsName = tr("Legacy Highlights").replace(" ", " "); + } else { + localHighlightsName = tr("Local Highlights").replace(" ", " "); + } if (localHighlightList.count() == 0) { // No highlight rules exist to import, do nothing QMessageBox::information(this, - tr("No local highlights"), + tr("No highlights to import"), tr("No highlight rules in %1." ).arg(localHighlightsName)); return; } int ret = QMessageBox::question(this, - tr("Import local highlights?"), + tr("Import highlights?"), tr("Import all highlight rules from %1?" ).arg(localHighlightsName), QMessageBox::Yes|QMessageBox::No, QMessageBox::No); - if (ret == QMessageBox::No) { - // Only two options, Yes or No, just return if No + if (ret != QMessageBox::Yes) { + // Only two options, Yes or No, return if not Yes return; } @@ -681,7 +707,7 @@ void CoreHighlightSettingsPage::importRules() { // Give a heads-up that all succeeded QMessageBox::information(this, - tr("Imported local highlights"), + tr("Imported highlights"), tr("%1 highlight rules successfully imported." ).arg(QString::number(localHighlightList.count()))); }