aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/WaitingDialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/WaitingDialog.cpp')
-rw-r--r--src/ui/dialog/WaitingDialog.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/ui/dialog/WaitingDialog.cpp b/src/ui/dialog/WaitingDialog.cpp
index afdd55b8..b0888581 100644
--- a/src/ui/dialog/WaitingDialog.cpp
+++ b/src/ui/dialog/WaitingDialog.cpp
@@ -28,10 +28,12 @@
#include "WaitingDialog.h"
+#include "dialog/GeneralDialog.h"
+
namespace GpgFrontend::UI {
WaitingDialog::WaitingDialog(const QString& title, QWidget* parent)
- : QDialog(parent) {
+ : GeneralDialog("WaitingDialog", parent) {
auto* pb = new QProgressBar();
pb->setRange(0, 0);
pb->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -51,26 +53,6 @@ WaitingDialog::WaitingDialog(const QString& title, QWidget* parent)
this->setAttribute(Qt::WA_DeleteOnClose);
this->setFixedSize(240, 42);
- if (parentWidget() == nullptr) {
- auto* screen = QGuiApplication::primaryScreen();
- QRect geo = screen->availableGeometry();
- int screen_width = geo.width();
- int screen_height = geo.height();
-
- SPDLOG_DEBUG("primary screen available geometry: {} {}", screen_width,
- screen_height);
-
- auto pos = QPoint((screen_width - QWidget::width()) / 2,
- (screen_height - QWidget::height()) / 2);
- this->move(pos);
-
- } else {
- auto pos = QPoint(parent->x() + (parent->width() - QWidget::width()) / 2,
- parent->y() + (parent->height() - QWidget::height()) / 2);
- SPDLOG_DEBUG("pos: {} {}", pos.x(), pos.y());
- this->move(pos);
- }
-
this->show();
}