summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-08-20 20:22:48 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-08-20 20:27:50 +0200
commit2f1f352342e8e707beabd8d0c180887182e28c9a (patch)
tree073108250d64d5afbc561f6af43a4411d5e8c67a /gui
parent339a30fd1917011d8ad8a3900509f3a8880d569d (diff)
[feat] reset notification
Diffstat (limited to 'gui')
-rw-r--r--gui/backend.go5
-rw-r--r--gui/handlers.cpp5
-rw-r--r--gui/handlers.h1
-rw-r--r--gui/qml/LoginOKDialog.qml3
-rw-r--r--gui/qml/main.qml2
5 files changed, 14 insertions, 2 deletions
diff --git a/gui/backend.go b/gui/backend.go
index c953d18..5fa6134 100644
--- a/gui/backend.go
+++ b/gui/backend.go
@@ -81,6 +81,11 @@ func ResetError(errname string) {
backend.ResetError(errname)
}
+//export ResetNotification
+func ResetNotification(label string) {
+ backend.ResetNotification(label)
+}
+
//export InstallHelpers
func InstallHelpers() {
backend.InstallHelpers()
diff --git a/gui/handlers.cpp b/gui/handlers.cpp
index f34133e..71e5d38 100644
--- a/gui/handlers.cpp
+++ b/gui/handlers.cpp
@@ -52,6 +52,11 @@ void Backend::resetError(QString errlabel)
ResetError(toGoStr(errlabel));
}
+void Backend::resetNotification(QString label)
+{
+ ResetNotification(toGoStr(label));
+}
+
void Backend::quit()
{
Quit();
diff --git a/gui/handlers.h b/gui/handlers.h
index 9299827..e3d0e2a 100644
--- a/gui/handlers.h
+++ b/gui/handlers.h
@@ -40,6 +40,7 @@ public slots:
void donateAccepted();
void login(QString username, QString password);
void resetError(QString errlabel);
+ void resetNotification(QString label);
void quit();
};
diff --git a/gui/qml/LoginOKDialog.qml b/gui/qml/LoginOKDialog.qml
index be023dd..bceda18 100644
--- a/gui/qml/LoginOKDialog.qml
+++ b/gui/qml/LoginOKDialog.qml
@@ -13,7 +13,8 @@ Dialog {
}
function _loginOk() {
- backend.resetError("bad_auth")
+ visible: false;
+ backend.resetNotification("login_ok");
}
visible: false
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index fe69a3b..9f8bea3 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -16,12 +16,12 @@ ApplicationWindow {
target: jsonModel
onDataChanged: {
ctx = JSON.parse(jsonModel.getJson());
+
if (ctx.donateDialog == 'true') {
console.debug(jsonModel.getJson())
donate.visible = true
}
if (ctx.loginDialog == 'true') {
- console.debug(jsonModel.getJson())
login.visible = true
}
if (ctx.loginOk == 'true') {