diff --git a/src/dialogs/about.cpp b/src/dialogs/about.cpp index 94bfc231..606a15ca 100644 --- a/src/dialogs/about.cpp +++ b/src/dialogs/about.cpp @@ -37,17 +37,20 @@ #include "ui_about.h" About::About(QWidget *parent):QDialog(parent) { - - authors_ \ + + ui_.setupUi(this); + setWindowFlags(this->windowFlags()|Qt::WindowStaysOnTopHint); + + strawberry_authors_ \ << Person("Jonas Kvinge", "jonas@strawbs.net"); - + clementine_authors_ << Person("David Sansome", "me@davidsansome.com") << Person("John Maguire", "john.maguire@gmail.com") << Person(QString::fromUtf8("Paweł Bara"), "keirangtp@gmail.com") << Person("Arnaud Bienner", "arnaud.bienner@gmail.com"); - thanks_to_ \ + constributors_ \ << Person("Mark Kretschmann", "kretschmann@kde.org") << Person("Max Howell", "max.howell@methylblue.com") << Person("Jakub Stachowski", "qbast@go2.pl") @@ -67,68 +70,83 @@ About::About(QWidget *parent):QDialog(parent) { << Person("Santiago Gil") << Person("Tyler Rhodes", "tyler.s.rhodes@gmail.com"); - - QString Title = ""; - - ui_.setupUi(this); - setWindowFlags(this->windowFlags()|Qt::WindowStaysOnTopHint); - setWindowTitle(tr("About Strawberry")); + QString Title("About Strawberry"); - Title = QString("About Strawberry"); - - ui_.title->setText(Title); - QFont title_font; title_font.setBold(true); title_font.setPointSize(title_font.pointSize() + 4); - ui_.title->setFont(title_font); - ui_.text->setWordWrap(true); - ui_.text->setText(MakeHtml()); + setWindowTitle(Title); + + ui_.label_title->setFont(title_font); + ui_.label_title->setText(Title); + + ui_.label_text->setText(MainHtml()); + ui_.text_constributors->setText(ContributorsHtml()); ui_.buttonBox->button(QDialogButtonBox::Close)->setShortcut(QKeySequence::Close); } -QString About::MakeHtml() const { +QString About::MainHtml() const { - QString ret = ""; + QString ret; - ret = tr("
Version %1
").arg(QCoreApplication::applicationVersion()); + ret = QString("Version %1
").arg(QCoreApplication::applicationVersion()); - ret += tr("");
-
- ret += tr("Strawberry is a audio player and music collection organizer.
");
- ret += tr("It's based on Clementine and Amarok 1.4, especially aimed at audiophiles.
");
- ret += tr("The name is inspired by the band Strawbs.
%3:").arg(kUrl, kUrl, tr("Authors")); - - ret += QString("
%1").arg(tr("Strawberry Authors"));
-
- for (const Person &person : authors_) {
- ret += "
" + MakeHtml(person);
- }
-
- ret += QString("
%3:").arg(tr("Clementine Authors"));
-
- for (const Person &person : clementine_authors_) {
- ret += "
" + MakeHtml(person);
- }
-
- ret += QString("
%3:").arg(tr("Thanks to"));
-
- for (const Person &person : thanks_to_) {
- ret += "
" + MakeHtml(person);
- }
-
- ret += QString("
%1
");
+ ret += QString("Strawberry is a audio player and music collection organizer.
");
+ ret += QString("It's based on Clementine and Amarok 1.4, especially aimed at audiophiles.
");
+ ret += QString("The name is inspired by the band Strawbs.");
+ ret += QString("
Website: http://www.strawbs.org/
"); + ret += QString("");
+ ret += QString("Strawberry is free software: you can redistribute it and/or modify
");
+ ret += QString("it under the terms of the GNU General Public License as published by
");
+ ret += QString("the Free Software Foundation, either version 3 of the License, or
");
+ ret += QString("(at your option) any later version.
");
+ ret += QString("
");
+ ret += QString("Strawberry is distributed in the hope that it will be useful,
");
+ ret += QString("but WITHOUT ANY WARRANTY; without even the implied warranty of
");
+ ret += QString("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
");
+ ret += QString("GNU General Public License for more details.
");
+ ret += QString("
");
+ ret += QString("You should have received a copy of the GNU General Public License
");
+ ret += QString("along with Strawberry. If not, see http://www.gnu.org/licenses/.");
+ ret += QString("
Strawberry Authors");
+ for (const Person &person : strawberry_authors_) {
+ ret += "
" + PersonToHtml(person);
+ }
+ ret += QString("
Clementine Authors");
+ for (const Person &person : clementine_authors_) {
+ ret += "
" + PersonToHtml(person);
+ }
+ ret += QString("
Contributors");
+ for (const Person &person : constributors_) {
+ ret += "
" + PersonToHtml(person);
+ }
+ ret += QString("
... and all the Amarok and Clementine contributors
"); + return ret; + +} + +QString About::PersonToHtml(const Person &person) const { if (person.email.isNull()) return person.name; diff --git a/src/dialogs/about.h b/src/dialogs/about.h index 444a6cc3..45ba6ff3 100644 --- a/src/dialogs/about.h +++ b/src/dialogs/about.h @@ -41,23 +41,22 @@ class About : public QDialog { struct Person { Person(const QString &n, const QString &e = QString()) : name(n), email(e) {} - bool operator<(const Person &other) const { return name < other.name; } - QString name; QString email; }; private: - QString MakeHtml() const; - QString MakeHtml(const Person& person) const; + QString MainHtml() const; + QString ContributorsHtml() const; + QString PersonToHtml(const Person& person) const; private: Ui::About ui_; - QList