taskdialog/progressdialog: if guard on showEvent

Fixes #1599
This commit is contained in:
itsmattkc
2021-04-30 09:58:45 +10:00
parent b82e616124
commit 6ca8dbb70a
4 changed files with 42 additions and 17 deletions
+17 -6
View File
@@ -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)
+2
View File
@@ -56,6 +56,8 @@ private:
bool show_progress_;
bool first_show_;
private slots:
void DisableSenderWidget();