]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiAbout.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / GuiAbout.cpp
index 9f8d657807febac4e0d5f960122674a73c962bb4..09834d41f5f9c5b7aaae531bf8afc16536b76a0e 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "GuiAbout.h"
 
+#include "ui_AboutUi.h"
+
 #include "qt_helpers.h"
 #include "version.h"
 
@@ -21,8 +23,8 @@
 #include "support/Package.h"
 
 #include <QDate>
-#include <QtCore>
-#include <QtGui>
+#include <QFile>
+#include <QTextStream>
 
 using namespace lyx::support;
 using lyx::support::package;
@@ -42,7 +44,7 @@ static QDate release_date()
 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()) {
@@ -118,29 +120,59 @@ static QString version()
        QTextStream out(&res);
        out << toqstr(version_date);
        out << qt_("Library directory: ");
-       out << toqstr(makeDisplayPath(package().system_support().absFilename()));
+       out << toqstr(makeDisplayPath(package().system_support().absFileName()));
        out << "\n";
        out << qt_("User directory: ");
-       out << toqstr(makeDisplayPath(package().user_support().absFilename()));
+       out << toqstr(makeDisplayPath(package().user_support().absFileName()));
+#ifdef DEVEL_VERSION
+       out << "\n";
+       out << toqstr(bformat(_("Qt Version (run-time): %1$s"), from_ascii(qVersion()))) << "\n";
+       out << toqstr(bformat(_("Qt Version (compile-time): %1$s"), from_ascii(QT_VERSION_STR))) << "\n";
+#endif
        return res;
 }
 
+static QString buildinfo()
+{
+       QString res;
+       QTextStream out(&res);
+       out << "LyX " << lyx_version
+               << " (" << lyx_release_date << ")" << endl;
+       out << toqstr(bformat(_("Built on %1$s[[date]], %2$s[[time]]"),
+               from_ascii(__DATE__), from_ascii(__TIME__))) << endl;
+
+       out << lyx_version_info << endl;
+       return res;
+}
+
+
+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.buildinfoTB->setText(buildinfo());
+       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();
 }