From a87c8175f163389fcac5dbfc169980f9ae6c6d52 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sat, 23 Jan 2010 20:29:00 +0000 Subject: [PATCH] About box: Migrate to DialogView. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33180 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiAbout.cpp | 33 +++++++++++++++++++++++---------- src/frontends/qt4/GuiAbout.h | 19 +++++++++++++------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/frontends/qt4/GuiAbout.cpp b/src/frontends/qt4/GuiAbout.cpp index 9f8d657807..dfe6d5c27e 100644 --- a/src/frontends/qt4/GuiAbout.cpp +++ b/src/frontends/qt4/GuiAbout.cpp @@ -12,6 +12,8 @@ #include "GuiAbout.h" +#include "ui_AboutUi.h" + #include "qt_helpers.h" #include "version.h" @@ -126,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(); } diff --git a/src/frontends/qt4/GuiAbout.h b/src/frontends/qt4/GuiAbout.h index 9b88d765af..a8a3b7996d 100644 --- a/src/frontends/qt4/GuiAbout.h +++ b/src/frontends/qt4/GuiAbout.h @@ -12,13 +12,12 @@ #ifndef GUIABOUT_H #define GUIABOUT_H -#include "GuiDialog.h" -#include "ui_AboutUi.h" +#include "DialogView.h" namespace lyx { namespace frontend { -class GuiAbout : public GuiDialog, public Ui::AboutUi +class GuiAbout : public DialogView { Q_OBJECT @@ -26,11 +25,19 @@ public: // Constructor GuiAbout(GuiView & lv); - // Controller stuff - bool initialiseParams(std::string const &) { return true; } - void clearParams() {} +private Q_SLOTS: + void on_closePB_clicked(); + +private: + /// Controller stuff + ///@{ + void updateView() {} void dispatchParams() {} bool isBufferDependent() const { return false; } + ///@} + + struct Private; + Private * const d; }; } // namespace frontend -- 2.39.2