~ubuntu-branches/debian/sid/smplayer/sid

« back to all changes in this revision

Viewing changes to src/about.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2008-01-31 13:44:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080131134453-nc4dwsn5pkiw5s9h
Tags: 0.6.0~rc1-1
* New upstream release.
* debian/control:
  - Build-depend on CDBS.
  - Updated upstream homepage.
* debian/copyright:
  - Updated download address.
* debian/rules:
  - Migrated to CDBS.
  - Tweaked get-orig-source to work with release candidates.
* debian/docs:
  - Removed Translations.txt, upstream removed it from the tarball.
  - Added Release_notes.txt.
* debian/manpages, debian/smplayer.1:
  - Deleted, manpage merged upstream.
* debian/smplayer.install:
  - Install usr/share/man.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  smplayer, GUI front-end for mplayer.
 
2
    Copyright (C) 2006-2008 Ricardo Villalba <rvm@escomposlinux.org>
 
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 "about.h"
 
20
#include "images.h"
 
21
#include "version.h"
 
22
#include "global.h"
 
23
#include "preferences.h"
 
24
#include "helper.h"
 
25
 
 
26
#include <QFile>
 
27
 
 
28
 
 
29
About::About(QWidget * parent, Qt::WindowFlags f)
 
30
        : QDialog(parent, f) 
 
31
{
 
32
        setupUi(this);
 
33
        setWindowIcon( Images::icon("logo", 64) );
 
34
 
 
35
        logo->setPixmap( Images::icon("logo", 64) );
 
36
        contrib_icon->setPixmap( Images::icon("contributors" ) );
 
37
        translators_icon->setPixmap( Images::icon("translators" ) );
 
38
        license_icon->setPixmap( Images::icon("license" ) );
 
39
 
 
40
        QString mplayer_version;
 
41
        if (pref->mplayer_detected_version > 0) {
 
42
                mplayer_version = tr("Using MPlayer SVN r%1").arg(pref->mplayer_detected_version) + "<br><br>";
 
43
        }
 
44
 
 
45
        info->setText( 
 
46
                "<b>SMPlayer</b> &copy; 2006-2008 Ricardo Villalba &lt;rvm@escomposlinux.org&gt;<br><br>"
 
47
                "<b>" + tr("Version: %1").arg(smplayerVersion()) + "</b>" +
 
48
        "<br>" +
 
49
        tr("Compiled with Qt %1").arg(QT_VERSION_STR) + "<br><br>" +
 
50
                mplayer_version +
 
51
                tr("Visit our web for updates:") +" "+ link("http://smplayer.sf.net") + 
 
52
        "<br><br>" +
 
53
                tr("Get help in our forum:") +" " + link("http://smplayer.sf.net/forums") +
 
54
        "<br><br>" +
 
55
                tr("You can support SMPlayer by making a donation.") +" "+
 
56
                link("https://sourceforge.net/donate/index.php?group_id=185512", tr("More info"))
 
57
        );
 
58
 
 
59
 
 
60
        QString license_file = Helper::doc("gpl.html", pref->language);
 
61
        if (QFile::exists(license_file)) {
 
62
                QFont fixed_font;
 
63
                fixed_font.setStyleHint(QFont::TypeWriter);
 
64
                fixed_font.setFamily("Courier");
 
65
                license->setFont(fixed_font);
 
66
 
 
67
                QFile f(license_file);
 
68
                if (f.open(QIODevice::ReadOnly)) {
 
69
                        license->setText(QString::fromUtf8(f.readAll().constData()));
 
70
                }
 
71
                f.close();
 
72
        } else {
 
73
                license->setText(
 
74
                "<i>" +
 
75
                tr("This program is free software; you can redistribute it and/or modify "
 
76
            "it under the terms of the GNU General Public License as published by "
 
77
            "the Free Software Foundation; either version 2 of the License, or "
 
78
            "(at your option) any later version.") + "</i>");
 
79
        }
 
80
 
 
81
        translators->setText( getTranslators() );
 
82
 
 
83
        contributions->setText(
 
84
                tr("Some people have helped with their contributions:") +
 
85
                "<ul>" +
 
86
                contr("Charles Barcza &lt;kbarcza@blackpanther.hu&gt;", tr("SMPlayer logo")) +
 
87
                contr("Florin Braghis &lt;florin@libertv.ro&gt;", tr("file associations for Windows")) +
 
88
                contr("Matvey Kozhev &lt;sikon@lucidfox.org&gt;", tr("manpage for linux")) +
 
89
                contr("profoX", tr("support for colored console output")) + 
 
90
                contr("redxii", tr("icon for file associations")) +
 
91
                contr("LoRd_MuldeR", tr("patch for file associations")) +
 
92
                "</ul>"
 
93
        );
 
94
 
 
95
        // Copy the background color ("window") of the tab widget to the "base" color of the qtextbrowsers
 
96
        // Problem, it doesn't work with some styles, so first we change the "window" color of the tab widgets.
 
97
        info_tab->setAutoFillBackground(true);
 
98
        contributions_tab->setAutoFillBackground(true);
 
99
        translations_tab->setAutoFillBackground(true);
 
100
        license_tab->setAutoFillBackground(true);
 
101
        
 
102
        QPalette pal = info_tab->palette();
 
103
        pal.setColor(QPalette::Window, palette().color(QPalette::Window) );
 
104
        
 
105
        info_tab->setPalette(pal);
 
106
        contributions_tab->setPalette(pal);
 
107
        translations_tab->setPalette(pal);
 
108
        license_tab->setPalette(pal);
 
109
        
 
110
        QPalette p = info->palette();
 
111
        //p.setBrush(QPalette::Base, info_tab->palette().window());
 
112
        p.setColor(QPalette::Base, info_tab->palette().color(QPalette::Window));
 
113
 
 
114
        info->setPalette(p);
 
115
        contributions->setPalette(p);
 
116
        translators->setPalette(p);
 
117
        //license->setPalette(p);
 
118
}
 
