]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/LyXView.C
Martin's changes to the Note inset.
[lyx.git] / src / frontends / LyXView.C
index cc95fc7cf335b774766ab8d9f7ba7f8694df0556..4b00b244fe97370c77a7659088b86a12f712abe4 100644 (file)
@@ -4,17 +4,13 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Lars Gullik Bjønnes
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "LyXView.h"
 #include "debug.h"
 #include "intl.h"
@@ -34,6 +30,7 @@
 #include "Timeout.h"
 #include "Menubar.h"
 #include "controllers/ControlCommandBuffer.h"
+#include "mathed/math_cursor.h"
 
 #include "support/filetools.h" // OnlyFilename()
 
@@ -42,6 +39,7 @@
 #include <sys/time.h>
 #include <unistd.h>
 
+using namespace lyx::support;
 using std::endl;
 
 string current_layout;
@@ -52,7 +50,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 +97,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);
 }
 
 
@@ -162,7 +163,7 @@ void LyXView::updateWindowTitle()
                        minimize_title = OnlyFilename(cur_title);
                        if (!buffer()->isClean()) {
                                maximize_title += _(" (changed)");
-                               minimize_title += "*";
+                               minimize_title += '*';
                        }
                        if (buffer()->isReadonly())
                                maximize_title += _(" (read only)");
@@ -181,5 +182,5 @@ void LyXView::dispatch(FuncRequest const & req)
        // substitute the correct BufferView here
        FuncRequest r = req;
        r.setView(view().get());
-       getLyXFunc().dispatch(r); 
+       getLyXFunc().dispatch(r);
 }