mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-29 02:51:45 -04:00
added the animation for file check/hashing to statusbar
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3716 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
417b167d43
commit
ad34df9ac5
4 changed files with 18 additions and 8 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include <QLayout>
|
||||
#include <QLabel>
|
||||
#include <QMovie>
|
||||
|
||||
#include "hashingstatus.h"
|
||||
|
||||
|
@ -52,6 +53,9 @@ HashingStatus::HashingStatus(QWidget *parent)
|
|||
QHBoxLayout *hbox = new QHBoxLayout(this);
|
||||
hbox->setMargin(0);
|
||||
hbox->setSpacing(6);
|
||||
|
||||
hashloader = new QLabel(this);
|
||||
hbox->addWidget(hashloader);
|
||||
|
||||
statusHashing = new StatusLabel(hbox, this);
|
||||
hbox->addWidget(statusHashing);
|
||||
|
@ -61,17 +65,27 @@ HashingStatus::HashingStatus(QWidget *parent)
|
|||
|
||||
setLayout(hbox);
|
||||
|
||||
hashloader->hide();
|
||||
statusHashing->hide();
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(hashingInfoChanged(const QString&)), SLOT(updateHashingInfo(const QString&)));
|
||||
|
||||
}
|
||||
|
||||
void HashingStatus::updateHashingInfo(const QString& s)
|
||||
{
|
||||
QMovie *movie = new QMovie(":/images/loader/16-loader.gif");
|
||||
|
||||
if(s.isEmpty()) {
|
||||
statusHashing->hide() ;
|
||||
hashloader->hide() ;
|
||||
} else {
|
||||
statusHashing->setText(s);
|
||||
statusHashing->show();
|
||||
hashloader->show() ;
|
||||
|
||||
hashloader->setMovie(movie);
|
||||
movie->start();
|
||||
movie->setSpeed(80); // 2x speed
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,9 @@ public slots:
|
|||
void updateHashingInfo(const QString&) ;
|
||||
|
||||
private:
|
||||
QLabel *statusHashing;
|
||||
QLabel *statusHashing, *hashloader;
|
||||
QMovie *movie;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue