]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXView.C
Remove WorkArea.C (empty).
[lyx.git] / src / frontends / LyXView.C
index d805fee37175cec6c713a1110dd7bc6ae9d9a885..f49bdeeed1b542862f4c9b9dd170c07704233c97 100644 (file)
@@ -6,35 +6,34 @@
  * \author Lars Gullik Bjønnes
  * \author John Levon
  *
- * 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 "LyXView.h"
+#include "Dialogs.h"
+#include "Timeout.h"
+#include "Toolbar.h"
+#include "Menubar.h"
+
+#include "buffer.h"
+#include "BufferView.h"
+#include "bufferview_funcs.h"
 #include "debug.h"
+#include "funcrequest.h"
+#include "gettext.h"
 #include "intl.h"
+#include "lyx_cb.h"
+#include "lyxfunc.h"
 #include "lyxrc.h"
 #include "lyxtext.h"
-#include "buffer.h"
 #include "MenuBackend.h"
-#include "gettext.h"
-#include "lyxfunc.h"
-#include "funcrequest.h"
-#include "lyx_cb.h"
-#include "BufferView.h"
-#include "bufferview_funcs.h"
 
-#include "Dialogs.h"
-#include "Toolbar.h"
-#include "Timeout.h"
-#include "Menubar.h"
 #include "controllers/ControlCommandBuffer.h"
 
+#include "mathed/math_cursor.h"
+
 #include "support/filetools.h" // OnlyFilename()
 
 #include <boost/bind.hpp>
 #include <sys/time.h>
 #include <unistd.h>
 
+using namespace lyx::support;
 using std::endl;
 
+
 string current_layout;
 
 
@@ -52,7 +53,7 @@ LyXView::LyXView()
          autosave_timeout_(new Timeout(5000)),
          lyxfunc_(new LyXFunc(this)),
          dialogs_(new Dialogs(*this)),
-         controlcommand_(new ControlCommandBuffer(getLyXFunc()))
+         controlcommand_(new ControlCommandBuffer(*this))
 {
        lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
 }
@@ -99,7 +100,10 @@ void LyXView::setLayout(string const & layout)
 
 void LyXView::updateToolbar()
 {
-       toolbar_->update();
+       bool const math = mathcursor;
+       bool const table =
+               !getLyXFunc().getStatus(LFUN_LAYOUT_TABULAR).disabled();
+       toolbar_->update(math, table);
 }