@@ -29,9 +29,12 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
#define super QDialog
|
||||
|
||||
ProgressDialog::ProgressDialog(const QString& message, const QString& title, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
show_progress_(true)
|
||||
super(parent),
|
||||
show_progress_(true),
|
||||
first_show_(true)
|
||||
{
|
||||
if (!title.isEmpty()) {
|
||||
setWindowTitle(title);
|
||||
@@ -77,18 +80,26 @@ ProgressDialog::ProgressDialog(const QString& message, const QString& title, QWi
|
||||
|
||||
void ProgressDialog::showEvent(QShowEvent *e)
|
||||
{
|
||||
QDialog::showEvent(e);
|
||||
super::showEvent(e);
|
||||
|
||||
elapsed_timer_lbl_->Start();
|
||||
if (first_show_) {
|
||||
elapsed_timer_lbl_->Start();
|
||||
|
||||
Core::instance()->main_window()->SetApplicationProgressStatus(MainWindow::kProgressShow);
|
||||
Core::instance()->main_window()->SetApplicationProgressStatus(MainWindow::kProgressShow);
|
||||
|
||||
first_show_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ProgressDialog::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
QDialog::closeEvent(e);
|
||||
super::closeEvent(e);
|
||||
|
||||
Core::instance()->main_window()->SetApplicationProgressStatus(MainWindow::kProgressNone);
|
||||
|
||||
elapsed_timer_lbl_->Stop();
|
||||
|
||||
first_show_ = true;
|
||||
}
|
||||
|
||||
void ProgressDialog::SetProgress(double value)
|
||||
|
||||
@@ -56,6 +56,8 @@ private:
|
||||
|
||||
bool show_progress_;
|
||||
|
||||
bool first_show_;
|
||||
|
||||
private slots:
|
||||
void DisableSenderWidget();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user