]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/dialogs/EditBookmarkDialog.cpp
Block all CSP requests. https://redmine.stoutner.com/issues/1193
[PrivacyBrowserPC.git] / src / dialogs / EditBookmarkDialog.cpp
index 3a4d770eb740045e4891f8469e11f8110d7df0f8..01ac4d2ef6d264dd753e2a0d0ef3b15993e80ead 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2023 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2023-2024 Soren Stoutner <soren@stoutner.com>
  *
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
  *
  *
- * Privacy Browser PC is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * 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 the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
  *
- * Privacy Browser PC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
  */
 
 // Application headers.
@@ -26,7 +26,7 @@
 #include <QFileDialog>
 
 // Construct the class.
 #include <QFileDialog>
 
 // Construct the class.
-EditBookmarkDialog::EditBookmarkDialog(const int databaseId, QIcon &currentWebsiteFavoriteIcon) : QDialog(nullptr), bookmarkDatabaseId(databaseId)
+EditBookmarkDialog::EditBookmarkDialog(QWidget *parentWidgetPointer, const int databaseId, QIcon &currentWebsiteFavoriteIcon) : QDialog(parentWidgetPointer), bookmarkDatabaseId(databaseId)
 {
     // Set the window title.
     setWindowTitle(i18nc("The edit bookmark dialog window title.", "Edit Bookmark"));
 {
     // Set the window title.
     setWindowTitle(i18nc("The edit bookmark dialog window title.", "Edit Bookmark"));
@@ -96,10 +96,12 @@ EditBookmarkDialog::EditBookmarkDialog(const int databaseId, QIcon &currentWebsi
     bookmarkNameLineEditPointer->setText(bookmarkStructPointer->name);
     bookmarkUrlLineEditPointer->setText(bookmarkStructPointer->url);
 
     bookmarkNameLineEditPointer->setText(bookmarkStructPointer->name);
     bookmarkUrlLineEditPointer->setText(bookmarkStructPointer->url);
 
-    // Scroll to the beginning of the line edits.
-    bookmarkNameLineEditPointer->setCursorPosition(0);
+    // Scroll to the beginning of the bookmark URL line edit.
     bookmarkUrlLineEditPointer->setCursorPosition(0);
 
     bookmarkUrlLineEditPointer->setCursorPosition(0);
 
+    // Focus the bookmark name line edit.
+    bookmarkNameLineEditPointer->setFocus();
+
     // Connect the buttons.
     connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));
     connect(dialogButtonBoxPointer, SIGNAL(accepted()), this, SLOT(save()));
     // Connect the buttons.
     connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));
     connect(dialogButtonBoxPointer, SIGNAL(accepted()), this, SLOT(save()));
@@ -178,7 +180,7 @@ void EditBookmarkDialog::save()
     BookmarksDatabase::updateFolderContentsDisplayOrder(bookmarkStructPointer->parentFolderId);
 
     // Emit the bookmark saved signal.
     BookmarksDatabase::updateFolderContentsDisplayOrder(bookmarkStructPointer->parentFolderId);
 
     // Emit the bookmark saved signal.
-    emit bookmarkSaved();
+    Q_EMIT bookmarkSaved();
 
     // Close the dialog.
     close();
 
     // Close the dialog.
     close();