]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDialog.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiDialog.cpp
index aa7ae171d716a4f150b720f6b1819729e621a3e1..7d4bf582116f11ddffcabfd8692db2870270ee27 100644 (file)
 #include <config.h>
 
 #include "GuiDialog.h"
-#include "GuiCommand.h"
 
 #include "GuiView.h"
 #include "qt_helpers.h"
 #include "FuncRequest.h"
 
-#include "insets/InsetCommand.h"
-
 #include "support/debug.h"
 
 #include <QCloseEvent>
@@ -29,7 +26,8 @@ namespace lyx {
 namespace frontend {
 
 GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
-       :  QDialog(&lv), Dialog(lv, name, "LyX: " + title), is_closing_(false)
+       : QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false), 
+         is_closing_(false)
 {}
 
 
@@ -53,6 +51,13 @@ void GuiDialog::slotApply()
 }
 
 
+void GuiDialog::slotAutoApply()
+{
+       apply();
+       bc().autoApply();
+}
+
+
 void GuiDialog::slotOK()
 {
        is_closing_ = true;
@@ -90,8 +95,10 @@ void GuiDialog::changed()
 
 void GuiDialog::enableView(bool enable)
 {
-       bc().setReadOnly(!enable);
-       bc().setValid(enable);
+       if (!enable) {
+               bc().setReadOnly(true);
+               bc().setValid(false);
+       }
        Dialog::enableView(enable);
 }
 
@@ -111,41 +118,7 @@ void GuiDialog::updateView()
        setUpdatesEnabled(true);
 }
 
-
-/////////////////////////////////////////////////////////////////////
-//
-// Command based dialogs
-//
-/////////////////////////////////////////////////////////////////////
-
-
-GuiCommand::GuiCommand(GuiView & lv, QString const & name,
-       QString const & title)
-       : GuiDialog(lv, name, title), params_(insetCode(fromqstr(name))),
-               lfun_name_(fromqstr(name))
-{
-}
-
-
-bool GuiCommand::initialiseParams(string const & data)
-{
-       // The name passed with LFUN_INSET_APPLY is also the name
-       // used to identify the mailer.
-       InsetCommand::string2params(lfun_name_, data, params_);
-       return true;
-}
-
-
-void GuiCommand::dispatchParams()
-{
-       if (lfun_name_.empty())
-               return;
-
-       string const lfun = InsetCommand::params2string(lfun_name_, params_);
-       dispatch(FuncRequest(getLfun(), lfun));
-}
-
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiDialog_moc.cpp"
+#include "moc_GuiDialog.cpp"