Commit 96601a5e authored by Nicolas Fella's avatar Nicolas Fella Committed by Elvis Angelaccio
Browse files

Pass parent widget to add dialog

Ensures that the dialog when creating an archive from Dolphin is centered in the Dolphin window
parent 55f774bd
Pipeline #211590 passed with stage
in 1 minute and 35 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