Changeset 175 for smplayer/vendor/current/src/sharedialog.cpp
- Timestamp:
- May 3, 2016, 2:14:41 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/sharedialog.cpp
r168 r175 1 1 /* smplayer, GUI front-end for mplayer. 2 Copyright (C) 2006-201 4Ricardo Villalba <rvm@users.sourceforge.net>2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net> 3 3 4 4 This program is free software; you can redistribute it and/or modify … … 18 18 19 19 #include "sharedialog.h" 20 #include "sharedata.h" 21 #include "images.h" 22 #include "links.h" 20 23 #include <QDesktopServices> 21 #include <QUrl>22 24 23 25 ShareDialog::ShareDialog( QWidget* parent, Qt::WindowFlags f ) … … 27 29 setupUi(this); 28 30 29 donate_button->setIcon( QPixmap(":/icons-png/paypal.png"));31 donate_button->setIcon(Images::icon("paypal")); 30 32 donate_button->setIconSize(QSize(64,64)); 31 donate_button->setText(tr("Donate with Pay pal"));33 donate_button->setText(tr("Donate with PayPal")); 32 34 donate_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 33 35 34 facebook_button->setIcon( QPixmap(":/icons-png/social_facebook.png"));36 facebook_button->setIcon(Images::icon("social_facebook")); 35 37 facebook_button->setIconSize(QSize(64,64)); 36 38 facebook_button->setText("Facebook"); 37 39 facebook_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 38 40 39 twitter_button->setIcon( QPixmap(":/icons-png/social_twitter.png"));41 twitter_button->setIcon(Images::icon("social_twitter")); 40 42 twitter_button->setIconSize(QSize(64,64)); 41 43 twitter_button->setText("Twitter"); … … 50 52 //layout()->setSizeConstraint(QLayout::SetFixedSize); 51 53 52 share_url = "http://smplayer.sourceforge.net";54 share_url = URL_HOMEPAGE; 53 55 } 54 56 … … 67 69 void ShareDialog::on_donate_button_clicked() { 68 70 qDebug("ShareDialog::on_donate_button_clicked"); 69 actions_taken |= Donate;70 QDesktopServices::openUrl( QUrl("http://smplayer.sourceforge.net/donate.php"));71 actions_taken |= ShareData::Donate; 72 QDesktopServices::openUrl(ShareData::donateUrl()); 71 73 } 72 74 73 75 void ShareDialog::on_facebook_button_clicked() { 74 76 qDebug("ShareDialog::on_facebook_button_clicked"); 75 actions_taken |= Facebook;76 QDesktopServices::openUrl( QUrl("http://www.facebook.com/sharer.php?u=" + share_url /* + "&t=" + share_text */));77 actions_taken |= ShareData::Facebook; 78 QDesktopServices::openUrl(ShareData::facebookUrl()); 77 79 } 78 80 79 81 void ShareDialog::on_twitter_button_clicked() { 80 82 qDebug("ShareDialog::on_twitter_button_clicked"); 81 actions_taken |= Twitter; 82 83 QString text = tr("SMPlayer is a free media player for PC. It plays all formats and can even download Youtube videos.", 84 "This text is to be published on twitter and the translation should not be more than 99 characters long"); 85 86 qDebug("ShareDialog::on_twitter_button_clicked: length: %d", text.length()); 87 if (text.length() > 99) { 88 qDebug("ShareDialog::on_twitter_button_clicked: the translation text is too long (%d), it shouldn't be longer than 99 characters. Using the English text.", text.length()); 89 text = "SMPlayer is a free media player for PC. It plays all formats and can even download Youtube videos."; 90 } 91 //text = text.replace("SMPlayer", "#SMPlayer"); 92 text = QUrl::toPercentEncoding(text); 93 QString url = "http://twitter.com/intent/tweet?text=" + text + "&url=" + QUrl::toPercentEncoding(share_url) + "/&via=smplayer_dev"; 94 QDesktopServices::openUrl(QUrl::fromEncoded(url.toLatin1())); 83 actions_taken |= ShareData::Twitter; 84 QDesktopServices::openUrl(ShareData::twitterUrl()); 95 85 } 96 86
Note:
See TracChangeset
for help on using the changeset viewer.