]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormSendto.C
No longer pass Controller & or Dialogs & to the View c-tors.
[lyx.git] / src / frontends / xforms / FormSendto.C
index 7d305d2c8e1a4a81d9ca0f7a91ce3664c8ffbd4c..6841c28664e487dd808bdc5bc4f5a32f811cd18e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright 2002 the LyX Team
  * Read the file COPYING
  *
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming, a.leeming@ic.ac.uk
  */
 
 #include <config.h>
 #endif
 
 #include "FormSendto.h"
-#include "form_sendto.h"
+#include "forms/form_sendto.h"
 #include "ControlSendto.h"
 #include "xformsBC.h"
 #include "Tooltips.h"
 #include "xforms_helpers.h"
 #include "converter.h"
 #include "gettext.h"
+#include FORMS_H_LOCATION
 
 using std::vector;
 
-typedef FormCB<ControlSendto, FormDB<FD_form_sendto> > base_class;
+typedef FormCB<ControlSendto, FormDB<FD_sendto> > base_class;
 
-FormSendto::FormSendto(ControlSendto & c)
-       : base_class(c, _("Send document to command"))
+FormSendto::FormSendto()
+       : base_class(_("Send document to command"))
 {}
 
 
 void FormSendto::build()
 {
-       dialog_.reset(build_sendto());
+       dialog_.reset(build_sendto(this));
 
        fl_set_input_return(dialog_->input_command, FL_RETURN_CHANGED);
+       setPrehandler(dialog_->input_command);
 
-        // Manage the ok, apply, restore and cancel/close buttons
+       // Manage the ok, apply, restore and cancel/close buttons
        bc().setOK(dialog_->button_ok);
        bc().setApply(dialog_->button_apply);
-       bc().setCancel(dialog_->button_cancel);
+       bc().setCancel(dialog_->button_close);
 
        // Set up the tooltip mechanism
-       string str = N_("Export the buffer to this format before running the command below on it.");
-       tooltips().initTooltip(dialog_->browser_formats, str);
+       string str = _("Export the buffer to this format before running the command below on it.");
+       tooltips().init(dialog_->browser_formats, str);
 
-       str = N_("Run this command on the buffer exported to the chosen format. $$FName will be replaced by the name of this file.");
-       tooltips().initTooltip(dialog_->input_command, str);
+       str = _("Run this command on the buffer exported to the chosen format. $$FName will be replaced by the name of this file.");
+       tooltips().init(dialog_->input_command, str);
 }
 
 
@@ -67,7 +69,7 @@ void FormSendto::update()
        }
 
        vector<string> const browser_keys =
-               getVectorFromBrowser(dialog_->browser_formats);
+               getVector(dialog_->browser_formats);
 
        if (browser_keys == keys)
                return;
@@ -90,8 +92,8 @@ ButtonPolicy::SMInput FormSendto::input(FL_OBJECT *, long)
        if (line < 1 || line > fl_get_browser_maxline(dialog_->browser_formats))
                return ButtonPolicy::SMI_INVALID;
 
-       string cmd = getStringFromInput(dialog_->input_command);
-       cmd = strip(frontStrip(cmd));
+       string cmd = getString(dialog_->input_command);
+       cmd = trim(cmd);
        if (cmd.empty())
                return ButtonPolicy::SMI_INVALID;
 
@@ -105,7 +107,7 @@ void FormSendto::apply()
        if (line < 1 || line > fl_get_browser_maxline(dialog_->browser_formats))
                return;
 
-       string const cmd = getStringFromInput(dialog_->input_command);
+       string const cmd = getString(dialog_->input_command);
 
        controller().setFormat(all_formats_[line-1]);
        controller().setCommand(cmd);