From 8785d45a86f06a4dafef4d106a945db09b2a9fba Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Wed, 7 Aug 2019 11:20:17 -0400
Subject: [PATCH] linkdevice: provide better debug for possible network errors

Change-Id: Ic2588e20265e20dbd1aaecfa87e68b3bfdb3cb82
---
 linkdevicedialog.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/linkdevicedialog.cpp b/linkdevicedialog.cpp
index 80b5eba..746d732 100644
--- a/linkdevicedialog.cpp
+++ b/linkdevicedialog.cpp
@@ -92,7 +92,7 @@ LinkDeviceDialog::setExportPage(const std::string& accountId, lrc::api::account:
 
     switch (status) {
     case lrc::api::account::ExportOnRingStatus::WRONG_PASSWORD:
-        ui->infoLabel->setStyleSheet("color: red;");
+        ui->infoLabel->setStyleSheet("color: black;");
         ui->infoLabel->setText(tr("Incorrect password"));
         ui->yourPinLabel->hide();
         ui->exportedPIN->hide();
@@ -104,12 +104,18 @@ LinkDeviceDialog::setExportPage(const std::string& accountId, lrc::api::account:
         break;
 
     case lrc::api::account::ExportOnRingStatus::NETWORK_ERROR:
+        disconnect();
+        ui->infoLabel->setStyleSheet("color: black;");
+        ui->infoLabel->setText(tr("Error connecting to the network.\nPlease try again later."));
+        ui->yourPinLabel->hide();
+        ui->exportedPIN->hide();
     case lrc::api::account::ExportOnRingStatus::INVALID:
         disconnect();
-        ui->infoLabel->setStyleSheet("color: red;");
-        ui->infoLabel->setText(tr("Something went wrong.\nPlease try again later."));
+        ui->infoLabel->setStyleSheet("color: black;");
+        ui->infoLabel->setText(tr("Something went wrong.\n"));
         ui->yourPinLabel->hide();
         ui->exportedPIN->hide();
+        break;
     }
 
     ui->stackedWidget->setCurrentWidget(ui->exportedPage);
-- 
GitLab