X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiAbout.cpp;h=dfe6d5c27e1659d295e448cd81fbbdd80b382a7b;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=4925a3f4369725526798de2e527ae1522c5ed07b;hpb=1fc477efac5fd3804c6407a03791e713f643fc43;p=lyx.git diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp index 4925a3f436..dfe6d5c27e 100644 --- a/src/frontends/qt4/GuiAbout.cpp +++ b/src/frontends/qt4/GuiAbout.cpp @@ -12,15 +12,21 @@ #include "GuiAbout.h" +#include "ui_AboutUi.h" + #include "qt_helpers.h" #include "version.h" #include "support/filetools.h" +#include "support/gettext.h" +#include "support/lstrings.h" #include "support/Package.h" +#include #include #include +using namespace lyx::support; using lyx::support::package; using lyx::support::makeDisplayPath; @@ -28,6 +34,13 @@ using lyx::support::makeDisplayPath; namespace lyx { namespace frontend { + +static QDate release_date() +{ + return QDate::fromString(QString(lyx_release_date), Qt::ISODate); +} + + static QString credits() { QString res; @@ -47,9 +60,14 @@ static QString credits() line = ts.readLine(); if (line.startsWith("@b")) out << "" << line.mid(2) << ""; - else if (line.startsWith("@i")) + else if (line.startsWith("@i")) { + if (line.startsWith("@iE-mail")) { + // unmask email + line.replace(QString(" () "), QString("@")); + line.replace(QString(" ! "), QString(".")); + } out << "" << line.mid(2) << ""; - else + } else out << line; out << "
"; } while (!line.isNull()); @@ -61,7 +79,11 @@ static QString credits() static QString copyright() { - return qt_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2008 LyX Team"); + QString release_year = release_date().toString("yyyy"); + docstring copy_message = + bformat(_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995--%1$s LyX Team"), + qstring_to_ucs4(release_year)); + return toqstr(copy_message); } @@ -79,13 +101,24 @@ static QString disclaimer() static QString version() { + QString loc_release_date; + QDate date = release_date(); + if (date.isValid()) { + QLocale loc; + loc_release_date = loc.toString(date, QLocale::LongFormat); + } else { + if (QString(lyx_release_date) == "not released yet") + loc_release_date = qt_("not released yet"); + else + loc_release_date = toqstr(lyx_release_date); + } + docstring version_date = + bformat(_("LyX Version %1$s\n(%2$s)"), + from_ascii(lyx_version), + qstring_to_ucs4(loc_release_date))+"\n\n"; QString res; QTextStream out(&res); - out << qt_("LyX Version "); - out << lyx_version; - out << " ("; - out << lyx_release_date; - out << ")\n"; + out << toqstr(version_date); out << qt_("Library directory: "); out << toqstr(makeDisplayPath(package().system_support().absFilename())); out << "\n"; @@ -95,21 +128,32 @@ static QString version() } +struct GuiAbout::Private +{ + Ui::AboutUi ui; +}; + + GuiAbout::GuiAbout(GuiView & lv) - : GuiDialog(lv, "aboutlyx", qt_("About LyX")) + : DialogView(lv, "aboutlyx", qt_("About LyX")), + d(new GuiAbout::Private) { - setupUi(this); + d->ui.setupUi(this); - connect(closePB, SIGNAL(clicked()), this, SLOT(reject())); + d->ui.copyrightTB->setPlainText(copyright()); + d->ui.copyrightTB->append(QString()); + d->ui.copyrightTB->append(license()); + d->ui.copyrightTB->append(QString()); + d->ui.copyrightTB->append(disclaimer()); + + d->ui.versionLA->setText(version()); + d->ui.creditsTB->setHtml(credits()); +} - copyrightTB->setPlainText(copyright()); - copyrightTB->append(QString()); - copyrightTB->append(license()); - copyrightTB->append(QString()); - copyrightTB->append(disclaimer()); - versionLA->setText(version()); - creditsTB->setHtml(credits()); +void GuiAbout::on_closePB_clicked() +{ + close(); }