]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Dialog.cpp
Compil fix.
[lyx.git] / src / frontends / qt4 / Dialog.cpp
index 9eb05efc2034d82215b30dc73dc706d6e878613f..88cfcec95f162597ed8414026cf2401eccd94620 100644 (file)
@@ -21,6 +21,7 @@
 #include "LyXFunc.h"
 
 #include "support/debug.h"
+#include "support/lassert.h"
 
 #include <QSettings>
 #include <QString>
@@ -34,7 +35,7 @@ namespace lyx {
 namespace frontend {
 
 
-Dialog::Dialog(GuiView & lv, string const & name, QString const & title)
+Dialog::Dialog(GuiView & lv, QString const & name, QString const & title)
        : name_(name), title_(title), lyxview_(&lv)
 {}
 
@@ -43,15 +44,9 @@ Dialog::~Dialog()
 {}
 
 
-string const & Dialog::name() const
-{
-       return name_;
-}
-
-
 bool Dialog::canApply() const
 {
-       FuncRequest const fr(getLfun(), from_ascii(name_));
+       FuncRequest const fr(getLfun(), fromqstr(name_));
        FuncStatus const fs(getStatus(fr));
        return fs.enabled();
 }
@@ -66,13 +61,13 @@ void Dialog::dispatch(FuncRequest const & fr) const
 
 void Dialog::updateDialog() const
 {
-       dispatch(FuncRequest(LFUN_DIALOG_UPDATE, from_ascii(name_)));
+       dispatch(FuncRequest(LFUN_DIALOG_UPDATE, fromqstr(name_)));
 }
 
 
 void Dialog::disconnect() const
 {
-       lyxview_->disconnectDialog(name_);
+       lyxview_->disconnectDialog(fromqstr(name_));
 }
 
 
@@ -90,9 +85,9 @@ bool Dialog::isBufferReadonly() const
 }
 
 
-string const Dialog::bufferFilepath() const
+QString Dialog::bufferFilepath() const
 {
-       return buffer().filePath();
+       return toqstr(buffer().filePath());
 }
 
 
@@ -121,14 +116,14 @@ BufferView const * Dialog::bufferview() const
 
 Buffer & Dialog::buffer()
 {
-       BOOST_ASSERT(lyxview_->buffer());
+       LASSERT(lyxview_->buffer(), /**/);
        return *lyxview_->buffer();
 }
 
 
 Buffer const & Dialog::buffer() const
 {
-       BOOST_ASSERT(lyxview_->buffer());
+       LASSERT(lyxview_->buffer(), /**/);
        return *lyxview_->buffer();
 }
 
@@ -167,27 +162,11 @@ void Dialog::apply()
 }
 
 
-void Dialog::updateData(string const & data)
-{
-       if (isBufferDependent() && !isBufferAvailable())
-               return;
-
-       if (!initialiseParams(data)) {
-               LYXERR0("Dialog \"" << name()
-                      << "\" could not be initialized");
-               return;
-       }
-
-       updateView();
-}
-
-
 void Dialog::showView()
 {
-       // Make sure the dialog controls are correctly enabled/disabled.
+       // Make sure the dialog controls are correctly enabled/disabled with
+       // readonly status.
        checkStatus();
-       // Make sure it is up-to-date.
-       updateView(); 
        if (exitEarly())
                return;
 
@@ -229,8 +208,10 @@ void Dialog::checkStatus()
 {
        // buffer independant dialogs are always active.
        // This check allows us leave canApply unimplemented for some dialogs.
-       if (!isBufferDependent())
+       if (!isBufferDependent()) {
+               updateView();
                return;
+       }
 
        // deactivate the dialog if we have no buffer
        if (!isBufferAvailable()) {
@@ -256,7 +237,7 @@ void Dialog::checkStatus()
 QString Dialog::sessionKey() const
 {
        return "view-" + QString::number(lyxview_->id())
-               + "/" + toqstr(name());
+               + "/" + name();
 }