Falkon Develop
Cross-platform Qt-based web browser
gm_icon.cpp
Go to the documentation of this file.
1/* ============================================================
2* GreaseMonkey plugin for Falkon
3* Copyright (C) 2013-2018 David Rosca <nowrep@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 "gm_icon.h"
19#include "gm_manager.h"
20
21#include "webview.h"
22
25 , m_manager(manager)
26{
27 setIcon(QIcon(QSL(":gm/data/icon.svg")));
28 setTitle(tr("GreaseMonkey"));
29 setToolTip(tr("Open GreaseMonkey settings"));
30
31 connect(this, &AbstractButtonInterface::clicked, this, &GM_Icon::openSettings);
32}
33
34QString GM_Icon::id() const
35{
36 return QSL("greasemonkey-icon");
37}
38
39QString GM_Icon::name() const
40{
41 return tr("GreaseMonkey Icon");
42}
43
44void GM_Icon::openSettings()
45{
46 m_manager->showSettings(webView());
47}
void clicked(AbstractButtonInterface::ClickController *controller)
void setTitle(const QString &text)
void setToolTip(const QString &toolTip)
void setIcon(const QIcon &icon)
GM_Icon(GM_Manager *manager)
Definition: gm_icon.cpp:23
QString name() const override
Definition: gm_icon.cpp:39
QString id() const override
Definition: gm_icon.cpp:34
void showSettings(QWidget *parent)
Definition: gm_manager.cpp:55
#define QSL(x)
Definition: qzcommon.h:40