]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/dialogs/BookmarksDialog.h
Move the Settings Dialog to its own class. https://redmine.stoutner.com/issues/1151
[PrivacyBrowserPC.git] / src / dialogs / BookmarksDialog.h
index e81d0b41cf008f38ce07e398a67eae0b69c5b2a9..0df090333a48033842db0375c42522bcd1566aa4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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>.
  *
@@ -36,13 +36,15 @@ class BookmarksDialog : public QDialog
 
 public:
     // The primary constructor.
-    explicit BookmarksDialog(QIcon currentWebsiteFavoriteIcon);
+    BookmarksDialog(QWidget *parentWidgetPointer, QIcon currentWebsiteFavorieIcon, QString currentWebsiteTitle, QString currentWebsiteUrl);
 
     // The public constants.
-    static const int BOOKMARK_NAME_COLUMN = 0;
-    static const int BOOKMARK_URL_COLUMN = 1;
+    static const int NAME_COLUMN = 0;
+    static const int URL_COLUMN = 1;
     static const int DATABASE_ID_COLUMN = 2;
-    static const int DISPLAY_ORDER = 3;
+    static const int DISPLAY_ORDER_COLUMN = 3;
+    static const int IS_FOLDER_COLUMN = 4;
+    static const int FOLDER_ID_COLUMN = 5;
 
 signals:
     // The signals.
@@ -52,15 +54,13 @@ private Q_SLOTS:
     // The private slots.
     void deleteItems() const;
     void refreshBookmarks() const;
-    void showAddBookmarkDialog() const;
+    void showAddBookmarkDialog();
+    void showAddFolderDialog();
     void showEditDialog();
     void updateBookmarkFromTree(QStandardItem *modifiedStandardItem);
-    void updateUi() const;
+    void updateSelection() const;
 
 private:
-    // The private functions.
-    void populateBookmarks() const;
-
     // The private variables.
     QPushButton *deleteItemsButtonPointer;
     QPushButton *editButtonPointer;
@@ -68,5 +68,13 @@ private:
     QItemSelectionModel *treeSelectionModelPointer;
     DraggableTreeView *draggableTreeViewPointer;
     QIcon websiteFavoriteIcon;
+    QString websiteTitle;
+    QString websiteUrl;
+
+    // The private functions.
+    void populateBookmarks() const;
+    void populateSubfolders(QStandardItem *folderItemNamePointer, const double folderId) const;
+    void selectSubfolderContents(const QModelIndex &parentModelIndex) const;
+    void updateUi() const;
 };
 #endif