5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
21 #include "progresswidget.h"
22 #include "progressdialog.h"
23 #include "ui_progressdialog.h"
27 ProgressDialog::ProgressDialog(QWidget
*parent
, const QString
&title
, const QIcon
&icon
, bool forceOpen
):
29 ui(new Ui::ProgressDialog
),
33 setWindowTitle(title
);
35 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint
);
37 ui
->outputProgress
->forceOpen();
43 ProgressDialog::~ProgressDialog()
48 ProgressWidget
* ProgressDialog::progress()
50 return ui
->outputProgress
;
53 void ProgressDialog::on_closeButton_clicked()
56 ui
->outputProgress
->stop();
62 void ProgressDialog::on_outputProgress_detailsToggled()
64 QTimer::singleShot(0, this, SLOT(shrink()));
67 void ProgressDialog::on_outputProgress_locked(bool lock
)
69 ui
->closeButton
->setEnabled(!lock
);
73 void ProgressDialog::shrink()
78 bool ProgressDialog::isEmpty() const
80 return ui
->outputProgress
->isEmpty();
83 void ProgressDialog::setProcessStarted()
85 ui
->closeButton
->setText(tr("Cancel"));
88 void ProgressDialog::setProcessStopped()
90 ui
->closeButton
->setText(tr("Close"));