]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiAbout.cpp
If we are in a closeEvent, we don't want to close all buffers, because these may...
[lyx.git] / src / frontends / qt4 / GuiAbout.cpp
index b621a98d91706dd42d64021286034a0d1e9af5b4..218c061027641189e1f0fb1b6c1d11f5e9045472 100644 (file)
 #include "GuiAbout.h"
 
 #include "qt_helpers.h"
-#include "support/gettext.h"
 #include "version.h"
 
 #include "support/filetools.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
 #include "support/Package.h"
 
+#include <QDate>
 #include <QtCore>
 #include <QtGui>
 
+using namespace lyx::support;
 using lyx::support::package;
 using lyx::support::makeDisplayPath;
 
@@ -29,19 +32,27 @@ 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;
-       QFile file(toqstr(package().system_support().absFilename()) + "CREDITS");
+       QFile file(toqstr(package().system_support().absFilename()) + "/CREDITS");
        QTextStream out(&res);
 
        if (file.isReadable()) {
-               out << toqstr(_("ERROR: LyX wasn't able to read CREDITS file\n"));
-               out << toqstr(_("Please install correctly to estimate the great\n"));
-               out << toqstr(_("amount of work other people have done for the LyX project."));
+               out << qt_("ERROR: LyX wasn't able to read CREDITS file\n");
+               out << qt_("Please install correctly to estimate the great\n");
+               out << qt_("amount of work other people have done for the LyX project.");
        } else {
                file.open(QIODevice::ReadOnly);
                QTextStream ts(&file);
+               ts.setCodec("UTF-8");
                QString line;
                do {
                        line = ts.readLine();
@@ -61,45 +72,59 @@ static QString credits()
 
 static QString copyright()
 {
-       return toqstr(_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-2006 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);
 }
 
 
 static QString license()
 {
-       return toqstr(_("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."));
+       return qt_("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.");
 }
 
 
 static QString disclaimer()
 {
-       return toqstr(_("LyX 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.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA."));
+       return qt_("LyX 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.\nSee the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.");
 }
 
 
 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 << toqstr(_("LyX Version "));
-       out << lyx_version;
-       out << " (";
-       out << lyx_release_date;
-       out << ")\n";
-       out << toqstr(_("Library directory: "));
+       out << toqstr(version_date);
+       out << qt_("Library directory: ");
        out << toqstr(makeDisplayPath(package().system_support().absFilename()));
        out << "\n";
-       out << toqstr(_("User directory: "));
+       out << qt_("User directory: ");
        out << toqstr(makeDisplayPath(package().user_support().absFilename()));
        return res;
 }
 
 
 GuiAbout::GuiAbout(GuiView & lv)
-       : GuiDialog(lv, "aboutlyx")
+       : GuiDialog(lv, "aboutlyx", qt_("About LyX"))
 {
        setupUi(this);
-       setViewTitle(_("About LyX"));
 
        connect(closePB, SIGNAL(clicked()), this, SLOT(reject()));
 
@@ -120,4 +145,4 @@ Dialog * createGuiAbout(GuiView & lv) { return new GuiAbout(lv); }
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiAbout_moc.cpp"
+#include "moc_GuiAbout.cpp"