aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-03-14 05:53:26 +0300
committerlink2xt <link2xt@testrun.org>2021-03-14 05:53:26 +0300
commitea24329f4ce7dafd200aa104c2e532048d5dcd2b (patch)
tree0dc4965195a2b0f1cb432c1ecefef5851217bc98
parent1013f97eb011c0e9189c567307d66d8758b4678d (diff)
downloadkdeltachat-ea24329f4ce7dafd200aa104c2e532048d5dcd2b.tar.gz
kdeltachat-ea24329f4ce7dafd200aa104c2e532048d5dcd2b.zip
ConfigurePage: add progress bar
-rw-r--r--eventemitter.cpp5
-rw-r--r--eventemitter.h1
-rw-r--r--qml/AccountsPage.qml2
-rw-r--r--qml/ConfigurePage.qml12
4 files changed, 19 insertions, 1 deletions
diff --git a/eventemitter.cpp b/eventemitter.cpp
index 61000dc..9e37a3d 100644
--- a/eventemitter.cpp
+++ b/eventemitter.cpp
@@ -83,6 +83,11 @@ DcAccountsEventEmitter::processEvent(DcEvent *event)
case DC_EVENT_MSGS_NOTICED:
emit messagesNoticed(event->getAccountId(), event->getData1Int());
break;
+ case DC_EVENT_CONFIGURE_PROGRESS:
+ emit configureProgress(event->getAccountId(),
+ event->getData1Int(),
+ event->getData2Str());
+ break;
default:
std::cout << "Not processing " << event->getId() << std::endl;
}
diff --git a/eventemitter.h b/eventemitter.h
index b81778b..c65fb29 100644
--- a/eventemitter.h
+++ b/eventemitter.h
@@ -50,6 +50,7 @@ public:
signals:
void chatModified(uint32_t accountId, int chatId);
+ void configureProgress(uint32_t accountId, int progress, QString comment);
void incomingMessage(uint32_t accountId, int chatId, int msgId);
void messagesChanged(uint32_t accountId, int chatId, int msgId);
void messagesNoticed(uint32_t accountId, int chatId);
diff --git a/qml/AccountsPage.qml b/qml/AccountsPage.qml
index ce1df02..7f23776 100644
--- a/qml/AccountsPage.qml
+++ b/qml/AccountsPage.qml
@@ -112,7 +112,7 @@ Kirigami.Page {
if (context.isConfigured()) {
pageStack.replace("qrc:/qml/ChatlistPage.qml", {context: context})
} else {
- pageStack.replace("qrc:/qml/ConfigurePage.qml", {context: context})
+ pageStack.replace("qrc:/qml/ConfigurePage.qml", {context: context, eventEmitter: eventEmitter})
}
pageStack.layers.pop()
}
diff --git a/qml/ConfigurePage.qml b/qml/ConfigurePage.qml
index 58331ed..9fc229a 100644
--- a/qml/ConfigurePage.qml
+++ b/qml/ConfigurePage.qml
@@ -11,6 +11,7 @@ Kirigami.Page {
id: configurePage
required property DcContext context
+ required property DcAccountsEventEmitter eventEmitter
ColumnLayout {
anchors.fill: parent
@@ -26,6 +27,10 @@ Kirigami.Page {
placeholderText: "Password"
echoMode: TextInput.PasswordEchoOnEdit
}
+ ProgressBar {
+ id: progressBar
+ value: 0.0
+ }
Button {
text: "Login"
onClicked: {
@@ -37,4 +42,11 @@ Kirigami.Page {
}
}
}
+
+ Connections {
+ target: configurePage.eventEmitter
+ function onConfigureProgress(accountId, progress, comment) {
+ progressBar.value = progress / 1000.0
+ }
+ }
}