summaryrefslogtreecommitdiffstats
path: root/keygendialog.cpp
diff options
context:
space:
mode:
authorAnne Jan Brouwer <brouwer@annejan.com>2015-05-26 03:22:59 +0200
committerAnne Jan Brouwer <brouwer@annejan.com>2015-05-26 03:22:59 +0200
commit271b3da56d76bad669d14547ca499a64000c8a3c (patch)
tree17c4b541eda2e28c3ca967521e6b969b43fb8842 /keygendialog.cpp
parent825c9eb7b546c51fcb6e3c4dee2250a7d15c6208 (diff)
Added waiting animation widget from https://github.com/mojocorp/QProgressIndicator
Diffstat (limited to 'keygendialog.cpp')
-rw-r--r--keygendialog.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/keygendialog.cpp b/keygendialog.cpp
index a04ed77d..640ee069 100644
--- a/keygendialog.cpp
+++ b/keygendialog.cpp
@@ -1,5 +1,6 @@
#include "keygendialog.h"
#include "ui_keygendialog.h"
+#include "progressindicator.h"
#include <QDebug>
#include <QMessageBox>
@@ -116,17 +117,23 @@ void KeygenDialog::done(int r)
ui->buttonBox->setEnabled(false);
ui->checkBox->setEnabled(false);
ui->plainTextEdit->setEnabled(false);
- // some kind of animation or at-least explanation needed here
- // people don't like wating :D
+
+ QProgressIndicator* pi = new QProgressIndicator();
+ pi->startAnimation();
+ pi->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ this->layout()->removeWidget(ui->widget);
+ this->layout()->removeWidget(ui->buttonBox);
+ this->layout()->removeWidget(ui->checkBox);
+ this->layout()->removeWidget(ui->plainTextEdit);
+ this->layout()->removeWidget(ui->label);
+ this->layout()->removeWidget(ui->labelExpertInfo);
+ this->layout()->removeWidget(ui->labelPassphraseInfo);
+
+ this->layout()->addWidget(pi);
+
+ this->show();
dialog->genKey(ui->plainTextEdit->toPlainText(), this);
-// QMessageBox::critical(this, tr("GPG gen-key error"),
-// tr("Something went wrong, I guess"));
-// ui->widget->setEnabled(true);
-// ui->buttonBox->setEnabled(true);
-// ui->checkBox->setEnabled(true);
-// on_checkBox_stateChanged(ui->checkBox->isChecked());
-// // something went wrong, explain things?
-// return;
}
else // cancel, close or exc was pressed
{