Skip to content

Commit 6b821a5

Browse files
committed
change progressbar animation
1 parent e1fa25a commit 6b821a5

4 files changed

+18
-214
lines changed

keygendialog.cpp

+16-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <QDebug>
33
#include <QMessageBox>
44
#include "ui_keygendialog.h"
5-
#include "qprogressindicator.h"
5+
#include <QtGui>
66

77
KeygenDialog::KeygenDialog(ConfigDialog *parent)
88
: QDialog(parent), ui(new Ui::KeygenDialog) {
@@ -98,11 +98,6 @@ void KeygenDialog::done(int r) {
9898
ui->buttonBox->setEnabled(false);
9999
ui->checkBox->setEnabled(false);
100100
ui->plainTextEdit->setEnabled(false);
101-
102-
QProgressIndicator *pi = new QProgressIndicator();
103-
pi->startAnimation();
104-
pi->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
105-
106101
ui->frame->hide();
107102
ui->label->setText(
108103
QString("This operation can take some minutes.<br />") +
@@ -112,7 +107,21 @@ void KeygenDialog::done(int r) {
112107
"disks) during the prime generation; this gives the random number "
113108
"generator a better chance to gain enough entropy.");
114109

115-
this->layout()->addWidget(pi);
110+
111+
QLabel* label = new QLabel();
112+
113+
label-> setWindowFlags(Qt::FramelessWindowHint);
114+
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
115+
//label->setGeometry(QRect(100, 100, 200, 200));
116+
label->setMask((new QPixmap(":/artwork/progress.gif"))->mask());
117+
118+
this->layout()->addWidget(label);
119+
120+
QMovie *movie = new QMovie(":/artwork/progress.gif");
121+
label->setMovie(movie);
122+
movie->start();
123+
124+
label->show();
116125

117126
this->show();
118127
dialog->genKey(ui->plainTextEdit->toPlainText(), this);

qprogressindicator.cpp

-104
This file was deleted.

qprogressindicator.h

-99
This file was deleted.

qtpass.pro

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ SOURCES += main.cpp\
2828
usersdialog.cpp \
2929
keygendialog.cpp \
3030
trayicon.cpp \
31-
passworddialog.cpp \
32-
qprogressindicator.cpp
31+
passworddialog.cpp
3332

3433
HEADERS += mainwindow.h \
3534
configdialog.h \
@@ -38,8 +37,7 @@ HEADERS += mainwindow.h \
3837
usersdialog.h \
3938
keygendialog.h \
4039
trayicon.h \
41-
passworddialog.h \
42-
qprogressindicator.h
40+
passworddialog.h
4341

4442
FORMS += mainwindow.ui \
4543
configdialog.ui \

0 commit comments

Comments
 (0)