]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/dialogs/CookiesDialog.h
Change the cookie implementation to a QTreeView.
[PrivacyBrowserPC.git] / src / dialogs / CookiesDialog.h
index 89f9c623b9f46e4b6037820589f274a6945252b4..770a84681bfcd7b3c5bd9af7ce6203f1bafa8da3 100644 (file)
 
 // Qt toolkit headers.
 #include <QDialog>
+#include <QItemSelectionModel>
 #include <QNetworkCookie>
-#include <QVBoxLayout>
+#include <QStandardItemModel>
+#include <QTreeView>
+
+// C++ headers.
+#include <forward_list>
 
 class CookiesDialog : public QDialog
 {
@@ -32,28 +37,36 @@ class CookiesDialog : public QDialog
 
 public:
     // The primary constructor.
-    explicit CookiesDialog(QList<QNetworkCookie> *cookieListPointer);
+    explicit CookiesDialog(std::forward_list<QNetworkCookie> *cookieListPointer);
 
 signals:
     // The signals.
     void addCookie(const QNetworkCookie &cookie) const;
     void deleteAllCookies() const;
+    void deleteCookie(const QNetworkCookie &cookie) const;
 
 private Q_SLOTS:
     // The private slots.
     void addCookieFromDialog(const QNetworkCookie &cookie) const;
-    void showAddCookieMessageBox() const;
+    void deleteCookieFromDialog(const QNetworkCookie &cookie) const;
+    void showAddCookieDialog() const;
     void showDeleteAllMessageBox() const;
+    void showDeleteCookieMessageBox() const;
+    void showEditCookieDialog() const;
+    void updateUi() const;
 
 private:
     // The private variables.
+    QItemSelectionModel *treeViewSelectionModelPointer;
     QPushButton *addCookieButtonPointer;
-    QList<QNetworkCookie> *cookieListPointer;
-    QVBoxLayout *cookiesVBoxLayoutPointer;
+    std::forward_list<QNetworkCookie> *cookieListPointer;
     QPushButton *deleteAllButtonPointer;
+    QPushButton *deleteCookieButtonPointer;
+    QPushButton *editCookieButtonPointer;
+    QStandardItemModel *standardItemModelPointer;
+    QTreeView *treeViewPointer;
 
     // The private functions.
-    void addCookieToLayout(const QNetworkCookie &cookie) const;
-    void updateUi() const;
+    void deleteCookie(const QModelIndex &modelIndex) const;
 };
 #endif