/* smplayer, GUI front-end for mplayer. Copyright (C) 2006-2013 Ricardo Villalba This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "about.h" #include "images.h" #include "version.h" #include "global.h" #include "preferences.h" #include "paths.h" #include "mplayerversion.h" #include #include using namespace Global; About::About(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); setWindowIcon( Images::icon("logo", 64) ); logo->setPixmap( QPixmap(":/icons-png/logo.png").scaledToHeight(64, Qt::SmoothTransformation) ); contrib_icon->setPixmap( Images::icon("contributors" ) ); translators_icon->setPixmap( Images::icon("translators" ) ); license_icon->setPixmap( Images::icon("license" ) ); QString mplayer_version; if (pref->mplayer_detected_version > 0) { if (pref->mplayer_is_mplayer2) { mplayer_version = tr("Using MPlayer2 %1").arg(pref->mplayer2_detected_version); } else { mplayer_version = tr("Using MPlayer %1").arg(MplayerVersion::toString(pref->mplayer_detected_version)); } mplayer_version += "

"; } else { mplayer_version += "
"; } info->setText( "SMPlayer © 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>

" "" + tr("Version: %1").arg(smplayerVersion()) + "" + #if PORTABLE_APP " (" + tr("Portable Edition") + ")" + #endif #ifdef EXPERIMENTAL "
Experimental branch
" #endif "
" + tr("Using Qt %1 (compiled with Qt %2)").arg(qVersion()).arg(QT_VERSION_STR) + "
" + mplayer_version + ""+ tr("Links:") +"
"+ tr("Official website:") +" "+ link("http://smplayer.sourceforge.net") +"
"+ tr("Support forum:") +" "+ link("http://smplayer.sourceforge.net/forum/") +"
"+ "
" + tr("SMPlayer uses the award-winning MPlayer as playback engine. See %1") .arg("http://www.mplayerhq.hu") ); QString license_text = "" "This program is free software; you can redistribute it and/or modify " "it under the terms of the GNU General Public License as published by " "the Free Software Foundation; either version 2 of the License, or " "(at your option) any later version." "

"; QString license_file = Paths::doc("gpl.html", "en"); if (QFile::exists(license_file)) { license_file = QUrl::fromLocalFile(license_file).toString(); license_text += QString("%2").arg(license_file).arg(tr("Read the entire license")); } if ((pref->language != "en") && (pref->language != "en_US")) { QString license_trans_file = Paths::doc("gpl.html", pref->language, false); //qDebug("license_trans_file: %s", license_trans_file.toUtf8().constData()); if (QFile::exists(license_trans_file)) { license_trans_file = QUrl::fromLocalFile(license_trans_file).toString(); license_text += QString("
%2").arg(license_trans_file).arg(tr("Read a translation")); } } license->setText(license_text); license->setOpenLinks(false); license->setOpenExternalLinks(false); connect(license, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(openLink(const QUrl&))); translators->setHtml( getTranslators() ); contributions->setText( tr("SMPlayer logo by %1").arg("Charles Barcza <kbarcza@blackpanther.hu>") + "

" + tr("Packages for Windows created by %1").arg("redxii <redxii@users.sourceforge.net>") + "

" + tr("Many other people contributed with patches. See the Changelog for details.") ); #ifdef YOUTUBE_SUPPORT youtube->setHtml( tr("Founded in February 2005, YouTube™ is the world's most popular online " "video community, allowing millions of people to discover, watch and share " "originally-created videos. YouTube™ provides a forum for people to " "connect, inform, and inspire others across the globe and acts as a " "distribution platform for original content creators and advertisers large and small.") + "

" + tr("By using this application you hereby agree to be bound by Google Terms of Services located " "at %1.").arg(link("http://www.google.com/accounts/TOS", "http://www.google.com/accounts/TOS")) ); youtube->setOpenExternalLinks(true); #else tab_widget->removeTab(4); #endif // Copy the background color ("window") of the tab widget to the "base" color of the qtextbrowsers // Problem, it doesn't work with some styles, so first we change the "window" color of the tab widgets. info_tab->setAutoFillBackground(true); contributions_tab->setAutoFillBackground(true); translations_tab->setAutoFillBackground(true); license_tab->setAutoFillBackground(true); youtube_tab->setAutoFillBackground(true); QPalette pal = info_tab->palette(); pal.setColor(QPalette::Window, palette().color(QPalette::Window) ); info_tab->setPalette(pal); contributions_tab->setPalette(pal); translations_tab->setPalette(pal); license_tab->setPalette(pal); youtube_tab->setPalette(pal); QPalette p = info->palette(); //p.setBrush(QPalette::Base, info_tab->palette().window()); p.setColor(QPalette::Base, info_tab->palette().color(QPalette::Window)); info->setPalette(p); contributions->setPalette(p); translators->setPalette(p); license->setPalette(p); youtube->setPalette(p); adjustSize(); } About::~About() { } QString About::getTranslators() { return QString( tr("The following people have contributed with translations:") + "

" + trad(tr("Spanish"), "Ricardo Villalba ") + trad(tr("German"), "Panagiotis Papadopoulos ") + trad(tr("Slovak"), "Sweto ") + trad(tr("Italian"), QStringList() << "greengreat " << "Giancarlo Scola ") + trad(tr("French"), QStringList() << "Olivier g <1got@caramail.com>" << "Temet " << "Erwann MEST ") + trad(tr("Simplified-Chinese"), QStringList() << "Tim Green " << "OpenBDH ") + trad(tr("Russian"), QString::fromUtf8("Белый Владимир "))+ trad(tr("Hungarian"), QStringList() << "Charles Barcza " << "CyberDragon ") + trad(tr("Polish"), QStringList() << "qla " << "Jarek " << "sake12 " ) + trad(tr("Japanese"), "Nardog ") + trad(tr("Dutch"), QStringList() << "profoX " << "BalaamsMiracle" << "Kristof Bal ") + trad(tr("Ukrainian"), QStringList() << "Motsyo Gennadi " << "Oleksandr Kovalenko " ) + trad(tr("Portuguese - Brazil"), QStringList() << "Ventura " << QString::fromUtf8("Maico Sertório ")) + trad(tr("Georgian"), "George Machitidze ") + trad(tr("Czech"), QStringList() << QString::fromUtf8("Martin Dvořák ") << QString::fromUtf8("Jaromír Smrček ") ) + trad(tr("Bulgarian"), "") + trad(tr("Turkish"), "alper er ") + trad(tr("Swedish"), "Leif Larsson ") + trad(tr("Serbian"), "Kunalagon Umuhanik ") + trad(tr("Traditional Chinese"), "Hoopoe ") + trad(tr("Romanian"), "DoruH ") + trad(tr("Portuguese - Portugal"), QStringList() << "Waxman " << QString::fromUtf8("Sérgio Marques ") ) + trad(tr("Greek"), "my80s ") + trad(tr("Finnish"), "peeaivo ") + trad(tr("Korean"), "Heesu Yoon ") + trad(tr("Macedonian"), "Marko Doda ") + trad(tr("Basque"), QStringList() << "Piarres Beobide " << "Xabier Aramendi ") + trad(tr("Catalan"), QString::fromUtf8("Roger Calvó ")) + trad(tr("Slovenian"), "Janez Troha ") + trad(tr("Arabic"), "Muhammad Nour Hajj Omar ") + trad(tr("Kurdish"), "Si_murg56 ") + trad(tr("Galician"), QStringList() << "Miguel Branco " << "Gallaecio") + trad(tr("Vietnamese"), QString::fromUtf8("Lê Xuân Thảo ")) + trad(tr("Estonian"), QString::fromUtf8("Olav Mägi ")) + trad(tr("Lithuanian"), QStringList() << "Freemail " << QString::fromUtf8("Algimantas Margevičius ") ) + trad(tr("Danish"), "Martin Schlander ") + trad(tr("Croatian"), QString::fromUtf8("Josip Kujundžija ")) + trad(tr("Hebrew"), "Genghis Khan ") + trad(tr("Thai"), QString::fromUtf8("มาโนชญ์ สมศักดิ์ ")) + trad(tr("Malay"), "abuyop (transifex)") + ""); } QString About::trad(const QString & lang, const QString & author) { return trad(lang, QStringList() << author); } QString About::trad(const QString & lang, const QStringList & authors) { QString s; for (int n = 0; n < authors.count(); n++) { QString author = authors[n]; s += author.replace("<", "<").replace(">", ">"); if (n < (authors.count()-1)) s += "
"; } return QString("

%1:

%2


").arg(lang).arg(s); } QString About::link(const QString & url, QString name) { if (name.isEmpty()) name = url; return QString("" + name +""); } QString About::contr(const QString & author, const QString & thing) { return "
  • "+ tr("%1 (%2)").arg(author).arg(thing) +"
  • "; } QSize About::sizeHint () const { return QSize(518, 326); } void About::openLink(const QUrl & link) { qDebug("About::openLink: '%s'", link.toString().toUtf8().constData()); QDesktopServices::openUrl(link); } #include "moc_about.cpp"