aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/loadingbar.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2018-01-19 02:10:31 +0100
commit49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3 (patch)
treee35d5472c2a3ed129f5a6a6826f9999b033cc548 /src/widgets/loadingbar.cpp
parentConfiguration creates missing items based on defaults (diff)
downloadsmolbote-49ee5ed6e80b8f06337f92d14e2cab1c1512c1e3.tar.xz
Refactoring MainWindow
- Added NavigationBar object that manages the navigation buttons - Removed NavigationButton class that it obsoleted
Diffstat (limited to 'src/widgets/loadingbar.cpp')
-rw-r--r--src/widgets/loadingbar.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/widgets/loadingbar.cpp b/src/widgets/loadingbar.cpp
deleted file mode 100644
index e72c5bb..0000000
--- a/src/widgets/loadingbar.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is part of smolbote. It's copyrighted by the contributors recorded
- * in the version control history of the file, available from its original
- * location: git://neueland.iserlohn-fortress.net/smolbote.git
- *
- * SPDX-License-Identifier: GPL-3.0
- */
-
-#include "loadingbar.h"
-#include <QTimer>
-#include <QWebEngineView>
-
-LoadingBar::LoadingBar(QWidget *parent)
- : QProgressBar(parent)
-{
- setMaximum(100);
-}
-
-void LoadingBar::connectWebView(QWebEngineView *view)
-{
- disconnect(this);
-
- connect(view, SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(view, SIGNAL(loadProgress(int)), this, SLOT(setValue(int)));
- connect(view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
-}
-
-void LoadingBar::loadStarted()
-{
- resetFormat();
- show();
- setValue(0);
-}
-
-void LoadingBar::loadFinished(bool ok)
-{
- setFormat(QString("%p% %1").arg(ok ? tr("Finished") : tr("Failed")));
- QTimer::singleShot(2000, this, SLOT(hide()));
-}