From: Soren Stoutner Date: Fri, 29 Dec 2023 23:30:25 +0000 (-0700) Subject: Focus the bookmark name when adding or editing bookmarks. https://redmine.stoutner... X-Git-Tag: v0.6~16 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=2e3b899634155bbbedf6cce0e3156fa00d4a16e8;p=PrivacyBrowserPC.git Focus the bookmark name when adding or editing bookmarks. https://redmine.stoutner.com/issues/1096 --- diff --git a/src/dialogs/AddBookmarkDialog.cpp b/src/dialogs/AddBookmarkDialog.cpp index 9f977af..4c91c2c 100644 --- a/src/dialogs/AddBookmarkDialog.cpp +++ b/src/dialogs/AddBookmarkDialog.cpp @@ -94,10 +94,12 @@ AddBookmarkDialog::AddBookmarkDialog(const QString &bookmarkName, const QString 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); diff --git a/src/dialogs/EditBookmarkDialog.cpp b/src/dialogs/EditBookmarkDialog.cpp index 3a4d770..a0c0c77 100644 --- a/src/dialogs/EditBookmarkDialog.cpp +++ b/src/dialogs/EditBookmarkDialog.cpp @@ -96,10 +96,12 @@ EditBookmarkDialog::EditBookmarkDialog(const int databaseId, QIcon ¤tWebsi 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); + // 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())); diff --git a/src/dialogs/EditFolderDialog.cpp b/src/dialogs/EditFolderDialog.cpp index eb2bdcf..4285444 100644 --- a/src/dialogs/EditFolderDialog.cpp +++ b/src/dialogs/EditFolderDialog.cpp @@ -93,8 +93,8 @@ EditFolderDialog::EditFolderDialog(const int databaseId, QIcon ¤tWebsiteFa // Populate the line edits. folderNameLineEditPointer->setText(bookmarkStructPointer->name); - // Scroll to the beginning of the line edits. - folderNameLineEditPointer->setCursorPosition(0); + // Focus the folder name line edit. + folderNameLineEditPointer->setFocus(); // Connect the buttons. connect(browseButtonPointer, SIGNAL(clicked()), this, SLOT(browse()));