home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / LaTeXLog.C < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  64 lines

  1. #include <config.h>
  2.  
  3. #include <stdlib.h>
  4. #include FORMS_H_LOCATION
  5. #include "buffer.h"
  6. #include "latexoptions.h"
  7. #include "lyx_main.h"
  8. #include "LString.h"
  9. #include "filetools.h"
  10. #include "path.h"
  11. #include "lyxrc.h"
  12. #include "BufferView.h"
  13. #include "gettext.h"
  14.  
  15. //     $Id: LaTeXLog.C,v 1.1.1.1 1998/04/23 16:02:47 larsbj Exp $    
  16.  
  17. #if !defined(lint) && !defined(WITH_WARNINGS)
  18. static char vcid[] = "$Id: LaTeXLog.C,v 1.1.1.1 1998/04/23 16:02:47 larsbj Exp $";
  19. #endif /* lint */
  20.  
  21. /* Prototypes */
  22. extern FD_LaTeXLog *fd_latex_log;
  23. extern BufferView *current_view;
  24.  
  25. void ShowLatexLog()
  26. {
  27.     LString
  28.         filename, fname, path;
  29.  
  30.     filename = current_view->currentBuffer()->getFileName();
  31.     if (!filename.empty()) {
  32.     fname = SpaceLess(ChangeExtension(filename, ".log", true));
  33.     path = OnlyPath(filename);
  34.     if (lyxrc->use_tempdir || (IsDirWriteable(path) < 1)) {
  35.         path = current_view->currentBuffer()->tmppath;
  36.     }
  37.     }
  38.     //if (!path.empty()) PathPush(path); // path to LaTeX file
  39.     Path p(path);
  40.     if (!fl_load_browser(fd_latex_log->browser_latexlog,fname.c_str()))
  41.         fl_add_browser_line(fd_latex_log->browser_latexlog,
  42.                             _("NO LATEX LOG FILE!"));
  43.     if (fd_latex_log->LaTeXLog->visible) {
  44.     fl_raise_form(fd_latex_log->LaTeXLog);
  45.     }
  46.     else {
  47.     fl_show_form(fd_latex_log->LaTeXLog,
  48.              FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
  49.              _("LaTeX Log"));
  50.     }
  51.     //if (!filename.empty())
  52.     //    PathPop();    
  53. }
  54.  
  55. void LatexLogClose(FL_OBJECT *, long)
  56. {
  57.     fl_hide_form(fd_latex_log->LaTeXLog);
  58. }
  59.  
  60. void LatexLogUpdate(FL_OBJECT *, long)
  61. {
  62.     ShowLatexLog();
  63. }
  64.