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
23
GM_Icon::GM_Icon
(
GM_Manager
*manager)
24
:
AbstractButtonInterface
(manager)
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
34
QString
GM_Icon::id
()
const
35
{
36
return
QSL
(
"greasemonkey-icon"
);
37
}
38
39
QString
GM_Icon::name
()
const
40
{
41
return
tr(
"GreaseMonkey Icon"
);
42
}
43
44
void
GM_Icon::openSettings()
45
{
46
m_manager->
showSettings
(
webView
());
47
}
AbstractButtonInterface
Definition:
abstractbuttoninterface.h:30
AbstractButtonInterface::clicked
void clicked(AbstractButtonInterface::ClickController *controller)
AbstractButtonInterface::webView
WebView * webView() const
Definition:
abstractbuttoninterface.cpp:116
AbstractButtonInterface::setTitle
void setTitle(const QString &text)
Definition:
abstractbuttoninterface.cpp:65
AbstractButtonInterface::setToolTip
void setToolTip(const QString &toolTip)
Definition:
abstractbuttoninterface.cpp:80
AbstractButtonInterface::setIcon
void setIcon(const QIcon &icon)
Definition:
abstractbuttoninterface.cpp:95
GM_Icon::GM_Icon
GM_Icon(GM_Manager *manager)
Definition:
gm_icon.cpp:23
GM_Icon::name
QString name() const override
Definition:
gm_icon.cpp:39
GM_Icon::id
QString id() const override
Definition:
gm_icon.cpp:34
GM_Manager
Definition:
gm_manager.h:36
GM_Manager::showSettings
void showSettings(QWidget *parent)
Definition:
gm_manager.cpp:55
gm_icon.h
gm_manager.h
QSL
#define QSL(x)
Definition:
qzcommon.h:40
webview.h
src
plugins
GreaseMonkey
gm_icon.cpp
Generated by
1.9.3