client: Switch infobar dialog-* icons to emblem-*
[quassel.git] / src / qtui / settingspages / networkssettingspage.cpp
index 57f898f..468f2b5 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2019 by the Quassel Project                        *
+ *   Copyright (C) 2005-2020 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -50,9 +50,6 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget* parent)
         ui.sasl->hide();
     if (!Client::isCoreFeatureEnabled(Quassel::Feature::SaslExternal))
         ui.saslExtInfo->hide();
-#ifndef HAVE_SSL
-    ui.saslExtInfo->hide();
-#endif
 
     // set up icons
     ui.renameNetwork->setIcon(icon::get("edit-rename"));
@@ -70,8 +67,9 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget* parent)
     disconnectedIcon = icon::get("network-disconnect");
 
     // Status icons
-    infoIcon = icon::get("dialog-information");
-    warningIcon = icon::get("dialog-warning");
+    successIcon = icon::get({"emblem-success", "dialog-information"});
+    unavailableIcon = icon::get({"emblem-unavailable", "dialog-warning"});
+    questionIcon = icon::get({"emblem-question", "dialog-question", "dialog-information"});
 
     foreach (int mib, QTextCodec::availableMibs()) {
         QByteArray codec = QTextCodec::codecForMib(mib)->name();
@@ -180,11 +178,9 @@ void NetworksSettingsPage::load()
                                                         "modify message rate limits.")));
     }
 
-#ifdef HAVE_SSL
     // Hide the SASL EXTERNAL notice until a network's shown.  Stops it from showing while loading
     // backlog from the core.
     sslUpdated();
-#endif
 
     // Reset network capability status in case no valid networks get selected (a rare situation)
     resetNetworkCapStates();
@@ -575,7 +571,6 @@ void NetworksSettingsPage::displayNetwork(NetworkId id)
     if (id != 0) {
         NetworkInfo info = networkInfos[id];
 
-#ifdef HAVE_SSL
         // this is only needed when the core supports SASL EXTERNAL
         if (Client::isCoreFeatureEnabled(Quassel::Feature::SaslExternal)) {
             if (_cid) {
@@ -586,7 +581,6 @@ void NetworksSettingsPage::displayNetwork(NetworkId id)
             _cid->enableEditSsl(true);
             connect(_cid, &CertIdentity::sslSettingsUpdated, this, &NetworksSettingsPage::sslUpdated);
         }
-#endif
 
         ui.identityList->setCurrentIndex(ui.identityList->findData(info.identity.toInt()));
         ui.serverList->clear();
@@ -635,12 +629,10 @@ void NetworksSettingsPage::displayNetwork(NetworkId id)
     }
     else {
         // just clear widgets
-#ifdef HAVE_SSL
         if (_cid) {
             disconnect(_cid, &CertIdentity::sslSettingsUpdated, this, &NetworksSettingsPage::sslUpdated);
             delete _cid;
         }
-#endif
         ui.identityList->setCurrentIndex(-1);
         ui.serverList->clear();
         ui.performEdit->clear();
@@ -715,29 +707,28 @@ void NetworksSettingsPage::setSASLStatus(const CapSupportStatus saslStatus)
             // There's no capability negotiation or network doesn't exist.  Don't assume
             // anything.
             ui.saslStatusLabel->setText(QString("<i>%1</i>").arg(tr("Could not check if supported by network")));
-            ui.saslStatusIcon->setPixmap(infoIcon.pixmap(16));
+            ui.saslStatusIcon->setPixmap(questionIcon.pixmap(16));
             break;
         case CapSupportStatus::Disconnected:
             // Disconnected from network, no way to check.
             ui.saslStatusLabel->setText(QString("<i>%1</i>").arg(tr("Cannot check if supported when disconnected")));
-            ui.saslStatusIcon->setPixmap(infoIcon.pixmap(16));
+            ui.saslStatusIcon->setPixmap(questionIcon.pixmap(16));
             break;
         case CapSupportStatus::MaybeUnsupported:
             // The network doesn't advertise support for SASL PLAIN.  Here be dragons.
             ui.saslStatusLabel->setText(QString("<i>%1</i>").arg(tr("Not currently supported by network")));
-            ui.saslStatusIcon->setPixmap(warningIcon.pixmap(16));
+            ui.saslStatusIcon->setPixmap(unavailableIcon.pixmap(16));
             break;
         case CapSupportStatus::MaybeSupported:
             // The network advertises support for SASL PLAIN.  Encourage using it!
             // Unfortunately we don't know for sure if it's desired or functional.
             ui.saslStatusLabel->setText(QString("<i>%1</i>").arg(tr("Supported by network")));
-            ui.saslStatusIcon->setPixmap(infoIcon.pixmap(16));
+            ui.saslStatusIcon->setPixmap(successIcon.pixmap(16));
             break;
         }
     }
 }
 
-#ifdef HAVE_SSL
 void NetworksSettingsPage::sslUpdated()
 {
     if (_cid && !_cid->sslKey().isNull()) {
@@ -760,7 +751,6 @@ void NetworksSettingsPage::sslUpdated()
         ui.saslExtInfo->setHidden(true);
     }
 }
-#endif
 
 /*** Network list ***/