119
 
 
120
About::~About() {
 
121
}
 
122
 
 
123
QString About::getTranslators() {
 
124
        return QString(
 
125
                 tr("The following people have contributed with translations:") + 
 
126
         "<ul>" +
 
127
         trad(tr("German"), "Henrikx") + 
 
128
                 trad(tr("Slovak"), "Sweto &lt;peter.mendel@gmail.com&gt;") +
 
129
                 trad(tr("Italian"), "Giancarlo Scola &lt;giancarlo@codexcoop.it&gt;") +
 
130
         trad(tr("French"), tr("%1, %2 and %3")
 
131
                        .arg("Olivier g &lt;1got@caramail.com&gt;")
 
132
                        .arg("Temet &lt;goondy@free.fr&gt;")
 
133
                        .arg("Kud Gray &lt;kud.gray@gmail.com&gt;") ) +
 
134
                 trad(tr("Simplified-Chinese"), "Tim Green &lt;iamtimgreen@gmail.com&gt;") +
 
135
         trad(tr("Russian"), tr("%1 and %2")
 
136
            .arg("Yurkovsky Andrey &lt;anyr@tut.by&gt;")
 
137
            .arg(QString::fromUtf8("Белый Владимир &lt;wiselord1983@gmail.com&gt;")))+ 
 
138
         trad(tr("Hungarian"), "Charles Barcza &lt;kbarcza@blackpanther.hu&gt;") + 
 
139
         trad(tr("Polish"), tr("%1 and %2")
 
140
            .arg("qla &lt;qla0@vp.pl&gt;")
 
141
            .arg("Jarek &lt;ajep9691@wp.pl&gt;") ) +
 
142
         trad(tr("Japanese"), "Nardog &lt;nardog@e2umail.com&gt;") + 
 
143
         trad(tr("Dutch"), "Wesley S. &lt;wesley@ubuntu-nl.org&gt;") + 
 
144
         trad(tr("Ukrainian"), "Motsyo Gennadi &lt;drool@altlinux.ru&gt;") + 
 
145
         trad(tr("Portuguese - Brazil"), "Ventura &lt;ventura.barbeiro@terra.com.br&gt;") + 
 
146
         trad(tr("Georgian"), "George Machitidze &lt;giomac@gmail.com&gt;") + 
 
147
         trad(tr("Czech"), QString::fromUtf8("Martin Dvořák &lt;martin.dvorak@centrum.cz&gt;")) +
 
148
         trad(tr("Bulgarian"), "&lt;marzeliv@mail.bg&gt;") +
 
149
         trad(tr("Turkish"), "alper er &lt;alperer@gmail.com&gt;") +
 
150
         trad(tr("Swedish"), "Leif Larsson &lt;leif.larsson@gmail.com&gt;") +
 
151
         trad(tr("Serbian"), "Kunalagon Umuhanik &lt;kunalagon@gmail.com&gt;") + 
 
152
         trad(tr("Traditional Chinese"), "Hoopoe &lt;dai715.tw@yahoo.com.tw&gt;") + 
 
153
         trad(tr("Romanian"), "DoruH &lt;doruhushhush@hotmail.com&gt;") + 
 
154
         trad(tr("Portuguese - Portugal"), "Waxman &lt;waxman.pt@gmail.com&gt;") +
 
155
                 trad(tr("Greek"), "my80s &lt;wamy80s@gmail.com&gt;") +
 
156
                 trad(tr("Finnish"), "peeaivo &lt;peeaivo@gmail.com&gt;") +
 
157
        trad(tr("Korean"), "Heesu Yoon &lt;imsu30@gmail.com&gt;") +
 
158
         "</ul>");
 
159
}
 
160
 
 
161
QString About::trad(const QString & lang, const QString & author) {
 
162
        return "<li>"+ tr("<b>%1</b>: %2").arg(lang).arg(author) + "</li>";
 
163
}
 
164
 
 
165
QString About::link(const QString & url, QString name) {
 
166
        if (name.isEmpty()) name = url;
 
167
        return QString("<a href=\"" + url + "\">" + name +"</a>");
 
168
}
 
169
 
 
170
QString About::contr(const QString & author, const QString & thing) {
 
171
        return "<li>"+ tr("<b>%1</b> (%2)").arg(author).arg(thing) +"</li>";
 
172
}
 
173
 
 
174
#include "moc_about.cpp"