/*
- * Copyright 2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2022-2024 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
*
#include <QShortcut>
#include <QStandardPaths>
-SaveDialog::SaveDialog(QUrl &url, QString &mimeTypeString, int totalBytes, QString fileName, bool nativeDownloader): downloadUrl(url), suggestedFileName(fileName)
+SaveDialog::SaveDialog(QWidget *parentWidgetPointer, QUrl &url, QString &mimeTypeString, int totalBytes, QString fileName, bool nativeDownloader) :
+ QDialog(parentWidgetPointer), downloadUrl(url), suggestedFileName(fileName)
{
// Set the dialog window title.
setWindowTitle(i18nc("The save dialog window title", "Save"));
// Create the keyboard shortcuts.
QShortcut *sShortcutPointer = new QShortcut(QKeySequence(i18nc("The save key shortcut.", "s")), this);
QShortcut *cShortcutPointer = new QShortcut(QKeySequence(i18nc("The close key shortcut.", "c")), this);
+ QShortcut *quitShortcutPointer = new QShortcut(QKeySequence::Quit, this);
// Connect the save buttons.
if (nativeDownloader)
}
else
{
- // Use WebEngine's downloader
+ // Use WebEngine's downloader.
connect(saveButtonPointer, SIGNAL(clicked()), this, SLOT(accept()));
connect(sShortcutPointer, SIGNAL(activated()), this, SLOT(accept()));
}
// Connect the cancel button.
connect(dialogButtonBoxPointer, SIGNAL(rejected()), this, SLOT(reject()));
connect(cShortcutPointer, SIGNAL(activated()), this, SLOT(reject()));
+ connect(quitShortcutPointer, SIGNAL(activated()), this, SLOT(reject()));
}
void SaveDialog::showFilePicker()
{
// Show the file picker dialog.
- emit useNativeDownloader(downloadUrl, suggestedFileName);
+ emit useNativeKdeDownloader(downloadUrl, suggestedFileName);
// Close the dialog.
reject();
}
-