mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-02 23:20:20 +00:00
DownloadFromDCWidget class cleanup
Remove static DownloadFromDCWidget::instance() method Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
02e9a6d07b
commit
449c6fc6f2
3 changed files with 3 additions and 17 deletions
|
@ -36,13 +36,6 @@ namespace DownloadFromDcGlobal {
|
||||||
const char *err_string;
|
const char *err_string;
|
||||||
};
|
};
|
||||||
|
|
||||||
DownloadFromDCWidget *DownloadFromDCWidget::instance()
|
|
||||||
{
|
|
||||||
static DownloadFromDCWidget *dialog = new DownloadFromDCWidget(mainWindow());
|
|
||||||
dialog->setAttribute(Qt::WA_QuitOnClose, false);
|
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
|
DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
|
||||||
QDialog(parent, f), thread(0), timer(new QTimer(this)),
|
QDialog(parent, f), thread(0), timer(new QTimer(this)),
|
||||||
dumpWarningShown(false), currentState(INITIAL)
|
dumpWarningShown(false), currentState(INITIAL)
|
||||||
|
@ -79,12 +72,6 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
|
||||||
updateState(INITIAL);
|
updateState(INITIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadFromDCWidget::runDialog()
|
|
||||||
{
|
|
||||||
updateState(INITIAL);
|
|
||||||
exec();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DownloadFromDCWidget::updateProgressBar()
|
void DownloadFromDCWidget::updateProgressBar()
|
||||||
{
|
{
|
||||||
if (*progress_bar_text != '\0') {
|
if (*progress_bar_text != '\0') {
|
||||||
|
|
|
@ -24,7 +24,6 @@ class DownloadFromDCWidget : public QDialog{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit DownloadFromDCWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
explicit DownloadFromDCWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||||
static DownloadFromDCWidget *instance();
|
|
||||||
void reject();
|
void reject();
|
||||||
|
|
||||||
enum states {
|
enum states {
|
||||||
|
@ -44,7 +43,6 @@ public slots:
|
||||||
|
|
||||||
void onDownloadThreadFinished();
|
void onDownloadThreadFinished();
|
||||||
void updateProgressBar();
|
void updateProgressBar();
|
||||||
void runDialog();
|
|
||||||
void checkLogFile(int state);
|
void checkLogFile(int state);
|
||||||
void checkDumpFile(int state);
|
void checkDumpFile(int state);
|
||||||
void pickDumpFile();
|
void pickDumpFile();
|
||||||
|
|
|
@ -270,8 +270,9 @@ void MainWindow::on_actionQuit_triggered()
|
||||||
|
|
||||||
void MainWindow::on_actionDownloadDC_triggered()
|
void MainWindow::on_actionDownloadDC_triggered()
|
||||||
{
|
{
|
||||||
DownloadFromDCWidget* downloadWidget = DownloadFromDCWidget::instance();
|
DownloadFromDCWidget dlg(this);
|
||||||
downloadWidget->runDialog();
|
|
||||||
|
dlg.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionDownloadWeb_triggered()
|
void MainWindow::on_actionDownloadWeb_triggered()
|
||||||
|
|
Loading…
Reference in a new issue