]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt2/QAbout.C
change "support/std_sstream.h" to <sstream>
[features.git] / src / frontends / qt2 / QAbout.C
index c04d3499244ceb6a1476ad0ffc70cfcc31fa992f..fe9c83febdd46bb5a834c171fea5db34e87e55e3 100644 (file)
@@ -5,38 +5,42 @@
  *
  * \author Kalle Dalheimer
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
+#include "QAbout.h"
+#include "QAboutDialog.h"
+#include "Qt2BC.h"
+#include "qt_helpers.h"
+
+#include "controllers/ButtonController.h"
+#include "controllers/ControlAboutlyx.h"
 
 #include "support/lstrings.h"
-#include "Lsstream.h"
-#include "debug.h"
-#include "gettext.h"
-#include "LyXView.h"
-#include "ButtonControllerBase.h"
-#include "ControlAboutlyx.h"
+
+#include <sstream>
 
 #include <qlabel.h>
 #include <qpushbutton.h>
 #include <qtextview.h>
 
-#include "QAboutDialog.h"
-#include "Qt2BC.h"
-#include "QAbout.h"
+using lyx::support::prefixIs;
 
 using std::getline;
 
-typedef Qt2CB<ControlAboutlyx, Qt2DB<QAboutDialog> > base_class;
+using std::istringstream;
+using std::ostringstream;
+using std::string;
 
+namespace lyx {
+namespace frontend {
 
-QAbout::QAbout()
-       : base_class(_("About LyX"))
+typedef QController<ControlAboutlyx, QView<QAboutDialog> > base_class;
+
+QAbout::QAbout(Dialog & parent)
+       : base_class(parent, _("About LyX"))
 {
 }
 
@@ -47,16 +51,16 @@ void QAbout::build_dialog()
        connect(dialog_.get()->closePB, SIGNAL(clicked()),
                this, SLOT(slotClose()));
 
-       dialog_->copyright->setText(controller().getCopyright().c_str());
+       dialog_->copyright->setText(toqstr(controller().getCopyright()));
        dialog_->copyright->append("\n");
-       dialog_->copyright->append(controller().getLicense().c_str());
+       dialog_->copyright->append(toqstr(controller().getLicense()));
        dialog_->copyright->append("\n");
-       dialog_->copyright->append(controller().getDisclaimer().c_str());
+       dialog_->copyright->append(toqstr(controller().getDisclaimer()));
 
-       dialog_->versionLA->setText(controller().getVersion().c_str());
+       dialog_->versionLA->setText(toqstr(controller().getVersion()));
 
        // The code below should depend on a autoconf test. (Lgb)
-#if 0
+#if 1
        // There are a lot of buggy stringstream implementations..., but the
        // code below will work on all of them (I hope). The drawback with
        // this solutions os the extra copying. (Lgb)
@@ -100,7 +104,7 @@ void QAbout::build_dialog()
        }
 #endif
 
-       dialog_->creditsTV->setText(out.str().c_str());
+       dialog_->creditsTV->setText(toqstr(out.str()));
 
        // try to resize to a good size
        dialog_->copyright->hide();
@@ -109,6 +113,9 @@ void QAbout::build_dialog()
        dialog_->setMinimumSize(dialog_->sizeHint());
 
        // Manage the cancel/close button
-       bc().setCancel(dialog_->closePB);
+       bcview().setCancel(dialog_->closePB);
        bc().refresh();
 }
+
+} // namespace frontend
+} // namespace lyx