PluginsList::PluginsList(QWidget* parent) : QWidget(parent) , ui(new Ui::PluginsList) { ui->setupUi(this); //Application Extensions refresh(); connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked())); connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*))); connect(ui->butLoad, SIGNAL(clicked()), this, SLOT(reloadPlugins())); connect(ui->allowAppPlugins, SIGNAL(clicked(bool)), this, SLOT(allowAppPluginsChanged(bool))); Settings settings; settings.beginGroup("Plugin-Settings"); ui->allowAppPlugins->setChecked(settings.value("EnablePlugins", DEFAULT_ENABLE_PLUGINS).toBool()); settings.endGroup(); allowAppPluginsChanged(ui->allowAppPlugins->isChecked()); //WebKit Plugins connect(ui->add, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->remove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->allowClick2Flash, SIGNAL(clicked(bool)), this, SLOT(allowC2FChanged(bool))); settings.beginGroup("ClickToFlash"); QStringList whitelist = mApp->plugins()->c2f_getWhiteList(); ui->allowClick2Flash->setChecked(settings.value("Enable", true).toBool()); settings.endGroup(); foreach(const QString & site, whitelist) { QTreeWidgetItem* item = new QTreeWidgetItem(ui->whitelist); item->setText(0, site); }
CookieManager::CookieManager(QWidget* parent) : QWidget(parent) , ui(new Ui::CookieManager) , m_refreshCookieJar(true) { ui->setupUi(this); qz_centerWidgetOnScreen(this); // Stored Cookies connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->search, SIGNAL(textChanged(QString)), ui->cookieTree, SLOT(filterString(QString))); // Cookie Filtering connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); ui->search->setPlaceholderText(tr("Search")); ui->cookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->cookieTree->sortItems(0, Qt::AscendingOrder); ui->cookieTree->header()->setDefaultSectionSize(220); ui->cookieTree->setFocus(); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); }
CookieManager::CookieManager(QWidget* parent) : QDialog(parent) , ui(new Ui::CookieManager) , m_refreshCookieJar(true) { ui->setupUi(this); QzTools::centerWidgetOnScreen(this); if (isRightToLeft()) { ui->cookieTree->headerItem()->setTextAlignment(0, Qt::AlignRight | Qt::AlignVCenter); ui->cookieTree->headerItem()->setTextAlignment(1, Qt::AlignRight | Qt::AlignVCenter); ui->cookieTree->setLayoutDirection(Qt::LeftToRight); ui->whiteList->setLayoutDirection(Qt::LeftToRight); ui->blackList->setLayoutDirection(Qt::LeftToRight); } // Stored Cookies connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); // Cookie Filtering connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); // Cookie Settings Settings settings; settings.beginGroup("Cookie-Settings"); ui->saveCookies->setChecked(settings.value("allowCookies", true).toBool()); if (!ui->saveCookies->isChecked()) { ui->deleteCookiesOnClose->setEnabled(false); } ui->deleteCookiesOnClose->setChecked(settings.value("deleteCookiesOnClose", false).toBool()); ui->allowThirdPartyCookies->setCurrentIndex(settings.value("allowThirdPartyCookies", 0).toInt()); ui->filterTracking->setChecked(settings.value("filterTrackingCookie", false).toBool()); settings.endGroup(); connect(ui->saveCookies, SIGNAL(toggled(bool)), this, SLOT(saveCookiesChanged(bool))); ui->search->setPlaceholderText(tr("Search")); ui->cookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->cookieTree->sortItems(0, Qt::AscendingOrder); ui->cookieTree->header()->setDefaultSectionSize(220); ui->cookieTree->setFocus(); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); QzTools::setWmClass("Cookies", this); refreshTable(); }
FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) : QDialog(parent, Qt::WindowStaysOnTopHint) , ui(new Ui::FCM_Dialog) , m_manager(manager) { ui->setupUi(this); QzTools::centerWidgetOnScreen(this); ui->path->hide(); ui->labelPath->hide(); if (isRightToLeft()) { ui->flashCookieTree->headerItem()->setTextAlignment(0, Qt::AlignRight | Qt::AlignVCenter); ui->flashCookieTree->setLayoutDirection(Qt::LeftToRight); ui->whiteList->setLayoutDirection(Qt::LeftToRight); ui->blackList->setLayoutDirection(Qt::LeftToRight); } connect(ui->flashCookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); connect(ui->reloadFromDisk, SIGNAL(clicked()), this, SLOT(reloadFromDisk())); connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); connect(ui->autoMode, SIGNAL(toggled(bool)), ui->notification, SLOT(setEnabled(bool))); connect(ui->autoMode, SIGNAL(toggled(bool)), ui->labelNotification, SLOT(setEnabled(bool))); connect(ui->browseFlashDataPath, SIGNAL(clicked()), this, SLOT(selectFlashDataPath())); ui->autoMode->setChecked(m_manager->readSettings().value("autoMode").toBool()); ui->notification->setEnabled(m_manager->readSettings().value("autoMode").toBool()); ui->notification->setChecked(m_manager->readSettings().value("notification").toBool()); ui->deleteAllOnStartExit->setChecked(m_manager->readSettings().value("deleteAllOnStartExit").toBool()); ui->flashDataPath->setText(m_manager->flashPlayerDataPath()); ui->labelNotification->setEnabled(ui->autoMode->isChecked()); ui->search->setPlaceholderText(tr("Search")); ui->flashCookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->flashCookieTree->sortItems(0, Qt::AscendingOrder); ui->flashCookieTree->header()->setDefaultSectionSize(220); ui->flashCookieTree->setFocus(); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); QzTools::setWmClass("FlashCookies", this); }
CookieManager::CookieManager(QWidget *parent) : QDialog(parent) , ui(new Ui::CookieManager) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); QzTools::centerWidgetOnScreen(this); if (isRightToLeft()) { ui->cookieTree->headerItem()->setTextAlignment(0, Qt::AlignRight | Qt::AlignVCenter); ui->cookieTree->headerItem()->setTextAlignment(1, Qt::AlignRight | Qt::AlignVCenter); ui->cookieTree->setLayoutDirection(Qt::LeftToRight); ui->whiteList->setLayoutDirection(Qt::LeftToRight); ui->blackList->setLayoutDirection(Qt::LeftToRight); } // Stored Cookies connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*))); connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll())); connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(remove())); connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); // Cookie Filtering connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist())); connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist())); connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist())); connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist())); // Cookie Settings Settings settings; settings.beginGroup("Cookie-Settings"); ui->saveCookies->setChecked(settings.value("allowCookies", true).toBool()); ui->filter3rdParty->setChecked(settings.value("filterThirdPartyCookies", false).toBool()); ui->filterTracking->setChecked(settings.value("filterTrackingCookie", false).toBool()); ui->deleteCookiesOnClose->setChecked(settings.value("deleteCookiesOnClose", false).toBool()); ui->whiteList->addItems(settings.value("whitelist", QStringList()).toStringList()); ui->blackList->addItems(settings.value("blacklist", QStringList()).toStringList()); settings.endGroup(); #if QT_VERSION < QT_VERSION_CHECK(5, 11, 0) ui->filter3rdParty->hide(); #endif ui->search->setPlaceholderText(tr("Search")); ui->cookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->cookieTree->sortItems(0, Qt::AscendingOrder); ui->cookieTree->header()->setDefaultSectionSize(220); ui->cookieTree->setFocus(); QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this); connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed())); connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString))); connect(mApp->cookieJar(), &CookieJar::cookieAdded, this, &CookieManager::addCookie); connect(mApp->cookieJar(), &CookieJar::cookieRemoved, this, &CookieManager::removeCookie); // Load cookies foreach (const QNetworkCookie &cookie, mApp->cookieJar()->getAllCookies()) addCookie(cookie); QzTools::setWmClass("Cookies", this); }