From ecd7069fd7793588af23758b0ebcff400ffd2fe7 Mon Sep 17 00:00:00 2001
From: "vladislav.cholak" <vlad.hoc10@gmail.com>
Date: Fri, 5 Jul 2019 22:03:18 +0300
Subject: [PATCH] Changed qml libs versions to support linux repository QT
 version

---
 KelvinDashboardGUI/DapQmlScreenAbout.qml             |  2 +-
 KelvinDashboardGUI/DapUiQmlScreenChangeWidget.qml    |  4 ++--
 KelvinDashboardGUI/DapUiQmlScreenDialog.qml          |  4 ++--
 KelvinDashboardGUI/DapUiQmlScreenDialogAddWallet.qml |  2 +-
 KelvinDashboardGUI/DapUiQmlScreenDialogSendToken.qml | 12 +++++++-----
 KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml   |  2 +-
 KelvinDashboardGUI/DapUiQmlWidgetChainWallet.qml     |  7 +++++--
 .../DapUiQmlWidgetChainWalletForm.ui.qml             |  2 +-
 KelvinDashboardGUI/DapUiQmlWidgetDelegate.qml        |  2 +-
 KelvinDashboardGUI/main.qml                          |  2 +-
 10 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/KelvinDashboardGUI/DapQmlScreenAbout.qml b/KelvinDashboardGUI/DapQmlScreenAbout.qml
index da8d3cd29..5e97667eb 100755
--- a/KelvinDashboardGUI/DapQmlScreenAbout.qml
+++ b/KelvinDashboardGUI/DapQmlScreenAbout.qml
@@ -1,5 +1,5 @@
 import QtQuick 2.9
-import QtQml 2.11
+import QtQml 2.3
 import QtQuick.Controls 2.2
 import KelvinDashboard 1.0
 
diff --git a/KelvinDashboardGUI/DapUiQmlScreenChangeWidget.qml b/KelvinDashboardGUI/DapUiQmlScreenChangeWidget.qml
index 4ff8f4e2f..8eed111a0 100755
--- a/KelvinDashboardGUI/DapUiQmlScreenChangeWidget.qml
+++ b/KelvinDashboardGUI/DapUiQmlScreenChangeWidget.qml
@@ -1,7 +1,7 @@
 import QtQuick 2.9
-import QtQml 2.11
+import QtQml 2.3
 import QtQuick.Controls 1.4
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 import QtQuick.Layouts 1.2
 import QtQml.Models 2.2 
 import KelvinDashboard 1.0
