diff options
Diffstat (limited to 'src/ui/KeyServerImportDialog.cpp')
-rw-r--r-- | src/ui/KeyServerImportDialog.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/ui/KeyServerImportDialog.cpp b/src/ui/KeyServerImportDialog.cpp index 17db7d65..844f2ae5 100644 --- a/src/ui/KeyServerImportDialog.cpp +++ b/src/ui/KeyServerImportDialog.cpp @@ -196,7 +196,7 @@ void KeyServerImportDialog::createKeysTable() { void KeyServerImportDialog::setMessage(const QString& text, bool error) { if (mAutomatic) return; - + message->setText(text); if (error) { icon->setPixmap( @@ -505,12 +505,13 @@ void KeyServerImportDialog::importKeys(ByteArrayPtr in_data) { GpgImportInformation result = GpgKeyImportExportor::GetInstance().ImportKey(std::move(in_data)); emit signalKeyImported(); + QWidget* _parent = qobject_cast<QWidget*>(parent()); if (mAutomatic) { - auto dialog = new KeyImportDetailDialog(result, true, nullptr); + auto dialog = new KeyImportDetailDialog(result, true, _parent); dialog->show(); this->accept(); } else { - auto dialog = new KeyImportDetailDialog(result, false, this); + auto dialog = new KeyImportDetailDialog(result, false, _parent); dialog->exec(); } } @@ -527,34 +528,24 @@ KeyServerImportDialog::KeyServerImportDialog(QWidget* parent) : QDialog(parent), mAutomatic(true) { setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); - message = new QLabel; - message->setFixedHeight(24); - icon = new QLabel; - icon->setFixedHeight(24); - // Network Waiting waitingBar = new QProgressBar(); waitingBar->setVisible(false); waitingBar->setRange(0, 0); - waitingBar->setFixedHeight(24); - waitingBar->setFixedWidth(200); + waitingBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + waitingBar->setTextVisible(false); // Layout for messagebox - auto* messageLayout = new QHBoxLayout; - messageLayout->addWidget(icon); - messageLayout->addWidget(message); - messageLayout->addWidget(waitingBar); - messageLayout->addStretch(); + auto* layout = new QHBoxLayout(); + layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); + layout->addWidget(waitingBar); keyServerComboBox = createComboBox(); - auto* mainLayout = new QGridLayout; - - mainLayout->addLayout(messageLayout, 0, 0, 1, 3); - - this->setLayout(mainLayout); - this->setWindowTitle(_("Upload Keys from Keyserver")); - this->setFixedSize(200, 42); + this->setLayout(layout); + this->setWindowTitle(_("Update Keys from Keyserver")); + this->setFixedSize(240, 42); this->setModal(true); } |