PageRenderTime 52ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/patches/0001-remove-nagware-code.patch

https://codeberg.org/EULA/Snippets
Patch | 460 lines | 433 code | 27 blank | 0 comment | 0 complexity | 3ceb5834b4f03e97d0fc379ecfd62c0d MD5 | raw file
Possible License(s): Unlicense
  1. diff --git a/src/basegui.cpp b/src/basegui.cpp
  2. index 29064618..777d99c0 100644
  3. --- a/src/basegui.cpp
  4. +++ b/src/basegui.cpp
  5. @@ -132,14 +132,6 @@
  6. #endif
  7. #endif
  8. -#ifdef SHARE_ACTIONS
  9. -#include "sharedialog.h"
  10. -#endif
  11. -
  12. -#ifdef SHARE_WIDGET
  13. -#include "sharewidget.h"
  14. -#endif
  15. -
  16. #ifdef AUTO_SHUTDOWN_PC
  17. #include "shutdowndialog.h"
  18. #include "shutdown.h"
  19. @@ -260,10 +252,6 @@ BaseGui::BaseGui( QWidget* parent, Qt::WindowFlags flags )
  20. QTimer::singleShot(2000, this, SLOT(checkIfUpgraded()));
  21. #endif
  22. -#ifdef DONATE_REMINDER
  23. - QTimer::singleShot(1000, this, SLOT(checkReminder()));
  24. -#endif
  25. -
  26. #ifdef MPRIS2
  27. if (pref->use_mpris2) new Mpris2(this, this);
  28. #endif
  29. @@ -918,33 +906,10 @@ void BaseGui::createActions() {
  30. connect( showConfigAct, SIGNAL(triggered()),
  31. this, SLOT(helpShowConfig()) );
  32. - donateAct = new MyAction( this, "donate" );
  33. - connect( donateAct, SIGNAL(triggered()),
  34. - this, SLOT(helpDonate()) );
  35. -
  36. aboutThisAct = new MyAction( this, "about_smplayer" );
  37. connect( aboutThisAct, SIGNAL(triggered()),
  38. this, SLOT(helpAbout()) );
  39. -#ifdef SHARE_MENU
  40. - facebookAct = new MyAction (this, "facebook");
  41. - twitterAct = new MyAction (this, "twitter");
  42. - gmailAct = new MyAction (this, "gmail");
  43. - hotmailAct = new MyAction (this, "hotmail");
  44. - yahooAct = new MyAction (this, "yahoo");
  45. -
  46. - connect( facebookAct, SIGNAL(triggered()),
  47. - this, SLOT(shareSMPlayer()) );
  48. - connect( twitterAct, SIGNAL(triggered()),
  49. - this, SLOT(shareSMPlayer()) );
  50. - connect( gmailAct, SIGNAL(triggered()),
  51. - this, SLOT(shareSMPlayer()) );
  52. - connect( hotmailAct, SIGNAL(triggered()),
  53. - this, SLOT(shareSMPlayer()) );
  54. - connect( yahooAct, SIGNAL(triggered()),
  55. - this, SLOT(shareSMPlayer()) );
  56. -#endif
  57. -
  58. // OSD
  59. incOSDScaleAct = new MyAction(Qt::SHIFT | Qt::Key_U, this, "inc_osd_scale");
  60. connect(incOSDScaleAct, SIGNAL(triggered()), core, SLOT(incOSDScale()));
  61. @@ -1872,21 +1837,8 @@ void BaseGui::retranslateStrings() {
  62. #endif
  63. showConfigAct->change( Images::icon("show_config"), tr("&Open configuration folder") );
  64. -#ifdef SHARE_ACTIONS
  65. - donateAct->change( Images::icon("donate"), tr("&Donate / Share with your friends") );
  66. -#else
  67. - donateAct->change( Images::icon("donate"), tr("&Donate") );
  68. -#endif
  69. aboutThisAct->change( Images::icon("logo"), tr("About &SMPlayer") );
  70. -#ifdef SHARE_MENU
  71. - facebookAct->change("&Facebook");
  72. - twitterAct->change("&Twitter");
  73. - gmailAct->change("&Gmail");
  74. - hotmailAct->change("&Hotmail");
  75. - yahooAct->change("&Yahoo!");
  76. -#endif
  77. -
  78. // OSD
  79. incOSDScaleAct->change(tr("Size &+"));
  80. decOSDScaleAct->change(tr("Size &-"));
  81. @@ -2171,11 +2123,6 @@ void BaseGui::retranslateStrings() {
  82. osd_menu->menuAction()->setText( tr("&OSD") );
  83. osd_menu->menuAction()->setIcon( Images::icon("osd") );
  84. -#ifdef SHARE_MENU
  85. - share_menu->menuAction()->setText( tr("S&hare SMPlayer with your friends") );
  86. - share_menu->menuAction()->setIcon( Images::icon("share") );
  87. -#endif
  88. -
  89. #if defined(LOG_MPLAYER) || defined(LOG_SMPLAYER)
  90. //logs_menu->menuAction()->setText( tr("&View logs") );
  91. //logs_menu->menuAction()->setIcon( Images::icon("logs") );
  92. @@ -2355,14 +2302,6 @@ void BaseGui::createMplayerWindow() {
  93. mplayerwindow->setAnimatedLogo( pref->animated_logo);
  94. #endif
  95. -#ifdef SHARE_WIDGET
  96. - sharewidget = new ShareWidget(Global::settings, mplayerwindow);
  97. - mplayerwindow->setCornerWidget(sharewidget);
  98. - //#ifdef SHARE_ACTIONS
  99. - connect(sharewidget, SIGNAL(supportClicked()), this, SLOT(helpDonate()));
  100. - //#endif
  101. -#endif
  102. -
  103. QVBoxLayout * layout = new QVBoxLayout;
  104. layout->setSpacing(0);
  105. layout->setMargin(0);
  106. @@ -2747,16 +2686,6 @@ void BaseGui::createMenus() {
  107. osd_menu->addAction(OSDFractionsAct);
  108. #endif
  109. - // Share submenu
  110. - #ifdef SHARE_MENU
  111. - share_menu = new QMenu(this);
  112. - share_menu->addAction(facebookAct);
  113. - share_menu->addAction(twitterAct);
  114. - share_menu->addAction(gmailAct);
  115. - share_menu->addAction(hotmailAct);
  116. - share_menu->addAction(yahooAct);
  117. - #endif
  118. -
  119. // MENUS
  120. openMenu = menuBar()->addMenu("Open");
  121. playMenu = menuBar()->addMenu("Play");
  122. @@ -3010,12 +2939,6 @@ void BaseGui::populateMainMenu() {
  123. optionsMenu->addAction(tabletModeAct);
  124. // HELP MENU
  125. - #ifdef SHARE_MENU
  126. - if (!pref->tablet_mode) {
  127. - helpMenu->addMenu(share_menu);
  128. - helpMenu->addSeparator();
  129. - }
  130. - #endif
  131. if (!pref->tablet_mode) {
  132. helpMenu->addAction(showFirstStepsAct);
  133. helpMenu->addAction(showFAQAct);
  134. @@ -3031,7 +2954,6 @@ void BaseGui::populateMainMenu() {
  135. helpMenu->addAction(showConfigAct);
  136. helpMenu->addSeparator();
  137. }
  138. - helpMenu->addAction(donateAct);
  139. helpMenu->addSeparator();
  140. helpMenu->addAction(aboutThisAct);
  141. @@ -4521,112 +4443,11 @@ void BaseGui::helpShowConfig() {
  142. QDesktopServices::openUrl(QUrl::fromLocalFile(Paths::configPath()));
  143. }
  144. -#ifdef SHARE_ACTIONS
  145. -void BaseGui::helpDonate() {
  146. - ShareDialog d(this);
  147. - d.showRemindCheck(false);
  148. -
  149. - #ifdef SHARE_WIDGET
  150. - d.setActions(sharewidget->actions());
  151. - #endif
  152. -
  153. - d.exec();
  154. - int action = d.actions();
  155. - qDebug("BaseGui::helpDonate: action: %d", action);
  156. -
  157. - if (action > 0) {
  158. - #ifdef SHARE_WIDGET
  159. - sharewidget->setActions(action);
  160. - #else
  161. - QSettings * set = Global::settings;
  162. - set->beginGroup("reminder");
  163. - set->setValue("action", action);
  164. - set->endGroup();
  165. - #endif
  166. - }
  167. -}
  168. -#else
  169. -void BaseGui::helpDonate() {
  170. - qDebug("BaseGui::helpDonate");
  171. -
  172. - int action = 0;
  173. - bool accepted;
  174. - showHelpDonateDialog(&accepted);
  175. - if (accepted) action = 1;
  176. -
  177. - if (action > 0) {
  178. - QSettings * set = Global::settings;
  179. - set->beginGroup("reminder");
  180. - set->setValue("action", action);
  181. - set->endGroup();
  182. - }
  183. -}
  184. -
  185. -void BaseGui::showHelpDonateDialog(bool * accepted) {
  186. - bool result = false;
  187. -
  188. - QMessageBox d(this);
  189. - d.setIconPixmap(Images::icon("donate"));
  190. - d.setWindowTitle(tr("Support SMPlayer"));
  191. -
  192. - QPushButton * ok_button = d.addButton(tr("Donate"), QMessageBox::YesRole);
  193. - d.addButton(tr("No"), QMessageBox::NoRole);
  194. - d.setDefaultButton(ok_button);
  195. -
  196. - d.setText("<h1>" + tr("SMPlayer needs you") + "</h1><p>" +
  197. - tr("SMPlayer is free software. However the development requires a lot of time and a lot of work.") + "<p>" +
  198. - tr("In order to keep developing SMPlayer with new features we need your help.") + "<p>" +
  199. - tr("Please consider to support the SMPlayer project by sending a donation.") + " " +
  200. - tr("Even the smallest amount will help a lot.")
  201. - );
  202. - d.exec();
  203. - if (d.clickedButton() == ok_button) {
  204. - QDesktopServices::openUrl(QUrl(URL_DONATE));
  205. - result = true;
  206. - }
  207. - if (accepted != 0) *accepted = result;
  208. -}
  209. -#endif
  210. -
  211. void BaseGui::helpAbout() {
  212. About d(this);
  213. d.exec();
  214. }
  215. -#ifdef SHARE_MENU
  216. -void BaseGui::shareSMPlayer() {
  217. - QString text = QString("SMPlayer - Free Media Player with built-in codecs that can play and download Youtube videos").replace(" ","+");
  218. - QString url = URL_HOMEPAGE;
  219. -
  220. - if (sender() == twitterAct) {
  221. - QDesktopServices::openUrl(QUrl("http://twitter.com/intent/tweet?text=" + text + "&url=" + url + "/&via=smplayer_dev"));
  222. - }
  223. - else
  224. - if (sender() == gmailAct) {
  225. - QDesktopServices::openUrl(QUrl("https://mail.google.com/mail/?view=cm&fs=1&to&su=" + text + "&body=" + url + "&ui=2&tf=1&shva=1"));
  226. - }
  227. - else
  228. - if (sender() == yahooAct) {
  229. - QDesktopServices::openUrl(QUrl("http://compose.mail.yahoo.com/?To=&Subject=" + text + "&body=" + url));
  230. - }
  231. - else
  232. - if (sender() == hotmailAct) {
  233. - QDesktopServices::openUrl(QUrl("http://www.hotmail.msn.com/secure/start?action=compose&to=&subject=" + text + "&body=" + url));
  234. - }
  235. - else
  236. - if (sender() == facebookAct) {
  237. - QDesktopServices::openUrl(QUrl("http://www.facebook.com/sharer.php?u=" + url + "&t=" + text));
  238. -
  239. - #ifdef SHARE_ACTIONS
  240. - QSettings * set = Global::settings;
  241. - set->beginGroup("reminder");
  242. - set->setValue("action", 2);
  243. - set->endGroup();
  244. - #endif
  245. - }
  246. -}
  247. -#endif
  248. -
  249. void BaseGui::showGotoDialog() {
  250. TimeDialog d(this);
  251. d.setLabel(tr("&Jump to:"));
  252. @@ -5014,57 +4835,6 @@ void BaseGui::checkIfUpgraded() {
  253. }
  254. #endif
  255. -#ifdef DONATE_REMINDER
  256. -void BaseGui::checkReminder() {
  257. - qDebug("BaseGui::checkReminder");
  258. -
  259. - if (core->state() == Core::Playing) return;
  260. -
  261. - QSettings * set = Global::settings;
  262. - set->beginGroup("reminder");
  263. - int count = set->value("count", 0).toInt();
  264. - count++;
  265. - set->setValue("count", count);
  266. - int action = set->value("action", 0).toInt();
  267. - bool dont_show = set->value("dont_show_anymore", false).toBool();
  268. - set->endGroup();
  269. -
  270. -#if 1
  271. - if (dont_show) return;
  272. -
  273. - if (action != 0) return;
  274. - if ((count != 25) && (count != 45)) return;
  275. -#endif
  276. -
  277. -#ifdef SHARE_ACTIONS
  278. - ShareDialog d(this);
  279. - //d.showRemindCheck(false);
  280. - d.exec();
  281. - action = d.actions();
  282. - qDebug("BaseGui::checkReminder: action: %d", action);
  283. -
  284. - if (!d.isRemindChecked()) {
  285. - set->beginGroup("reminder");
  286. - set->setValue("dont_show_anymore", true);
  287. - set->endGroup();
  288. - }
  289. -#else
  290. - action = 0;
  291. - bool accepted;
  292. - showHelpDonateDialog(&accepted);
  293. - if (accepted) action = 1;
  294. -#endif
  295. -
  296. - if (action > 0) {
  297. - set->beginGroup("reminder");
  298. - set->setValue("action", action);
  299. - set->endGroup();
  300. - }
  301. -
  302. - //qDebug() << "size:" << d.size();
  303. -}
  304. -#endif
  305. -
  306. #ifdef YOUTUBE_SUPPORT
  307. void BaseGui::YTNoSslSupport() {
  308. qDebug("BaseGui::YTNoSslSupport");
  309. diff --git a/src/basegui.h b/src/basegui.h
  310. index 272220cb..0547e882 100644
  311. --- a/src/basegui.h
  312. +++ b/src/basegui.h
  313. @@ -36,7 +36,6 @@
  314. #define MG_DELAYED_SEEK
  315. #endif
  316. -//#define SHARE_MENU
  317. //#define DETECT_MINIMIZE_WORKAROUND
  318. #if !defined(Q_OS_WIN) && QT_VERSION >= 0x050000 && QT_VERSION < 0x050501
  319. @@ -69,14 +68,6 @@ class Favorites;
  320. class TVList;
  321. class UpdateChecker;
  322. -#ifdef SHARE_WIDGET
  323. -class ShareWidget;
  324. -#endif
  325. -
  326. -#ifndef SHARE_WIDGET
  327. -#define DONATE_REMINDER
  328. -#endif
  329. -
  330. class BaseGui : public QMainWindow
  331. {
  332. Q_OBJECT
  333. @@ -129,17 +120,9 @@ public slots:
  334. virtual void helpFAQ();
  335. virtual void helpCLOptions();
  336. virtual void helpCheckUpdates();
  337. - virtual void helpDonate();
  338. -#ifndef SHARE_ACTIONS
  339. - void showHelpDonateDialog(bool * accepted = 0);
  340. -#endif
  341. virtual void helpShowConfig();
  342. virtual void helpAbout();
  343. -#ifdef SHARE_MENU
  344. - virtual void shareSMPlayer();
  345. -#endif
  346. -
  347. virtual void loadSub();
  348. virtual void loadAudioFile(); // Load external audio file
  349. @@ -245,10 +228,6 @@ protected slots:
  350. void checkIfUpgraded();
  351. #endif
  352. -#ifdef DONATE_REMINDER
  353. - void checkReminder();
  354. -#endif
  355. -
  356. #ifdef YOUTUBE_SUPPORT
  357. void YTNoSslSupport();
  358. void YTNoSignature(const QString &);
  359. @@ -577,17 +556,8 @@ protected:
  360. MyAction * updateYTAct;
  361. #endif
  362. MyAction * showConfigAct;
  363. - MyAction * donateAct;
  364. MyAction * aboutThisAct;
  365. -#ifdef SHARE_MENU
  366. - MyAction * facebookAct;
  367. - MyAction * twitterAct;
  368. - MyAction * gmailAct;
  369. - MyAction * hotmailAct;
  370. - MyAction * yahooAct;
  371. -#endif
  372. -
  373. // OSD
  374. MyAction * incOSDScaleAct;
  375. MyAction * decOSDScaleAct;
  376. @@ -842,10 +812,6 @@ protected:
  377. QMenu * closed_captions_menu;
  378. QMenu * subfps_menu;
  379. -#ifdef SHARE_MENU
  380. - QMenu * share_menu;
  381. -#endif
  382. -
  383. QMenu * popup;
  384. QMenu * recentfiles_menu;
  385. QMenu * access_menu;
  386. @@ -884,10 +850,6 @@ protected:
  387. UpdateChecker * update_checker;
  388. #endif
  389. -#ifdef SHARE_WIDGET
  390. - ShareWidget * sharewidget;
  391. -#endif
  392. -
  393. QStringList actions_list;
  394. QString pending_actions_to_run;
  395. diff --git a/src/smplayer.pro b/src/smplayer.pro
  396. index e3b224ee..3a7ad4f1 100644
  397. --- a/src/smplayer.pro
  398. +++ b/src/smplayer.pro
  399. @@ -42,10 +42,6 @@ DEFINES += MPLAYER_SUPPORT
  400. # (requires MPLAYER_SUPPORT)
  401. DEFINES += MPLAYER2_SUPPORT
  402. -# OBSOLETE:
  403. -#DEFINES += SHARE_ACTIONS
  404. -#DEFINES += SHARE_WIDGET
  405. -
  406. # If Qt >= 5.4
  407. greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 3) {
  408. DEFINES += HDPI_SUPPORT
  409. @@ -66,8 +62,6 @@ contains( DEFINES, SIMPLE_BUILD ) {
  410. DEFINES -= MPRIS2
  411. DEFINES -= UPDATE_CHECKER
  412. DEFINES -= CHECK_UPGRADED
  413. - DEFINES -= SHARE_ACTIONS
  414. - DEFINES -= SHARE_WIDGET
  415. DEFINES -= AUTO_SHUTDOWN_PC
  416. DEFINES -= BOOKMARKS
  417. DEFINES -= TV_SUPPORT
  418. @@ -510,17 +504,6 @@ contains( DEFINES, VIDEOPREVIEW ) {
  419. }
  420. -contains( DEFINES, SHARE_ACTIONS ) {
  421. - HEADERS += sharedialog.h
  422. - SOURCES += sharedialog.cpp
  423. - FORMS += sharedialog.ui
  424. -}
  425. -
  426. -contains( DEFINES, SHARE_WIDGET|SHARE_ACTIONS ) {
  427. - HEADERS += sharewidget.h sharedata.h
  428. - SOURCES += sharewidget.cpp sharedata.cpp
  429. -}
  430. -
  431. contains( DEFINES, AUTO_SHUTDOWN_PC ) {
  432. HEADERS += shutdowndialog.h shutdown.h
  433. SOURCES += shutdowndialog.cpp shutdown.cpp