source: smplayer/trunk/src/sharedialog.cpp@ 165

Last change on this file since 165 was 165, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to latest 0.8.7

File size: 3.1 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
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 <QDesktopServices>
21#include <QUrl>
22
23ShareDialog::ShareDialog( QWidget* parent, Qt::WindowFlags f )
24 : QDialog(parent, f)
25 , actions_taken(0)
26{
27 setupUi(this);
28
29 donate_button->setIcon(QPixmap(":/icons-png/paypal.png"));
30 donate_button->setIconSize(QSize(64,64));
31 donate_button->setText(tr("Donate with Paypal"));
32 donate_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
33
34 facebook_button->setIcon(QPixmap(":/icons-png/social_facebook.png"));
35 facebook_button->setIconSize(QSize(64,64));
36 facebook_button->setText("Facebook");
37 facebook_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
38
39 twitter_button->setIcon(QPixmap(":/icons-png/social_twitter.png"));
40 twitter_button->setIconSize(QSize(64,64));
41 twitter_button->setText("Twitter");
42 twitter_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
43
44 intro_label->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:16pt;\">" +
45 tr("You can support SMPlayer by sending a donation or sharing it with your friends.") + "</span></p></body></html>");
46
47 setMinimumSize(QSize(435, 226));
48
49 adjustSize();
50 //layout()->setSizeConstraint(QLayout::SetFixedSize);
51
52 share_text = QString("SMPlayer - Free Media Player with built-in codecs that can play and download Youtube videos").replace(" ","+");
53 share_url = "http://smplayer.sourceforge.net";
54}
55
56ShareDialog::~ShareDialog() {
57}
58
59bool ShareDialog::isRemindChecked() {
60 return remind_check->isChecked();
61}
62
63void ShareDialog::showRemindCheck(bool b) {
64 check_widget->setVisible(b);
65 adjustSize();
66}
67
68void ShareDialog::on_donate_button_clicked() {
69 qDebug("ShareDialog::on_donate_button_clicked");
70 actions_taken |= Donate;
71 QDesktopServices::openUrl(QUrl("http://sourceforge.net/donate/index.php?group_id=185512"));
72}
73
74void ShareDialog::on_facebook_button_clicked() {
75 qDebug("ShareDialog::on_facebook_button_clicked");
76 actions_taken |= Facebook;
77 QDesktopServices::openUrl(QUrl("http://www.facebook.com/sharer.php?u=" + share_url + "&t=" + share_text));
78}
79
80void ShareDialog::on_twitter_button_clicked() {
81 qDebug("ShareDialog::on_twitter_button_clicked");
82 actions_taken |= Twitter;
83 QDesktopServices::openUrl(QUrl("http://twitter.com/intent/tweet?text=" + share_text + "&url=" + share_url + "/&via=smplayer_dev"));
84}
85
86#include "moc_sharedialog.cpp"
Note: See TracBrowser for help on using the repository browser.