]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.cpp
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / Dialog.cpp
index 47db6db5a7bec86a607bfb5065f90aacfd6f8fe2..17db59300103a4b060de55a71811e180bd69bd3a 100644 (file)
@@ -16,6 +16,7 @@
 #include "qt_helpers.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
@@ -25,6 +26,7 @@
 #include "insets/Inset.h"
 
 #include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lassert.h"
 
 #include <QLabel>
@@ -42,17 +44,6 @@ using namespace lyx::support;
 namespace lyx {
 namespace frontend {
 
-bool CheckedLineEdit2::check() const
-{
-       bool const valid = input_->hasAcceptableInput();
-       // Visual feedback.
-       setValid(input_, valid);
-       if (label_)
-               setValid(label_, valid);
-       return valid;
-}
-
-
 Dialog::Dialog(GuiView & lv, QString const & name, QString const & title)
        : name_(name), title_(title), lyxview_(&lv)
 {}
@@ -62,21 +53,6 @@ Dialog::~Dialog()
 {}
 
 
-void Dialog::addCheckedWidget(QLineEdit * input, QWidget * label)
-{
-       checked_line_edits_.append(CheckedLineEdit2(input, label));
-}
-
-
-bool Dialog::checkWidgets() const
-{
-       bool valid = true;
-       Q_FOREACH(CheckedLineEdit2 const & le, checked_line_edits_)
-                       valid &= le.check();
-       return valid;
-}
-
-
 bool Dialog::canApply() const
 {
        FuncRequest const fr(getLfun(), fromqstr(name_));
@@ -117,7 +93,7 @@ bool Dialog::isBufferReadonly() const
 }
 
 
-QString Dialog::bufferFilepath() const
+QString Dialog::bufferFilePath() const
 {
        return toqstr(buffer().filePath());
 }
@@ -125,9 +101,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;
@@ -142,11 +118,18 @@ BufferView const * Dialog::bufferview() const
 
 Buffer const & Dialog::buffer() const
 {
-       LASSERT(lyxview_->currentBufferView(), /**/);
+       LAPPERR(lyxview_->currentBufferView());
        return lyxview_->currentBufferView()->buffer();
 }
 
 
+Buffer const & Dialog::documentBuffer() const
+{
+       LAPPERR(lyxview_->documentBufferView());
+       return lyxview_->documentBufferView()->buffer();
+}
+
+
 void Dialog::showData(string const & data)
 {
        if (isBufferDependent() && !isBufferAvailable())