Falkon Develop
Cross-platform Qt-based web browser
fcm_notification.cpp
Go to the documentation of this file.
1/* ============================================================
2* FlashCookieManager plugin for Falkon
3* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "fcm_notification.h"
19#include "ui_fcm_notification.h"
20#include "iconprovider.h"
21#include "fcm_plugin.h"
22
23FCM_Notification::FCM_Notification(FCM_Plugin* manager, int newOriginsCount)
24 : AnimatedWidget(AnimatedWidget::Down, 300, nullptr)
25 , ui(new Ui::FCM_Notification)
26 , m_manager(manager)
27{
28 setAutoFillBackground(true);
29 ui->setupUi(widget());
30
31 ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton));
32
33 if (newOriginsCount == 1) {
34 ui->textLabel->setText(tr("A new flash cookie was detected"));
35 }
36 else {
37 ui->textLabel->setText(tr("%1 new flash cookies were detected").arg(newOriginsCount));
38 }
39 connect(ui->buttonView, SIGNAL(clicked()), m_manager, SLOT(showFlashCookieManager()));
40 connect(ui->buttonView, SIGNAL(clicked()), this, SLOT(hide()));
41 connect(ui->close, SIGNAL(clicked()), this, SLOT(hide()));
42
44}
45
47{
48 delete ui;
49}
QWidget * widget()
FCM_Notification(FCM_Plugin *manager, int newOriginsCount)
static QIcon standardIcon(QStyle::StandardPixmap icon)