diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 8e0e713a0ea18..dc37d71d18893 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -47,8 +47,6 @@ #include #include #include -#include -#include namespace { #ifndef VERSION_C @@ -1521,32 +1519,10 @@ void Folder::slotHydrationFailed(int errorCode, int statusCode, const QString &e .arg(errorCode) .arg(statusCode) .arg(errorString); + _syncResult.appendErrorString(errorMessageDetails); const auto errorMessageBox = new VfsDownloadErrorDialog(fileName, errorMessageDetails); - errorMessageBox->setAttribute(Qt::WA_DeleteOnClose); - errorMessageBox->setWindowTitle(Theme::instance()->appNameGUI()); - errorMessageBox->setMinimumWidth(150); - errorMessageBox->setMinimumHeight(100); - - // add label and hide it - const auto errorMessageDetailsLabel = new QLabel(errorMessageDetails); - errorMessageDetailsLabel->setWordWrap(true); - errorMessageBox->layout()->addWidget(errorMessageDetailsLabel); - errorMessageDetailsLabel->hide(); - - auto buttonsLayout = new QHBoxLayout; - - // add button for showing label on click - const auto acceptButton = new QPushButton(tr("OK")); - const auto showErrorMessageDetailsButton = new QPushButton(tr("> More details")); - - buttonsLayout->addWidget(showErrorMessageDetailsButton); - buttonsLayout->addWidget(acceptButton); - connect(showErrorMessageDetailsButton, &QPushButton::clicked, errorMessageDetailsLabel, &QPushButton::show); - - errorMessageBox->layout()->addItem(buttonsLayout); - errorMessageBox->show(); errorMessageBox->activateWindow(); errorMessageBox->raise(); diff --git a/src/gui/passwordinputdialog.ui b/src/gui/passwordinputdialog.ui index 1eee5cfb25137..16b4b4e329429 100644 --- a/src/gui/passwordinputdialog.ui +++ b/src/gui/passwordinputdialog.ui @@ -9,8 +9,8 @@ 0 0 - 291 - 201 + 276 + 125 diff --git a/src/gui/vfsdownloaderrordialog.cpp b/src/gui/vfsdownloaderrordialog.cpp index 82c5d5dae9f24..b80df5e156392 100644 --- a/src/gui/vfsdownloaderrordialog.cpp +++ b/src/gui/vfsdownloaderrordialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) by Felix Weilbach + * Copyright (C) 2023 by Oleksandr Zolotov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -11,7 +11,6 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ - #include "vfsdownloaderrordialog.h" #include "ui_vfsdownloaderrordialog.h" @@ -19,14 +18,16 @@ namespace OCC { VfsDownloadErrorDialog::VfsDownloadErrorDialog(const QString &fileName, const QString &errorMessage, QWidget *parent) : QDialog(parent) - , _ui(new Ui::VfsDownloadErrorDialog) { - _ui->setupUi(this); + , _ui(new Ui::VfsDownloadErrorDialog) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + _ui->setupUi(this); _ui->descriptionLabel->setText(tr("Error downloading %1").arg(fileName)); _ui->explanationLabel->setText(tr("%1 could not be downloaded.").arg(fileName)); _ui->moreDetailsLabel->setText(errorMessage); _ui->moreDetailsLabel->setVisible(false); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); } diff --git a/src/gui/vfsdownloaderrordialog.h b/src/gui/vfsdownloaderrordialog.h index 98e8f727c8b56..0410cd9c9cce5 100644 --- a/src/gui/vfsdownloaderrordialog.h +++ b/src/gui/vfsdownloaderrordialog.h @@ -1,5 +1,5 @@ /* - * Copyright (C) by Felix Weilbach + * Copyright (C) 2023 by Oleksandr Zolotov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -11,20 +11,12 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ - #pragma once - -#include -#include - -#include - #include +#include namespace OCC { -class Folder; - namespace Ui { class VfsDownloadErrorDialog; } @@ -35,10 +27,9 @@ class VfsDownloadErrorDialog : public QDialog public: explicit VfsDownloadErrorDialog(const QString &fileName, const QString &errorMessage, QWidget *parent = nullptr); - ~VfsDownloadErrorDialog() override; private: - std::unique_ptr _ui; + QScopedPointer _ui; }; }