]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.cpp
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / Dialog.cpp
index 15aeca52b2c030c4eab60aedd97188988e0fb340..65c9a881bbb7e0e1dd61d9142e3cf17c7f878c30 100644 (file)
 #include "qt_helpers.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "LyXFunc.h"
+#include "LyX.h"
 
 #include "insets/Inset.h"
 
 #include "support/debug.h"
 #include "support/lassert.h"
 
+#include <QLabel>
+#include <QLineEdit>
+#include <QList>
 #include <QSettings>
 #include <QString>
+#include <QValidator>
 
 #include <string>
 
@@ -38,7 +43,6 @@ using namespace lyx::support;
 namespace lyx {
 namespace frontend {
 
-
 Dialog::Dialog(GuiView & lv, QString const & name, QString const & title)
        : name_(name), title_(title), lyxview_(&lv)
 {}
@@ -88,7 +92,7 @@ bool Dialog::isBufferReadonly() const
 }
 
 
-QString Dialog::bufferFilepath() const
+QString Dialog::bufferFilePath() const
 {
        return toqstr(buffer().filePath());
 }
@@ -96,9 +100,9 @@ QString Dialog::bufferFilepath() const
 
 KernelDocType Dialog::docType() const
 {
-       if (buffer().isLatex())
+       if (buffer().params().isLatex())
                return LATEX;
-       if (buffer().isLiterate())
+       if (buffer().params().isLiterate())
                return LITERATE;
 
        return DOCBOOK;
@@ -118,6 +122,13 @@ Buffer const & Dialog::buffer() const
 }
 
 
+Buffer const & Dialog::documentBuffer() const
+{
+       LASSERT(lyxview_->documentBufferView(), /**/);
+       return lyxview_->documentBufferView()->buffer();
+}
+
+
 void Dialog::showData(string const & data)
 {
        if (isBufferDependent() && !isBufferAvailable())
@@ -218,7 +229,7 @@ Inset const * Dialog::inset(InsetCode code) const
 
 void Dialog::checkStatus()
 {
-       // buffer independant dialogs are always active.
+       // buffer independent dialogs are always active.
        // This check allows us leave canApply unimplemented for some dialogs.
        if (!isBufferDependent()) {
                updateView();
@@ -238,9 +249,7 @@ void Dialog::checkStatus()
                // refreshReadOnly() is too generous in _enabling_ widgets
                // update dialog to disable disabled widgets again
 
-               if (!readonly || canApplyToReadOnly())
-                       updateView();
-
+               updateView();
        } else
                enableView(false);
 }