mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 07:00:57 -04:00
added pause to file hashing
This commit is contained in:
parent
ea25d4b5a4
commit
eff5c5d6ee
11 changed files with 95 additions and 2 deletions
|
@ -22,7 +22,9 @@
|
|||
#include <QLayout>
|
||||
#include <QLabel>
|
||||
#include <QMovie>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "retroshare/rsfiles.h"
|
||||
#include "hashingstatus.h"
|
||||
#include "gui/common/ElidedLabel.h"
|
||||
#include "gui/notifyqt.h"
|
||||
|
@ -61,13 +63,14 @@ HashingStatus::~HashingStatus()
|
|||
|
||||
void HashingStatus::updateHashingInfo(const QString& s)
|
||||
{
|
||||
if (s.isEmpty()) {
|
||||
if (s.isEmpty())
|
||||
{
|
||||
statusHashing->hide() ;
|
||||
hashloader->hide() ;
|
||||
|
||||
movie->stop() ;
|
||||
} else {
|
||||
hashloader->setToolTip(s) ;
|
||||
setToolTip(s + "\n"+QObject::tr("Click to pause the hashing process"));
|
||||
|
||||
if (_compactMode) {
|
||||
statusHashing->hide() ;
|
||||
|
@ -80,3 +83,24 @@ void HashingStatus::updateHashingInfo(const QString& s)
|
|||
movie->start() ;
|
||||
}
|
||||
}
|
||||
|
||||
void HashingStatus::mousePressEvent(QMouseEvent *)
|
||||
{
|
||||
rsFiles->togglePauseHashingProcess() ;
|
||||
|
||||
if(rsFiles->hashingProcessPaused())
|
||||
{
|
||||
movie->stop() ;
|
||||
hashloader->setPixmap(QPixmap(":/images/resume.png")) ;
|
||||
|
||||
mLastText = statusHashing->text();
|
||||
statusHashing->setText(QObject::tr("[Hashing is paused]"));
|
||||
setToolTip(QObject::tr("Click to resume the hashing process"));
|
||||
}
|
||||
else
|
||||
{
|
||||
hashloader->setMovie(movie) ;
|
||||
statusHashing->setText(mLastText);
|
||||
movie->start() ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ public:
|
|||
~HashingStatus();
|
||||
|
||||
void setCompactMode(bool compact) {_compactMode = compact; }
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
|
||||
public slots:
|
||||
void updateHashingInfo(const QString&) ;
|
||||
|
@ -42,6 +43,7 @@ public slots:
|
|||
private:
|
||||
ElidedLabel *statusHashing;
|
||||
QLabel *hashloader;
|
||||
QString mLastText ;
|
||||
QMovie *movie;
|
||||
bool _compactMode;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue