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.

"); - - //ret += tr("

%2

%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

").arg(tr("... and all the Amarok and Clementine contributors")); + ret += QString("

"); + 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("

"); + //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("

"); return ret; } -QString About::MakeHtml(const Person &person) const { +QString About::ContributorsHtml() const { + + QString ret; + + ret += QString("

Strawberry Authors"); + for (const Person &person : strawberry_authors_) { + ret += "
" + PersonToHtml(person); + } + ret += QString("

"); + + ret += QString("

Clementine Authors"); + for (const Person &person : clementine_authors_) { + ret += "
" + PersonToHtml(person); + } + ret += QString("

"); + + ret += QString("

Contributors"); + for (const Person &person : constributors_) { + ret += "
" + PersonToHtml(person); + } + ret += QString("

"); + + 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 authors_; + QList strawberry_authors_; QList clementine_authors_; - QList thanks_to_; + QList constributors_; }; #endif // ABOUT_H diff --git a/src/dialogs/about.ui b/src/dialogs/about.ui index 2f5de7f6..372176f4 100644 --- a/src/dialogs/about.ui +++ b/src/dialogs/about.ui @@ -2,32 +2,12 @@ About - - - 0 - 0 - 600 - 700 - - - - - 0 - 0 - - - + 600 700 - - - 0 - 0 - - Qt::StrongFocus @@ -50,7 +30,7 @@ - + :/icons/64x64/strawberry.png @@ -60,7 +40,7 @@ - + Qt::Vertical @@ -99,31 +79,54 @@ - - - - 16777215 - 25 - - + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + true + - + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + true + + + true + + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +