Commit 5d90a6b4 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Pass parent widget to add dialog

Ensures that the dialog when creating an archive from Dolphin is centered in the Dolphin window

(cherry picked from commit 96601a5e)
parent 572cbb0f
Pipeline #211591 passed with stage
in 1 minute and 27 seconds
......@@ -109,7 +109,7 @@ QAction *CompressFileItemAction::createAction(const QIcon &icon, QWidget *parent
if (!fileExtension.isEmpty()) {
addToArchiveJob->setAutoFilenameSuffix(fileExtension);
} else {
if (!addToArchiveJob->showAddDialog()) {
if (!addToArchiveJob->showAddDialog(parent)) {
delete addToArchiveJob;
return;
}
......
......@@ -253,7 +253,7 @@ int main(int argc, char **argv)
if (parser.isSet(QStringLiteral("dialog"))) {
qCDebug(ARK) << "Using kerfuffle to open add dialog";
if (!addToArchiveJob->showAddDialog()) {
if (!addToArchiveJob->showAddDialog(nullptr)) {
return 0;
}
}
......
......@@ -66,7 +66,7 @@ void AddToArchive::setHeaderEncryptionEnabled(bool enabled)
m_enableHeaderEncryption = enabled;
}
bool AddToArchive::showAddDialog()
bool AddToArchive::showAddDialog(QWidget *parentWidget)
{
qCDebug(ARK) << "Opening add dialog";
......@@ -75,7 +75,7 @@ bool AddToArchive::showAddDialog()
}
QPointer<Kerfuffle::CreateDialog> dialog = new Kerfuffle::CreateDialog(
nullptr, // parent
parentWidget, // parent
i18n("Compress to Archive"), // caption
QUrl::fromLocalFile(QFileInfo(m_filename).path())); // startDir
......
......@@ -36,7 +36,7 @@ public:
explicit AddToArchive(QObject *parent = nullptr);
~AddToArchive() override;
bool showAddDialog();
bool showAddDialog(QWidget *parentWidget);
void setPreservePaths(bool value);
void setChangeToFirstPath(bool value);
void setImmediateProgressReporting(bool immediateProgressReporting);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment