1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
--- minitube-2.9.orig/minitube.pro 2017-11-27 13:23:35.000000000 -0500
+++ minitube-2.9/minitube.pro 2018-02-07 01:06:02.051910062 -0500
@@ -104,7 +104,6 @@
src/exlineedit.h \
src/channellistview.h \
src/httputils.h \
- src/appwidget.h \
src/clickablelabel.h \
src/ytvideo.h \
src/toolbarmenu.h \
@@ -178,7 +177,6 @@
src/exlineedit.cpp \
src/channellistview.cpp \
src/httputils.cpp \
- src/appwidget.cpp \
src/clickablelabel.cpp \
src/ytvideo.cpp \
src/toolbarmenu.cpp \
--- minitube-2.9.orig/src/aboutview.cpp 2017-11-27 13:23:35.000000000 -0500
+++ minitube-2.9/src/aboutview.cpp 2018-02-07 01:08:29.768705041 -0500
@@ -32,7 +32,6 @@
#endif
#include "fontutils.h"
#include "iconutils.h"
-#include "appwidget.h"
#include "clickablelabel.h"
#include "mainwindow.h"
@@ -116,8 +115,6 @@
buttonLayout->addWidget(closeButton);
layout->addLayout(buttonLayout);
-
- verticalLayout->addWidget(new AppsWidget());
}
void AboutView::appear() {
--- minitube-2.9.orig/src/appwidget.cpp 2017-11-27 13:23:35.000000000 -0500
+++ minitube-2.9/src/appwidget.cpp 1969-12-31 19:00:00.000000000 -0500
@@ -1,112 +0,0 @@
-#include "appwidget.h"
-#include "constants.h"
-#include "http.h"
-#ifdef APP_EXTRA
-#include "updatedialog.h"
-#endif
-
-AppsWidget::AppsWidget(QWidget *parent) : QWidget(parent) {
- const int padding = 30;
-
- QBoxLayout *layout = new QHBoxLayout(this);
- layout->setMargin(padding);
- layout->setSpacing(padding*2);
- layout->setAlignment(Qt::AlignCenter);
-
-#ifdef APP_MAC
- const QString ext = "dmg";
-#elif defined APP_WIN
- const QString ext = "exe";
-#else
- const QString ext = "deb";
-#endif
-
- setupApp("Finetune", "finetune." + ext);
- setupApp("Musictube", "musictube." + ext);
- setupApp("Musique", "musique." + ext);
-}
-
-void AppsWidget::setupApp(const QString &name, const QString &code) {
- AppWidget *w = new AppWidget(name, code);
- layout()->addWidget(w);
-}
-
-void AppsWidget::paintEvent(QPaintEvent *e) {
- Q_UNUSED(e);
- QStyleOption o;
- o.initFrom(this);
- QPainter p(this);
- style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
-}
-
-AppWidget::AppWidget(const QString &name, const QString &code, QWidget *parent) : QWidget(parent), icon(0), name(name), downloadButton(0) {
- const QString unixName = code.left(code.lastIndexOf('.'));
- const QString baseUrl = QLatin1String("http://") + Constants::ORG_DOMAIN;
- const QString filesUrl = baseUrl + QLatin1String("/files/");
- url = filesUrl + unixName + QLatin1String("/") + code;
- webPage = baseUrl + QLatin1String("/") + unixName;
-
- QBoxLayout *layout = new QVBoxLayout(this);
- layout->setMargin(0);
- layout->setAlignment(Qt::AlignHCenter);
-
- icon = new QLabel();
- icon->setMinimumHeight(128);
- layout->addWidget(icon);
- const QString iconUrl = filesUrl + QLatin1String("products/") + unixName + QLatin1String(".png");
- QObject *reply = Http::instance().get(iconUrl);
- connect(reply, SIGNAL(data(QByteArray)), SLOT(iconDownloaded(QByteArray)));
-
- QLabel *appTitle = new QLabel(name);
- appTitle->setAlignment(Qt::AlignHCenter);
- layout->addWidget(appTitle);
-
-#ifdef APP_EXTRA
-#if !defined(APP_UBUNTU) && !defined(APP_MAC_STORE)
- downloadButton = new QPushButton(tr("Download"));
- downloadButton->setAttribute(Qt::WA_MacSmallSize);
- downloadButton->setCursor(Qt::ArrowCursor);
- QSizePolicy sp = downloadButton->sizePolicy();
- sp.setHorizontalPolicy(QSizePolicy::Fixed);
- sp.setRetainSizeWhenHidden(true);
- downloadButton->setSizePolicy(sp);
- connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadApp()));
- layout->addWidget(downloadButton, Qt::AlignHCenter);
- layout->setAlignment(downloadButton, Qt::AlignHCenter);
- downloadButton->hide();
-#endif
-#endif
-
- setCursor(Qt::PointingHandCursor);
-}
-
-void AppWidget::enterEvent(QEvent *e) {
- Q_UNUSED(e);
- if (downloadButton) downloadButton->show();
-}
-
-void AppWidget::leaveEvent(QEvent *e) {
- Q_UNUSED(e);
- if (downloadButton) downloadButton->hide();
-}
-
-void AppWidget::mouseReleaseEvent(QMouseEvent *e) {
- if (e->button() == Qt::LeftButton) {
- QDesktopServices::openUrl(webPage);
- }
-}
-
-void AppWidget::iconDownloaded(const QByteArray &bytes) {
- QPixmap pixmap;
- pixmap.loadFromData(bytes, "PNG");
- icon->setPixmap(pixmap);
-}
-
-void AppWidget::downloadApp() {
-#ifdef APP_EXTRA
- if (!icon) return;
- UpdateDialog *dialog = new UpdateDialog(icon->pixmap(), name, QString(), url, this);
- dialog->downloadUpdate();
- dialog->show();
-#endif
-}
--- minitube-2.9.orig/src/appwidget.h 2017-11-27 13:23:35.000000000 -0500
+++ minitube-2.9/src/appwidget.h 1969-12-31 19:00:00.000000000 -0500
@@ -1,46 +0,0 @@
-#ifndef APPWIDGET_H
-#define APPWIDGET_H
-
-#include <QtWidgets>
-
-
-class AppWidget : public QWidget {
-
- Q_OBJECT
-
-public:
- AppWidget(const QString &name, const QString &code, QWidget *parent = 0);
- QLabel *icon;
-
-protected:
- void enterEvent(QEvent *e);
- void leaveEvent(QEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
-
-private slots:
- void iconDownloaded(const QByteArray &bytes);
- void downloadApp();
-
-private:
- QPushButton *downloadButton;
- QString name;
- QString url;
- QString webPage;
-};
-
-class AppsWidget : public QWidget {
-
- Q_OBJECT
-
-public:
- AppsWidget(QWidget *parent = 0);
-
-protected:
- void paintEvent(QPaintEvent *e);
-
-private:
- void setupApp(const QString &name, const QString &code);
-
-};
-
-#endif // APPWIDGET_H
|