1 /*  smplayer, GUI front-end for mplayer.
2     Copyright (C) 2006-2021 Ricardo Villalba <ricardo@smplayer.info>
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18 
19 #include "sharedialog.h"
20 #include "sharedata.h"
21 #include "images.h"
22 #include "links.h"
23 #include <QDesktopServices>
24 
ShareDialog(QWidget * parent,Qt::WindowFlags f)25 ShareDialog::ShareDialog( QWidget* parent, Qt::WindowFlags f )
26 	: QDialog(parent, f)
27 	, actions_taken(0)
28 {
29 	setupUi(this);
30 
31 	donate_button->setIcon(Images::icon("paypal"));
32 	donate_button->setIconSize(QSize(64,64));
33 	donate_button->setText(tr("Donate with PayPal"));
34 	donate_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
35 
36 	facebook_button->setIcon(Images::icon("social_facebook"));
37 	facebook_button->setIconSize(QSize(64,64));
38 	facebook_button->setText("Facebook");
39 	facebook_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
40 
41 	twitter_button->setIcon(Images::icon("social_twitter"));
42 	twitter_button->setIconSize(QSize(64,64));
43 	twitter_button->setText("Twitter");
44 	twitter_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
45 
46 	intro_label->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:16pt;\">" +
47 		tr("You can support SMPlayer by sending a donation or sharing it with your friends.") + "</span></p></body></html>");
48 
49 	setMinimumSize(QSize(435, 226));
50 
51 	adjustSize();
52 	//layout()->setSizeConstraint(QLayout::SetFixedSize);
53 
54 	share_url = URL_HOMEPAGE;
55 }
56 
~ShareDialog()57 ShareDialog::~ShareDialog() {
58 }
59 
isRemindChecked()60 bool ShareDialog::isRemindChecked() {
61 	return remind_check->isChecked();
62 }
63 
showRemindCheck(bool b)64 void ShareDialog::showRemindCheck(bool b) {
65 	check_widget->setVisible(b);
66 	adjustSize();
67 }
68 
on_donate_button_clicked()69 void ShareDialog::on_donate_button_clicked() {
70 	qDebug("ShareDialog::on_donate_button_clicked");
71 	actions_taken |= ShareData::Donate;
72 	QDesktopServices::openUrl(ShareData::donateUrl());
73 }
74 
on_facebook_button_clicked()75 void ShareDialog::on_facebook_button_clicked() {
76 	qDebug("ShareDialog::on_facebook_button_clicked");
77 	actions_taken |= ShareData::Facebook;
78 	QDesktopServices::openUrl(ShareData::facebookUrl());
79 }
80 
on_twitter_button_clicked()81 void ShareDialog::on_twitter_button_clicked() {
82 	qDebug("ShareDialog::on_twitter_button_clicked");
83 	actions_taken |= ShareData::Twitter;
84 	QDesktopServices::openUrl(ShareData::twitterUrl());
85 }
86 
87 #include "moc_sharedialog.cpp"
88