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:
defnax 2010-10-29 12:50:33 +00:00
parent 417b167d43
commit ad34df9ac5
4 changed files with 18 additions and 8 deletions

View File

@ -23,7 +23,6 @@
#include <QTreeView>
#include <QClipboard>
#include <QMenu>
#include <QMovie>
#include <QProcess>
#include <QSortFilterProxyModel>
@ -257,14 +256,10 @@ void SharedFilesDialog::checkUpdate()
if (rsFiles->InDirectoryCheck())
{
ui.checkButton->setText(tr("Checking..."));
QMovie *movie = new QMovie(":/images/loader/16-loader.gif");
ui.hashLabel->setMovie(movie);
movie->start();
movie->setSpeed(100); // 2x speed
}
else
{
ui.checkButton->setText(tr("Check files"));
ui.checkButton->setText(tr("Check files"));
ui.hashLabel->setPixmap(QPixmap(IMAGE_HASH_DONE));
ui.hashLabel->setToolTip("") ;
}

View File

@ -116,7 +116,6 @@ private:
QAction* copylinklocalhtmlAct;
QTreeView *shareddirtreeview;
QMovie *movie;
/** Qt Designer generated object */
Ui::SharedFilesDialog ui;

View File

@ -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
}
}

View File

@ -36,7 +36,9 @@ public slots:
void updateHashingInfo(const QString&) ;
private:
QLabel *statusHashing;
QLabel *statusHashing, *hashloader;
QMovie *movie;
};
#endif