]> git.lyx.org Git - lyx.git/blobdiff - src/LyXSendto.C
Herbert's upgrade to the recognized graphics formats.
[lyx.git] / src / LyXSendto.C
index 5e7587c35da3595b418a5b483e8e81598260c243..5b3d12188f9f7b4525eafae6a33b83fb12d21d64 100644 (file)
@@ -5,14 +5,16 @@
 #include "lyx_main.h"
 #include "lyxrc.h"
 #include "LString.h"
-#include "support/filetools.h"
-#include "support/path.h"
 #include "buffer.h"
-#include "lyx_gui_misc.h"
-#include "support/syscall.h"
 #include "gettext.h"
 #include "bufferview_funcs.h"
 #include "exporter.h"
+#include "BufferView.h"
+
+#include "support/filetools.h"
+#include "support/lstrings.h"
+#include "support/path.h"
+#include "support/systemcall.h"
 
 extern FD_form_sendto * fd_form_sendto;
 extern BufferView * current_view;
@@ -36,7 +38,7 @@ void MenuSendto()
         fl_raise_form(fd_form_sendto->form_sendto);
     } else {  
         fl_show_form(fd_form_sendto->form_sendto,
-                     FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
+                    FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
                      _("Send Document to Command"));
        if (ow < 0) {
                ow = fd_form_sendto->form_sendto->w;
@@ -78,8 +80,8 @@ void SendtoApplyCB(FL_OBJECT *, long)
     command = subst(command, "$$FName", fname);
     command += " &"; // execute in background
     // push directorypath, if necessary 
-    string path = OnlyPath(buffer->fileName());
-    if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)){
+    string path = buffer->filePath();
+    if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
         path = buffer->tmppath;
     }
     Path p(path);
@@ -93,7 +95,8 @@ void SendtoApplyCB(FL_OBJECT *, long)
     // create the .txt file in tmp_dir if this filetype is requested
     if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
         buffer->writeFileAscii(fname, lyxrc.ascii_linelen);
-    Systemcalls one(Systemcalls::System, command);    
+    Systemcall one;
+    one.startscript(Systemcall::Wait, command);    
 }