Show nice "loading" gif icon.
--HG-- branch : develop
This commit is contained in:
parent
fcbb301004
commit
c98aa9487e
|
@ -33,10 +33,11 @@
|
|||
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QtSvgDepends>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
||||
:QDialog(parent), ui(new Ui::DialogLayoutProgress), maxCount(count)
|
||||
:QDialog(parent), ui(new Ui::DialogLayoutProgress), maxCount(count), movie(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -45,7 +46,11 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
|||
ui->progressBar->setMaximum(maxCount);
|
||||
ui->progressBar->setValue(0);
|
||||
|
||||
ui->labelMessage->setText(tr("Arranged: %1 from %2").arg(0).arg(count));
|
||||
ui->labelMessage->setText(tr("Arranged workpieces: %1 from %2").arg(0).arg(count));
|
||||
|
||||
movie = new QMovie("://icon/16x16/progress.gif");
|
||||
ui->labelProgress->setMovie (movie);
|
||||
movie->start ();
|
||||
|
||||
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
||||
SCASSERT(bCancel != nullptr);
|
||||
|
@ -59,6 +64,7 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
|||
DialogLayoutProgress::~DialogLayoutProgress()
|
||||
{
|
||||
delete ui;
|
||||
delete movie;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -71,7 +77,7 @@ void DialogLayoutProgress::Start()
|
|||
void DialogLayoutProgress::Arranged(int count)
|
||||
{
|
||||
ui->progressBar->setValue(count);
|
||||
ui->labelMessage->setText(tr("Arranged: %1 from %2").arg(count).arg(maxCount));
|
||||
ui->labelMessage->setText(tr("Arranged workpieces: %1 from %2").arg(count).arg(maxCount));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -59,7 +59,8 @@ public slots:
|
|||
private:
|
||||
Q_DISABLE_COPY(DialogLayoutProgress)
|
||||
Ui::DialogLayoutProgress *ui;
|
||||
int maxCount;
|
||||
const int maxCount;
|
||||
QMovie *movie;
|
||||
};
|
||||
|
||||
#endif // DIALOGLAYOUTPROGRESS_H
|
||||
|
|
|
@ -64,6 +64,13 @@
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelProgress">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelMessage">
|
||||
<property name="text">
|
||||
|
|
|
@ -59,5 +59,6 @@
|
|||
<file>icon/24x24/fx.png</file>
|
||||
<file>icon/16x16/fx.png</file>
|
||||
<file>icon/16x16/roll.png</file>
|
||||
<file>icon/16x16/progress.gif</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
src/app/share/resources/icon/16x16/progress.gif
Normal file
BIN
src/app/share/resources/icon/16x16/progress.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user