/*
- * Copyright 2023 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2023-2024 Soren Stoutner <soren@stoutner.com>.
*
* This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
*
#include <QPushButton>
// Construct the class.
-AddBookmarkDialog::AddBookmarkDialog(const QString &bookmarkName, const QString &bookmarkUrl, const QIcon &favoriteIcon, const double parentFolderId) : QDialog(nullptr)
+AddBookmarkDialog::AddBookmarkDialog(QWidget *parentWidgetPointer, const QString &bookmarkName, const QString &bookmarkUrl, const QIcon &favoriteIcon, const double parentFolderId) :
+ QDialog(parentWidgetPointer)
{
// Set the window title.
setWindowTitle(i18nc("The add bookmark dialog window title.", "Add Bookmark"));
bookmarkNameLineEditPointer->setText(bookmarkName);
bookmarkUrlLineEditPointer->setText(bookmarkUrl);
- // Scroll to the beginning of the line edits.
- bookmarkNameLineEditPointer->setCursorPosition(0);
+ // Scroll to the beginning of the bookmark URL line edit.
bookmarkUrlLineEditPointer->setCursorPosition(0);
+ // Focus the bookmark name line edit.
+ bookmarkNameLineEditPointer->setFocus();
+
// Add buttons to the dialog button box.
addButtonPointer = dialogButtonBoxPointer->addButton(i18nc("The add bookmark button", "Add"), QDialogButtonBox::AcceptRole);