]> git.lyx.org Git - lyx.git/blobdiff - src/LyXView.C
forgot this
[lyx.git] / src / LyXView.C
index 6f6a8982ab6107b654467a48c08fcb76cdb87c80..561e644f1c499863ab23e2157ca6dd54151734fd 100644 (file)
@@ -1,9 +1,8 @@
-
 /* This file is part of
- * ====================================================== 
- * 
+ * ======================================================
+ *
  *           LyX, The Document Processor
- *        
+ *
  *           Copyright 1995 Matthias Ettrich
  *           Copyright 1995-2001 The LyX Team.
  *
 #include "lyxtext.h"
 #include "buffer.h"
 #include "MenuBackend.h"
-#include "lyx_gui_misc.h"      // [update,Close,Redraw]AllBufferRelatedDialogs
 #include "bufferview_funcs.h" // CurrentState()
 #include "gettext.h"
 #include "lyxfunc.h"
 #include "BufferView.h"
+#include "lyxtextclasslist.h"
 
 #include "frontends/Dialogs.h"
 #include "frontends/Toolbar.h"
 #include <unistd.h>
 
 using std::endl;
-using lyx::layout_type;
 
 extern void AutoSave(BufferView *);
 extern void QuitLyX();
 
-layout_type current_layout = 0;
+string current_layout;
 
 
 LyXView::LyXView()
@@ -59,13 +57,7 @@ LyXView::LyXView()
        autosave_timeout = new Timeout(5000);
 
        dialogs_ = new Dialogs(this);
-       // temporary until all dialogs moved into Dialogs.
-       dialogs_->updateBufferDependent
-               .connect(SigC::slot(&updateAllVisibleBufferRelatedDialogs));
-       dialogs_->hideBufferDependent
-               .connect(SigC::slot(&CloseAllBufferRelatedDialogs));
        Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw));
-       Dialogs::redrawGUI.connect(SigC::slot(&RedrawAllBufferRelatedDialogs));
 }
 
 
@@ -82,7 +74,7 @@ LyXView::~LyXView()
 }
 
 
-void LyXView::resize() 
+void LyXView::resize()
 {
        view()->resize();
 }
@@ -107,7 +99,7 @@ Toolbar * LyXView::getToolbar() const
 }
 
 
-void LyXView::setLayout(layout_type layout)
+void LyXView::setLayout(string const & layout)
 {
        toolbar->setLayout(layout);
 }
@@ -155,7 +147,7 @@ Menubar * LyXView::getMenubar() const
 }
 
 
-void LyXView::updateMenubar() 
+void LyXView::updateMenubar()
 {
        if ((!view() || !view()->buffer())
            && menubackend.hasMenu("main_nobuffer"))
@@ -201,19 +193,20 @@ void LyXView::updateLayoutChoice()
        // document is loaded.
        if (!view() || !view()->buffer()) {
                toolbar->clearLayoutList();
-               return; 
+               return;
        }
 
        // Update the layout display
        if (last_textclass != int(buffer()->params.textclass)) {
                toolbar->updateLayoutList(true);
                last_textclass = int(buffer()->params.textclass);
-               current_layout = 0;
+               current_layout = textclasslist[last_textclass].defaultLayoutName();
        } else {
                toolbar->updateLayoutList(false);
        }
-       
-       layout_type layout = bufferview->getLyXText()->cursor.par()->getLayout();
+
+       string const & layout =
+               bufferview->getLyXText()->cursor.par()->layout();
 
        if (layout != current_layout) {
                toolbar->setLayout(layout);