mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -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("") ;
|
||||
}
|
||||
|
@ -116,7 +116,6 @@ private:
|
||||
QAction* copylinklocalhtmlAct;
|
||||
|
||||
QTreeView *shareddirtreeview;
|
||||
QMovie *movie;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::SharedFilesDialog ui;
|
||||
|
@ -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…
Reference in New Issue
Block a user