]> git.lyx.org Git - lyx.git/commitdiff
QtView renamed to GuiView
authorAbdelrazak Younes <younes@lyx.org>
Tue, 20 Jun 2006 09:33:01 +0000 (09:33 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 20 Jun 2006 09:33:01 +0000 (09:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14154 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
src/frontends/qt4/GuiImplementation.C
src/frontends/qt4/GuiImplementation.h
src/frontends/qt4/GuiView.C [new file with mode: 0644]
src/frontends/qt4/GuiView.h [new file with mode: 0644]
src/frontends/qt4/GuiWorkArea.C
src/frontends/qt4/QCommandBuffer.C
src/frontends/qt4/QCommandBuffer.h
src/frontends/qt4/QLMenubar.C
src/frontends/qt4/QLMenubar.h
src/frontends/qt4/QLPopupMenu.C
src/frontends/qt4/QLToolbar.C
src/frontends/qt4/QLToolbar.h
src/frontends/qt4/QtView.C [deleted file]
src/frontends/qt4/QtView.h [deleted file]
src/frontends/qt4/lyx_gui.C

index 18c13b5c1c2f3a5088457e8a4938426910909164..459176d31a3077c2ec73be2b18a0d425cdb3b30d 100644 (file)
 
 #include "GuiImplementation.h"
 #include "GuiWorkArea.h"
-#include "QtView.h"
+#include "GuiView.h"
 
 using boost::shared_ptr;
 
 namespace lyx {
 namespace frontend {
 
-GuiImplementation::GuiImplementation(QtView & owner): owner_(owner), max_id_(0)
+GuiImplementation::GuiImplementation(GuiView & owner): owner_(owner), max_id_(0)
 {
 }
 
index 31f23ad873533efe5d7924fee5db60dc9d9b1b48..4cd8bfc817d0bf594088636bec10c61bc4213ef3 100644 (file)
@@ -24,7 +24,7 @@ namespace lyx {
 namespace frontend {
 
 class GuiWorkArea;
-class QtView;
+class GuiView;
 
 /**
  * The GuiImplementation class is the interface to all Qt4 components.
@@ -32,7 +32,7 @@ class QtView;
 class GuiImplementation: public Gui
 {
 public:
-       GuiImplementation(QtView & owner);
+       GuiImplementation(GuiView & owner);
        virtual ~GuiImplementation() {}
 
        Clipboard& clipboard();
@@ -47,7 +47,7 @@ private:
        ///
        std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_;
        ///
-       QtView & owner_;
+       GuiView & owner_;
        ///
        size_t max_id_;
 };
diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C
new file mode 100644 (file)
index 0000000..0135263
--- /dev/null
@@ -0,0 +1,224 @@
+/**
+ * \file GuiView.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author John Levon
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#undef QT3_SUPPORT
+
+#include <config.h>
+
+#include "BufferView.h"
+#include "lyx_cb.h"
+#include "lyxrc.h"
+#include "lyx_main.h"
+#include "session.h"
+#include "lyxfunc.h"
+#include "MenuBackend.h"
+#include "funcrequest.h"
+#include "funcrequest.h"
+
+#include "debug.h"
+
+#include "frontends/Toolbars.h"
+
+#include "support/filetools.h"
+
+#include "support/convert.h"
+#include <boost/bind.hpp>
+
+#include "GuiView.h"
+#include "QLMenubar.h"
+#include "FontLoader.h"
+#include "QCommandBuffer.h"
+#include "qt_helpers.h"
+
+#include <QApplication>
+#include <QPixmap>
+#include <QStatusBar>
+#include <QToolBar>
+#include <QCloseEvent>
+#include <QAction>
+//#include <QMenu>
+//#include <QMenuBar>
+
+#include "support/lstrings.h"
+
+
+using std::string;
+using std::endl;
+
+FontLoader fontloader;
+
+namespace lyx {
+
+using support::subst;
+using support::libFileSearch;
+
+namespace frontend {
+
+namespace {
+
+int const statusbar_timer_value = 3000;
+
+} // namespace anon
+
+
+GuiView::GuiView(unsigned int width, unsigned int height)
+       : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
+{
+       mainWidget_ = this;
+
+//     setToolButtonStyle(Qt::ToolButtonIconOnly);
+//     setIconSize(QSize(12,12));
+
+       bufferview_.reset(new BufferView(this, width, height));
+
+       menubar_.reset(new QLMenubar(this, menubackend));
+       connect(menuBar(), SIGNAL(triggered(QAction *)), this, SLOT(updateMenu(QAction *)));
+
+       getToolbars().init();
+
+       statusBar()->setSizeGripEnabled(false);
+
+       view_state_changed.connect(boost::bind(&GuiView::update_view_state, this));
+       connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
+
+#ifndef Q_WS_MACX
+       //  assign an icon to main form. We do not do it under Qt/Mac,
+       //  since the icon is provided in the application bundle.
+       string const iconname = libFileSearch("images", "lyx", "xpm");
+       if (!iconname.empty())
+               setWindowIcon(QPixmap(toqstr(iconname)));
+#endif
+
+       // make sure the buttons are disabled if needed
+       updateToolbars();
+}
+
+
+GuiView::~GuiView()
+{
+}
+
+void GuiView::updateMenu(QAction *action)
+{
+       menubar_->update();
+}
+
+void GuiView::setWindowTitle(string const & t, string const & it)
+{
+       QMainWindow::setWindowTitle(toqstr(t));
+       QMainWindow::setWindowIconText(toqstr(it));
+}
+
+
+void GuiView::addCommandBuffer(QToolBar * toolbar)
+{
+       commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
+       focus_command_buffer.connect(boost::bind(&GuiView::focus_command_widget, this));
+       toolbar->addWidget(commandbuffer_);
+}
+
+
+void GuiView::message(string const & str)
+{
+       statusBar()->showMessage(toqstr(str));
+       statusbar_timer_.stop();
+       statusbar_timer_.start(statusbar_timer_value);
+}
+
+
+void GuiView::clearMessage()
+{
+       update_view_state_qt();
+}
+
+
+void GuiView::focus_command_widget()
+{
+       if (commandbuffer_)
+               commandbuffer_->focus_command();
+}
+
+
+void GuiView::update_view_state_qt()
+{
+       statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage()));
+       statusbar_timer_.stop();
+}
+
+
+void GuiView::update_view_state()
+{
+       // let the user see the explicit message
+       if (statusbar_timer_.isActive())
+               return;
+
+       statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage()));
+}
+
+
+void GuiView::activated(FuncRequest const & func)
+{
+       getLyXFunc().dispatch(func);
+}
+
+
+bool GuiView::hasFocus() const
+{
+       return qApp->activeWindow() == this;
+}
+
+
+void GuiView::closeEvent(QCloseEvent *)
+{
+       QRect geometry = normalGeometry();
+       Session & session = LyX::ref().session();
+       // save windows size and position
+       session.saveSessionInfo("WindowWidth", convert<string>(geometry.width()));
+       session.saveSessionInfo("WindowHeight", convert<string>(geometry.height()));
+       session.saveSessionInfo("WindowIsMaximized", (isMaximized() ? "yes" : "no"));
+       if (lyxrc.geometry_xysaved) {
+               session.saveSessionInfo("WindowPosX", convert<string>(geometry.x()));
+               session.saveSessionInfo("WindowPosY", convert<string>(geometry.y()));
+       }
+       // trigger LFUN_LYX_QUIT instead of quit directly
+       // since LFUN_LYX_QUIT may have more cleanup stuff
+       getLyXFunc().dispatch(FuncRequest(LFUN_LYX_QUIT));
+}
+
+
+void GuiView::show()
+{
+       QMainWindow::setWindowTitle(qt_("LyX"));
+       QMainWindow::show();
+}
+
+
+void GuiView::busy(bool yes) const
+{
+       if (yes)
+               QApplication::setOverrideCursor(Qt::WaitCursor);
+       else
+               QApplication::restoreOverrideCursor();
+}
+
+QMainWindow* GuiView::mainWidget()
+{
+       return mainWidget_;
+}
+
+QMainWindow* GuiView::mainWidget_ = 0;
+
+
+} // namespace frontend
+} // namespace lyx
+
+#include "GuiView_moc.cpp"
diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h
new file mode 100644 (file)
index 0000000..66a7d5a
--- /dev/null
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+/**
+ * \file GuiView.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjornes
+ * \author John Levon
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef GUIVIEW_H
+#define GUIVIEW_H
+
+// Must be here because of moc.
+#include <config.h>
+
+#include "GuiImplementation.h"
+
+#include "frontends/LyXView.h"
+#include "funcrequest.h"
+
+#include <QMainWindow>
+#include <QTimer>
+#include <QAction>
+#include <QCloseEvent>
+
+class QToolBar;
+
+//class FuncRequest;
+
+//class string;
+
+namespace lyx {
+namespace frontend {
+
+class QCommandBuffer;
+
+QWidget* mainWindow();
+
+/**
+ * GuiView - Qt4 implementation of LyXView
+ *
+ * Qt-private implementation of the main LyX window.
+ */
+class GuiView : public QMainWindow, public LyXView {
+       Q_OBJECT
+public:
+       /// create a main window of the given dimensions
+       GuiView(unsigned int w, unsigned int h);
+
+       ~GuiView();
+
+       /// show - display the top-level window
+       void show();
+
+       /// show busy cursor
+       virtual void busy(bool) const;
+
+       /// display a status message
+       virtual void message(std::string const & str);
+
+       /// clear status message
+       virtual void clearMessage();
+
+       /// add the command buffer
+       void addCommandBuffer(QToolBar * toolbar);
+
+       /// menu item has been selected
+       void activated(FuncRequest const &);
+
+       // returns true if this view has the focus.
+       virtual bool hasFocus() const;
+
+       //
+       Gui & gui() { return frontend_; }
+
+       static QMainWindow* mainWidget();
+
+public slots:
+       /// idle timeout
+       void update_view_state_qt();
+
+       /// populate a toplevel menu and all its children on demand
+       void updateMenu(QAction *);
+
+protected:
+       /// make sure we quit cleanly
+       virtual void closeEvent(QCloseEvent * e);
+private:
+       /// focus the command buffer widget
+       void focus_command_widget();
+
+       /// update status bar
+       void update_view_state();
+
+       /**
+        * setWindowTitle - set title of window
+        * @param t main window title
+        * @param it iconified (short) title
+        */
+       virtual void setWindowTitle(std::string const & t, std::string const & it);
+
+       QTimer statusbar_timer_;
+
+       /// command buffer
+       QCommandBuffer * commandbuffer_;
+
+       ///
+       static QMainWindow* mainWidget_;
+
+       GuiImplementation frontend_;
+};
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // GUIVIEW_H
index 76c8c3b5f51d4e00de5036a35d6f8ac795a59bfb..324a134cfa28aaffd14d82e60a1b3b95a34a41d9 100644 (file)
@@ -16,7 +16,7 @@
 #include "GuiWorkArea.h"
 #include "QLPainter.h"
 #include "QLyXKeySym.h"
-#include "QtView.h"
+#include "GuiView.h"
 
 #include "ColorCache.h"
 #include "qt_helpers.h"
@@ -112,12 +112,12 @@ SyntheticMouseEvent::SyntheticMouseEvent()
 
 
 GuiWorkArea::GuiWorkArea(LyXView & owner, int w, int h)
-: QAbstractScrollArea(QtView::mainWidget()), WorkArea(owner, w, h), view_(owner), painter_(this)
+: QAbstractScrollArea(GuiView::mainWidget()), WorkArea(owner, w, h), view_(owner), painter_(this)
 {
        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
-       QtView::mainWidget()->setCentralWidget(this);
+       GuiView::mainWidget()->setCentralWidget(this);
 
        setAcceptDrops(true);
 
index 91220eaddd701abe3f3622d0a219fa7be6e3887a..d2eab207c94e9ba3dd4035b2fedf45dc3fe2a43f 100644 (file)
@@ -12,7 +12,7 @@
 
 // Qt defines a macro 'signals' that clashes with a boost namespace.
 // All is well if the namespace is visible first.
-#include "QtView.h"
+#include "GuiView.h"
 
 #include "QCommandBuffer.h"
 #include "QCommandEdit.h"
@@ -74,7 +74,7 @@ protected:
 } // end of anon
 
 
-QCommandBuffer::QCommandBuffer(QtView * view, ControlCommandBuffer & control, QWidget * parent)
+QCommandBuffer::QCommandBuffer(GuiView * view, ControlCommandBuffer & control, QWidget * parent)
        : QWidget(parent), view_(view), controller_(control)
 {
        QPixmap qpup(toqstr(libFileSearch("images", "up", "xpm")));
index 5594982132a9ec9a0dc5d9c29983b912b410e366..44f87a9a57dcb357a2b4a6b1048d2551ace0192e 100644 (file)
@@ -20,13 +20,13 @@ namespace lyx {
 namespace frontend {
 
 class QCommandEdit;
-class QtView;
+class GuiView;
 class ControlCommandBuffer;
 
 class QCommandBuffer : public QWidget {
        Q_OBJECT
 public:
-       QCommandBuffer(QtView * view, ControlCommandBuffer & control, QWidget * parent=NULL);
+       QCommandBuffer(GuiView * view, ControlCommandBuffer & control, QWidget * parent=NULL);
 
        /// focus the edit widget
        void focus_command();
@@ -45,7 +45,7 @@ public slots:
        void down();
 private:
        /// owning view
-       QtView * view_;
+       GuiView * view_;
 
        /// controller
        ControlCommandBuffer & controller_;
index 846feed71441d9705cb6621c3bd4da682deb5912..b64d5516324f2dc7318c09bbfd32d4f3efb1c8c8 100644 (file)
@@ -12,7 +12,7 @@
 
 // Qt defines a macro 'signals' that clashes with a boost namespace.
 // All is well if the namespace is visible first.
-#include "QtView.h"
+#include "GuiView.h"
 
 #include "QLMenubar.h"
 #include "QLPopupMenu.h"
@@ -43,7 +43,7 @@ namespace frontend {
 // MacOSX specific stuff is at the end.
 
 QLMenubar::QLMenubar(LyXView * view, MenuBackend & mbe)
-       : owner_(static_cast<QtView*>(view)), menubackend_(mbe)
+       : owner_(static_cast<GuiView*>(view)), menubackend_(mbe)
 {
        macxMenuBarInit();
 
@@ -114,7 +114,7 @@ void QLMenubar::openByName(string const & name)
 void QLMenubar::update()
 { }
 
-QtView * QLMenubar::view()
+GuiView * QLMenubar::view()
 {
        return owner_;
 }
index 4841c644aaf51ba821f4a671667095c655fd9b04..ab17a4a043fe8ba03e63065b70b2b1f03b85e657 100644 (file)
@@ -33,7 +33,7 @@ namespace lyx {
 
 namespace frontend {
 
-class QtView;
+class GuiView;
 
 class QLMenubar : public QObject, public Menubar {
        Q_OBJECT
@@ -44,7 +44,7 @@ public:
        void openByName(std::string const &);
 
        /// return the owning view
-       QtView * view();
+       GuiView * view();
 
        /// return the menu controller
        MenuBackend const & backend();
@@ -64,7 +64,7 @@ private:
        void macxMenuBarInit();
 
        /// owning view
-       QtView * owner_;
+       GuiView * owner_;
 
        /// menu controller
        MenuBackend & menubackend_;
index 41cb2e41b2612b424edd9274473c4424f26780a0..ea90bfbdc7ef0ada90928685a7855ecdc85d7395 100644 (file)
@@ -15,7 +15,7 @@
 
 // Qt defines a macro 'signals' that clashes with a boost namespace.
 // All is well if the namespace is visible first.
-#include "QtView.h"
+#include "GuiView.h"
 
 #include "Action.h"
 #include "QLPopupMenu.h"
index b70d521c1bb03c832dcc4eba8b3c01ed2577668f..91c4e8a58ca6a6d6215e80b833e71dde23cd52da 100644 (file)
@@ -24,7 +24,7 @@
 #include "gettext.h"
 #include "lyxfunc.h"
 
-#include "QtView.h"
+#include "GuiView.h"
 #include "QLToolbar.h"
 #include "Action.h"
 #include "qt_helpers.h"
@@ -81,7 +81,7 @@ Qt::ToolBarArea getToolBarPosition(ToolbarBackend::Flags const & flags)
 } // namespace anon
 
 
-QLayoutBox::QLayoutBox(QToolBar * toolbar, QtView & owner)
+QLayoutBox::QLayoutBox(QToolBar * toolbar, GuiView & owner)
        : owner_(owner)
 {
        combo_ = new QComboBox;
@@ -189,7 +189,7 @@ namespace lyx {
 namespace frontend {
 
 QLToolbar::QLToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & owner)
-       : owner_(dynamic_cast<QtView &>(owner)),
+       : owner_(dynamic_cast<GuiView &>(owner)),
          toolbar_(new QToolBar(qt_(tbb.gui_name), (QWidget*) &owner_)) //, getPosition(tbb.flags)))
 {
        /// \toto Move \a addToolBar call into QView because, in Qt4,
index 22b869a3f1594eb6e7a038b0d1c113b7072405a1..0a7d303ea66b57a10952611bd16c6275b2376d05 100644 (file)
@@ -29,14 +29,14 @@ namespace lyx {
 namespace frontend {
 
 class QLayoutBox;
-class QtView;
+class GuiView;
 class Action;
 
 
 class QLayoutBox : public QObject, public LayoutBox {
        Q_OBJECT
 public:
-       QLayoutBox(QToolBar *, QtView &);
+       QLayoutBox(QToolBar *, GuiView &);
 
        /// select the right layout in the combox.
        void set(std::string const & layout);
@@ -54,7 +54,7 @@ private slots:
 
 private:
        QComboBox * combo_;
-       QtView & owner_;
+       GuiView & owner_;
 };
 
 
@@ -77,7 +77,7 @@ signals:
 private:
 
        std::vector<Action *> ActionVector;
-       QtView & owner_;
+       GuiView & owner_;
        QToolBar * toolbar_;
 
        boost::scoped_ptr<QLayoutBox> layout_;
diff --git a/src/frontends/qt4/QtView.C b/src/frontends/qt4/QtView.C
deleted file mode 100644 (file)
index db07c73..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * \file QtView.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- * \author John Levon
- * \author Abdelrazak Younes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#undef QT3_SUPPORT
-
-#include <config.h>
-
-#include "BufferView.h"
-#include "lyx_cb.h"
-#include "lyxrc.h"
-#include "lyx_main.h"
-#include "session.h"
-#include "lyxfunc.h"
-#include "MenuBackend.h"
-#include "funcrequest.h"
-#include "funcrequest.h"
-
-#include "debug.h"
-
-#include "frontends/Toolbars.h"
-
-#include "support/filetools.h"
-
-#include "support/convert.h"
-#include <boost/bind.hpp>
-
-#include "QtView.h"
-#include "QLMenubar.h"
-#include "FontLoader.h"
-#include "QCommandBuffer.h"
-#include "qt_helpers.h"
-
-#include <QApplication>
-#include <QPixmap>
-#include <QStatusBar>
-#include <QToolBar>
-#include <QCloseEvent>
-#include <QAction>
-//#include <QMenu>
-//#include <QMenuBar>
-
-#include "support/lstrings.h"
-
-
-using std::string;
-using std::endl;
-
-FontLoader fontloader;
-
-namespace lyx {
-
-using support::subst;
-using support::libFileSearch;
-
-namespace frontend {
-
-namespace {
-
-int const statusbar_timer_value = 3000;
-
-} // namespace anon
-
-
-QtView::QtView(unsigned int width, unsigned int height)
-       : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
-{
-       mainWidget_ = this;
-
-//     setToolButtonStyle(Qt::ToolButtonIconOnly);
-//     setIconSize(QSize(12,12));
-
-       bufferview_.reset(new BufferView(this, width, height));
-
-       menubar_.reset(new QLMenubar(this, menubackend));
-       connect(menuBar(), SIGNAL(triggered(QAction *)), this, SLOT(updateMenu(QAction *)));
-
-       getToolbars().init();
-
-       statusBar()->setSizeGripEnabled(false);
-
-       view_state_changed.connect(boost::bind(&QtView::update_view_state, this));
-       connect(&statusbar_timer_, SIGNAL(timeout()), this, SLOT(update_view_state_qt()));
-
-#ifndef Q_WS_MACX
-       //  assign an icon to main form. We do not do it under Qt/Mac,
-       //  since the icon is provided in the application bundle.
-       string const iconname = libFileSearch("images", "lyx", "xpm");
-       if (!iconname.empty())
-               setWindowIcon(QPixmap(toqstr(iconname)));
-#endif
-
-       // make sure the buttons are disabled if needed
-       updateToolbars();
-}
-
-
-QtView::~QtView()
-{
-}
-
-void QtView::updateMenu(QAction *action)
-{
-       menubar_->update();
-}
-
-void QtView::setWindowTitle(string const & t, string const & it)
-{
-       QMainWindow::setWindowTitle(toqstr(t));
-       QMainWindow::setWindowIconText(toqstr(it));
-}
-
-
-void QtView::addCommandBuffer(QToolBar * toolbar)
-{
-       commandbuffer_ = new QCommandBuffer(this, *controlcommand_);
-       focus_command_buffer.connect(boost::bind(&QtView::focus_command_widget, this));
-       toolbar->addWidget(commandbuffer_);
-}
-
-
-void QtView::message(string const & str)
-{
-       statusBar()->showMessage(toqstr(str));
-       statusbar_timer_.stop();
-       statusbar_timer_.start(statusbar_timer_value);
-}
-
-
-void QtView::clearMessage()
-{
-       update_view_state_qt();
-}
-
-
-void QtView::focus_command_widget()
-{
-       if (commandbuffer_)
-               commandbuffer_->focus_command();
-}
-
-
-void QtView::update_view_state_qt()
-{
-       statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage()));
-       statusbar_timer_.stop();
-}
-
-
-void QtView::update_view_state()
-{
-       // let the user see the explicit message
-       if (statusbar_timer_.isActive())
-               return;
-
-       statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage()));
-}
-
-
-void QtView::activated(FuncRequest const & func)
-{
-       getLyXFunc().dispatch(func);
-}
-
-
-bool QtView::hasFocus() const
-{
-       return qApp->activeWindow() == this;
-}
-
-
-void QtView::closeEvent(QCloseEvent *)
-{
-       QRect geometry = normalGeometry();
-       Session & session = LyX::ref().session();
-       // save windows size and position
-       session.saveSessionInfo("WindowWidth", convert<string>(geometry.width()));
-       session.saveSessionInfo("WindowHeight", convert<string>(geometry.height()));
-       session.saveSessionInfo("WindowIsMaximized", (isMaximized() ? "yes" : "no"));
-       if (lyxrc.geometry_xysaved) {
-               session.saveSessionInfo("WindowPosX", convert<string>(geometry.x()));
-               session.saveSessionInfo("WindowPosY", convert<string>(geometry.y()));
-       }
-       // trigger LFUN_LYX_QUIT instead of quit directly
-       // since LFUN_LYX_QUIT may have more cleanup stuff
-       getLyXFunc().dispatch(FuncRequest(LFUN_LYX_QUIT));
-}
-
-
-void QtView::show()
-{
-       QMainWindow::setWindowTitle(qt_("LyX"));
-       QMainWindow::show();
-}
-
-
-void QtView::busy(bool yes) const
-{
-       if (yes)
-               QApplication::setOverrideCursor(Qt::WaitCursor);
-       else
-               QApplication::restoreOverrideCursor();
-}
-
-QMainWindow* QtView::mainWidget()
-{
-       return mainWidget_;
-}
-
-QMainWindow* QtView::mainWidget_ = 0;
-
-
-} // namespace frontend
-} // namespace lyx
-
-#include "QtView_moc.cpp"
diff --git a/src/frontends/qt4/QtView.h b/src/frontends/qt4/QtView.h
deleted file mode 100644 (file)
index ab18f8c..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-// -*- C++ -*-
-/**
- * \file QtView.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjornes
- * \author John Levon
- * \author Abdelrazak Younes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef QTVIEW_H
-#define QTVIEW_H
-
-// Must be here because of moc.
-#include <config.h>
-
-#include "GuiImplementation.h"
-
-#include "frontends/LyXView.h"
-#include "funcrequest.h"
-
-#include <QMainWindow>
-#include <QTimer>
-#include <QAction>
-#include <QCloseEvent>
-
-class QToolBar;
-
-//class FuncRequest;
-
-//class string;
-
-namespace lyx {
-namespace frontend {
-
-class QCommandBuffer;
-
-QWidget* mainWindow();
-
-/**
- * QtView - Qt implementation of LyXView
- *
- * Qt-private implementation of the main LyX window.
- */
-class QtView : public QMainWindow, public LyXView {
-       Q_OBJECT
-public:
-       /// create a main window of the given dimensions
-       QtView(unsigned int w, unsigned int h);
-
-       ~QtView();
-
-       /// show - display the top-level window
-       void show();
-
-       /// show busy cursor
-       virtual void busy(bool) const;
-
-       /// display a status message
-       virtual void message(std::string const & str);
-
-       /// clear status message
-       virtual void clearMessage();
-
-       /// add the command buffer
-       void addCommandBuffer(QToolBar * toolbar);
-
-       /// menu item has been selected
-       void activated(FuncRequest const &);
-
-       // returns true if this view has the focus.
-       virtual bool hasFocus() const;
-
-       //
-       Gui & gui() { return frontend_; }
-
-       static QMainWindow* mainWidget();
-
-public slots:
-       /// idle timeout
-       void update_view_state_qt();
-
-       /// populate a toplevel menu and all its children on demand
-       void updateMenu(QAction *);
-
-protected:
-       /// make sure we quit cleanly
-       virtual void closeEvent(QCloseEvent * e);
-private:
-       /// focus the command buffer widget
-       void focus_command_widget();
-
-       /// update status bar
-       void update_view_state();
-
-       /**
-        * setWindowTitle - set title of window
-        * @param t main window title
-        * @param it iconified (short) title
-        */
-       virtual void setWindowTitle(std::string const & t, std::string const & it);
-
-       QTimer statusbar_timer_;
-
-       /// command buffer
-       QCommandBuffer * commandbuffer_;
-
-       ///
-       static QMainWindow* mainWidget_;
-
-       GuiImplementation frontend_;
-};
-
-} // namespace frontend
-} // namespace lyx
-
-#endif // QTVIEW_H
index 84d674575b6f889520a914094a45c94d82bb0c34..ed9116e3b400dc6dd91a623b59b43fc1177fe6cd 100644 (file)
@@ -39,7 +39,7 @@
 #include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "QtView.h"
+#include "GuiView.h"
 #include "ColorCache.h"
 #include "FontLoader.h"
 #include "QLImage.h"
@@ -59,7 +59,7 @@
 using lyx::support::ltrim;
 using lyx::support::package;
 
-using lyx::frontend::QtView;
+using lyx::frontend::GuiView;
 using lyx::frontend::Application;
 
 namespace os = lyx::support::os;
@@ -194,10 +194,10 @@ void start(string const & batch, vector<string> const & files,
        // this can't be done before because it needs the Languages object
        initEncodings();
 
-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+       boost::shared_ptr<GuiView> view_ptr(new GuiView(width, height));
        LyX::ref().addLyXView(view_ptr);
 
-       QtView & view = *view_ptr.get();
+       GuiView & view = *view_ptr.get();
 
        view.init();