X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fdialogs%2FDurableCookiesDialog.h;fp=src%2Fdialogs%2FDurableCookiesDialog.h;h=61ffe5fb202a0123bd39c3ea95d1d982bb802eb6;hp=0000000000000000000000000000000000000000;hb=adf448e4cca7b96f6db9fc2048e9a64fa24a9bba;hpb=b105f2cce889a132faa9d7a5cdc8505b75965321 diff --git a/src/dialogs/DurableCookiesDialog.h b/src/dialogs/DurableCookiesDialog.h new file mode 100644 index 0000000..61ffe5f --- /dev/null +++ b/src/dialogs/DurableCookiesDialog.h @@ -0,0 +1,66 @@ +/* + * Copyright © 2022 Soren Stoutner . + * + * This file is part of 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. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with Privacy Browser PC. If not, see . + */ + +#ifndef DURABLECOOKIESDIALOG_H +#define DURABLECOOKIESDIALOG_H + +// Qt toolkit headers. +#include +#include +#include +#include + +class DurableCookiesDialog : public QDialog +{ + // Include the Q_OBJECT macro. + Q_OBJECT + +public: + // The default constructor. + explicit DurableCookiesDialog(); + +signals: + // The signals. + void addingCookie(const QNetworkCookie &cookie, const bool &addToDatabase) const; + void deletingCookie(const QNetworkCookie &cookie) const; + void updateParentUi() const; + +private Q_SLOTS: + // The private slots. + void addCookie() const; + void apply() const; + void beforeDelete(int row) const; + void beforeUpdate(int row, QSqlRecord &sqlRecord) const; + void deleteAllCookies() const; + void deleteCookie() const; + void newCookie(QSqlRecord &sqlRecord) const; + void ok(); + void reset() const; + void updateUi() const; + +private: + // The private variables. + QPushButton *applyButtonPointer; + QPushButton *deleteAllCookiesButtonPointer; + QPushButton *deleteCookieButtonPointer; + QSqlTableModel *durableCookiesTableModelPointer; + QItemSelectionModel *tableSelectionModelPointer; + QPushButton *resetButtonPointer; +}; +#endif