]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlPreamble.C
port the graphics dialog to the new scheme and get rid of the ControlInset
[lyx.git] / src / frontends / controllers / ControlPreamble.C
index d2983004460e1ea587d8932e892d549fa922cf79..fa96853c968eac4aba3432073c8259b9a2795e18 100644 (file)
@@ -1,63 +1,63 @@
 /**
- * \file FormPreamble.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * \file ControlPreamble.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Edwin Leuven, leuven@fee.uva.nl
+ * \author Edwin Leuven
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "ControlPreamble.h"
-#include "LyXView.h"
-#include "Dialogs.h"
+
+#include "ViewBase.h"
+
 #include "buffer.h"
-#include "lyxrc.h"
-#include "Liason.h"
+#include "gettext.h"
+
+#include "frontends/LyXView.h"
 
 
 ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
-       : ControlDialog<ControlConnectBD>(lv, d)
-{
-    d_.showPreamble.connect(SigC::slot(this, &ControlPreamble::show));
-}
+       : ControlDialogBD(lv, d)
+{}
 
 
 void ControlPreamble::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
-   
+
        view().apply();
 
-       lv_.buffer()->params.preamble = params();
-       lv_.buffer()->markDirty();
-       Liason::setMinibuffer(&lv_, _("LaTeX preamble set"));
+       buffer()->params.preamble = params();
+       buffer()->markDirty();
+       lv_.message(_("LaTeX preamble set"));
+}
+
+
+string const & ControlPreamble::params() const
+{
+       return params_;
 }
 
 
-string & ControlPreamble::params() const
+void ControlPreamble::params(string const & newparams)
 {
-       Assert(params_);
-       return *params_;
+       params_ = newparams;
 }
 
 
 void ControlPreamble::setParams()
 {
-       if (params_) delete params_;
-       params_ = new string(lv_.buffer()->params.preamble);
+       params_ = buffer()->params.preamble;
 }
 
 
 void ControlPreamble::clearParams()
 {
-       if (params_) {
-               delete params_;
-               params_ = 0;
-       }
+       params_.erase();
 }