Ignore:
Timestamp:
May 3, 2016, 5:25:45 PM (9 years ago)
Author:
Silvan Scherrer
Message:

smplayer: update trunk to version 16.4

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/sharedialog.cpp

    r170 r176  
    11/*  smplayer, GUI front-end for mplayer.
    2     Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net>
     2    Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
    33
    44    This program is free software; you can redistribute it and/or modify
     
    1818
    1919#include "sharedialog.h"
     20#include "sharedata.h"
     21#include "images.h"
     22#include "links.h"
    2023#include <QDesktopServices>
    21 #include <QUrl>
    2224
    2325ShareDialog::ShareDialog( QWidget* parent, Qt::WindowFlags f )
     
    2729        setupUi(this);
    2830
    29         donate_button->setIcon(QPixmap(":/icons-png/paypal.png"));
     31        donate_button->setIcon(Images::icon("paypal"));
    3032        donate_button->setIconSize(QSize(64,64));
    31         donate_button->setText(tr("Donate with Paypal"));
     33        donate_button->setText(tr("Donate with PayPal"));
    3234        donate_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    3335
    34         facebook_button->setIcon(QPixmap(":/icons-png/social_facebook.png"));
     36        facebook_button->setIcon(Images::icon("social_facebook"));
    3537        facebook_button->setIconSize(QSize(64,64));
    3638        facebook_button->setText("Facebook");
    3739        facebook_button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    3840
    39         twitter_button->setIcon(QPixmap(":/icons-png/social_twitter.png"));
     41        twitter_button->setIcon(Images::icon("social_twitter"));
    4042        twitter_button->setIconSize(QSize(64,64));
    4143        twitter_button->setText("Twitter");
     
    5052        //layout()->setSizeConstraint(QLayout::SetFixedSize);
    5153
    52         share_url = "http://smplayer.sourceforge.net";
     54        share_url = URL_HOMEPAGE;
    5355}
    5456
     
    6769void ShareDialog::on_donate_button_clicked() {
    6870        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());
    7173}
    7274
    7375void ShareDialog::on_facebook_button_clicked() {
    7476        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());
    7779}
    7880
    7981void ShareDialog::on_twitter_button_clicked() {
    8082        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());
    9585}
    9686
Note: See TracChangeset for help on using the changeset viewer.