Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/YoutubeDownload/yticon.cpp
- This file was added.
1 | #include "yticon.h" | ||||
---|---|---|---|---|---|
2 | | ||||
3 | YtIcon::YtIcon(QObject *parent) | ||||
4 | : AbstractButtonInterface(parent) | ||||
5 | { | ||||
6 | setIcon(QIcon::fromTheme(QSL("im-youtube"), QIcon(QSL(":ytdownload/data/icon.svg")))); | ||||
7 | setTitle(tr("Download video")); | ||||
8 | setToolTip(tr("Download video")); | ||||
9 | | ||||
10 | connect(this, &AbstractButtonInterface::clicked, this, &YtIcon::clicked); | ||||
11 | | ||||
12 | updateState(); | ||||
13 | } | ||||
14 | | ||||
15 | QString YtIcon::id() const | ||||
16 | { | ||||
17 | return QSL("youtube-download"); | ||||
18 | } | ||||
19 | | ||||
20 | QString YtIcon::name() const | ||||
21 | { | ||||
22 | return tr("Download Youtube"); | ||||
23 | } | ||||
24 | | ||||
25 | void YtIcon::updateState() | ||||
26 | { | ||||
27 | /* setVisible(m_manager->downloadsCount() > 0); | ||||
28 | const int count = m_manager->activeDownloadsCount(); | ||||
29 | if (count > 0) { | ||||
30 | setBadgeText(QString::number(count)); | ||||
31 | } else { | ||||
32 | setBadgeText(QString()); | ||||
33 | }*/ | ||||
34 | } | ||||
35 | | ||||
36 | void YtIcon::clicked(ClickController *controller) | ||||
37 | { | ||||
38 | Q_UNUSED(controller) | ||||
39 | | ||||
40 | //mApp->downloadManager()->show(); | ||||
41 | } |