diff --git a/KelvinDashboardGUI/DapUiQmlScreenDialog.qml b/KelvinDashboardGUI/DapUiQmlScreenDialog.qml
index 15b1490d1..98b903eb1 100644
--- a/KelvinDashboardGUI/DapUiQmlScreenDialog.qml
+++ b/KelvinDashboardGUI/DapUiQmlScreenDialog.qml
@@ -1,5 +1,5 @@
-import QtQuick 2.11
-import QtQuick.Controls 2.4
+import QtQuick 2.9
+import QtQuick.Controls 2.2
 import KelvinDashboard 1.0
 
 Page {
diff --git a/KelvinDashboardGUI/DapUiQmlScreenDialogAddWallet.qml b/KelvinDashboardGUI/DapUiQmlScreenDialogAddWallet.qml
index 54517ffac..4b0a360de 100644
--- a/KelvinDashboardGUI/DapUiQmlScreenDialogAddWallet.qml
+++ b/KelvinDashboardGUI/DapUiQmlScreenDialogAddWallet.qml
@@ -1,5 +1,5 @@
 import QtQuick 2.9
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 import KelvinDashboard 1.0
 
 Dialog {
diff --git a/KelvinDashboardGUI/DapUiQmlScreenDialogSendToken.qml b/KelvinDashboardGUI/DapUiQmlScreenDialogSendToken.qml
index bd4e547da..960c3f397 100755
--- a/KelvinDashboardGUI/DapUiQmlScreenDialogSendToken.qml
+++ b/KelvinDashboardGUI/DapUiQmlScreenDialogSendToken.qml
@@ -1,6 +1,6 @@
 import QtQuick 2.9
 import QtQuick.Controls 1.4
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 //import QtQuick.Controls 2.5
 import KelvinDashboard 1.0
 
@@ -159,14 +159,16 @@ Dialog {
 
             onClicked:
             {
-                let wallet = listViewWallet.model.get(listViewWallet.currentIndex).name;
-                let token = comboBoxToken.currentText;
-                let amount = textFieldAmount.realValue.toString();
-                let receiver = comboBoxAddressWallet.editText;
+                var wallet = listViewWallet.model.get(listViewWallet.currentIndex).name;
+                var token = comboBoxToken.currentText;
+                var amount = textFieldAmount.realValue.toString();
+                var receiver = comboBoxAddressWallet.editText;
 
                 if (wallet && token && amount && receiver) {
                     console.log("Send " + token + "(" + amount + ") to address " + receiver + " from wallet " + wallet );
                     dapServiceController.sendToken(wallet, receiver, token, amount);
+                    dapChainWalletsModel.clear();
+                    dapServiceController.getWallets();
                 } else {
                     console.log("There's error!");
                     console.log(amount);
diff --git a/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml b/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml
index edc520024..4f6d67ec1 100644
--- a/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml
+++ b/KelvinDashboardGUI/DapUiQmlScreenMainWindow.ui.qml
@@ -1,6 +1,6 @@
 import QtQuick 2.9
 import QtQuick.Controls 1.4
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 
 Page {
     
diff --git a/KelvinDashboardGUI/DapUiQmlWidgetChainWallet.qml b/KelvinDashboardGUI/DapUiQmlWidgetChainWallet.qml
index fda575952..313d385df 100755
--- a/KelvinDashboardGUI/DapUiQmlWidgetChainWallet.qml
+++ b/KelvinDashboardGUI/DapUiQmlWidgetChainWallet.qml
@@ -1,6 +1,6 @@
 import QtQuick 2.9
 import QtQuick.Controls 1.4
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 import QtQuick.Window 2.0
 import QtQuick.Controls.Styles 1.3
 import QtQuick.Controls.Styles 1.4
@@ -45,7 +45,10 @@ DapUiQmlWidgetChainWalletForm {
     }
 
     function updateBalanceText() {
-        let value = listViewTokens.currentIndex > -1 ? listViewWallet.model.get(listViewWallet.currentIndex).balance[listViewTokens.currentIndex] : "";
+        var value = "";
+        if (listViewTokens.currentIndex > -1) {
+            value = listViewWallet.model.get(listViewWallet.currentIndex).balance[listViewTokens.currentIndex];
+        }
         if (value)
             textBalance.text = value.replace(/[^\d.-]/g, '');
         else
diff --git a/KelvinDashboardGUI/DapUiQmlWidgetChainWalletForm.ui.qml b/KelvinDashboardGUI/DapUiQmlWidgetChainWalletForm.ui.qml
index aefc75746..54b51460d 100755
--- a/KelvinDashboardGUI/DapUiQmlWidgetChainWalletForm.ui.qml
+++ b/KelvinDashboardGUI/DapUiQmlWidgetChainWalletForm.ui.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.11
+import QtQuick 2.9
 import QtGraphicalEffects 1.0
 import QtQuick.Controls 2.2
 import QtQuick.Controls.Styles 1.4
diff --git a/KelvinDashboardGUI/DapUiQmlWidgetDelegate.qml b/KelvinDashboardGUI/DapUiQmlWidgetDelegate.qml
index 607a49ad6..d8ccef85e 100644
--- a/KelvinDashboardGUI/DapUiQmlWidgetDelegate.qml
+++ b/KelvinDashboardGUI/DapUiQmlWidgetDelegate.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.4
+import QtQuick 2.2
 
 DapUiQmlWidgetDelegateForm {
 }
diff --git a/KelvinDashboardGUI/main.qml b/KelvinDashboardGUI/main.qml
index 1f58d9190..01c5752c5 100755
--- a/KelvinDashboardGUI/main.qml
+++ b/KelvinDashboardGUI/main.qml
@@ -1,6 +1,6 @@
 import QtQuick 2.9
 import QtQuick.Controls 1.4
-import QtQuick.Controls 2.4
+import QtQuick.Controls 2.2
 import QtQuick.Window 2.0
 import QtQuick.Controls.Styles 1.3
 import QtQuick.Controls.Styles 1.4
-- 
GitLab