]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/Qt2Base.C
Get rid of the static_casts.
[lyx.git] / src / frontends / qt2 / Qt2Base.C
index d8deb24b6cd5661abf40d8aca4143f28bdfd801a..704ac24ba6bd6b6fbd9162542b53b8642dc36968 100644 (file)
 
 #include <config.h>
 
-
 #include <qdialog.h>
 #include <qapplication.h>
 
 #include "debug.h"
+#include "qt_helpers.h"
 #include "QtLyXView.h"
-#include "Dialogs.h"
 #include "Qt2Base.h"
 #include "Qt2BC.h"
+#include "ButtonController.h"
 #include "ControlButtons.h"
 #include "support/LAssert.h"
 
 
-Qt2Base::Qt2Base(QString const & t)
-       : ViewBase(), updating_(false), title_(t)
+Qt2Base::Qt2Base(string const & t)
+       : ViewBase(t), updating_(false)
 {}
 
 
-Qt2BC & Qt2Base::bc()
+Qt2BC & Qt2Base::bcview()
 {
-       return static_cast<Qt2BC &>(getController().bc());
-       // return dynamic_cast<Qt2BC &>(getController().bc());
+       return static_cast<Qt2BC &>(bc().view());
+       // return dynamic_cast<Qt2BC &>(bc());
 }
 
 
@@ -51,10 +51,11 @@ void Qt2Base::show()
 
        update();  // make sure its up-to-date
 
+       form()->setCaption(toqstr(getTitle()));
+
        if (form()->isVisible()) {
                form()->raise();
        } else {
-               form()->setCaption(title_);
                form()->show();
        }
 }
@@ -77,11 +78,7 @@ void Qt2Base::changed()
 {
        if (updating_)
                return;
-
-       if (isValid())
-               bc().valid();
-       else
-               bc().invalid();
+       bc().valid(isValid());
 }