From 5e87b43e783186deb142664dd76433c95942ca1c Mon Sep 17 00:00:00 2001
From: Ming Rui Zhang <mingrui.zhang@savoirfairelinux.com>
Date: Mon, 14 Sep 2020 13:32:03 -0400
Subject: [PATCH] mainview: hide qr code generation button for sip account

Change-Id: I4a63c5d719dfbaf4d4d8b3c276e5cafe749ffcf0
---
 src/mainview/components/AccountComboBox.qml     | 14 ++++++++++----
 src/mainview/components/WelcomePageQrDialog.qml |  3 ++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/mainview/components/AccountComboBox.qml b/src/mainview/components/AccountComboBox.qml
index 494cfa416..127bfd5ce 100644
--- a/src/mainview/components/AccountComboBox.qml
+++ b/src/mainview/components/AccountComboBox.qml
@@ -161,16 +161,19 @@ ComboBox {
         buttonImageHeight: height - 8
         buttonImageWidth: width - 8
         radius: height / 2
+
         width: 24
         height: 24
 
+        visible: AccountAdapter.currentAccountType === Profile.Type.RING
         toolTipText: JamiStrings.displayQRCode
         hoverEnabled: true
 
         source: "qrc:/images/qrcode.png"
         backgroundColor: "white"
         onClicked: {
-            qrDialog.open()
+            if (visible)
+                qrDialog.open()
         }
     }
 
@@ -187,9 +190,12 @@ ComboBox {
         width: 25
         height: 25
 
-        source: !mainViewWindow.inSettingsView ? "qrc:/images/icons/round-settings-24px.svg" :
-                                                 "qrc:/images/icons/round-close-24px.svg"
-        toolTipText: !mainViewWindow.inSettingsView ? JamiStrings.openSettings : JamiStrings.closeSettings
+        source: !mainViewWindow.inSettingsView ?
+                    "qrc:/images/icons/round-settings-24px.svg" :
+                    "qrc:/images/icons/round-close-24px.svg"
+        toolTipText: !mainViewWindow.inSettingsView ?
+                         JamiStrings.openSettings :
+                         JamiStrings.closeSettings
         hoverEnabled: true
 
         backgroundColor: "white"
diff --git a/src/mainview/components/WelcomePageQrDialog.qml b/src/mainview/components/WelcomePageQrDialog.qml
index c2671b46d..9c6bb790b 100644
--- a/src/mainview/components/WelcomePageQrDialog.qml
+++ b/src/mainview/components/WelcomePageQrDialog.qml
@@ -43,7 +43,8 @@ Dialog {
 
         fillMode: Image.PreserveAspectFit
         source: {
-            if (AccountAdapter.currentAccountId)
+            if (AccountAdapter.currentAccountId &&
+                    AccountAdapter.currentAccountType === Profile.Type.RING)
                 return "image://qrImage/account_" + AccountAdapter.currentAccountId
             return ""
         }
-- 
GitLab