]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXLog.C
small changes to ButtonController usage
[lyx.git] / src / LaTeXLog.C
index ac215a71f6eb9b61dcf59af247b900faa8943601..c0e453be364f6b167cc2f1e0c0db313d205ca4b5 100644 (file)
@@ -3,7 +3,7 @@
 #include <cstdlib>
 #include FORMS_H_LOCATION
 #include "buffer.h"
-#include "latexoptions.h"
+#include "log_form.h"
 #include "lyx_main.h"
 #include "LString.h"
 #include "support/FileInfo.h"
@@ -20,15 +20,16 @@ void ShowLatexLog()
 {
        string filename, fname, bname, path;
        bool use_build = false;
+       static int ow = -1, oh;
 
-       filename = current_view->currentBuffer()->getFileName();
+       filename = current_view->buffer()->getLatexName();
        if (!filename.empty()) {
-               fname = SpaceLess(ChangeExtension(filename, ".log", true));
-               bname = SpaceLess(ChangeExtension(filename,
-                                                 lyxrc->literate_extension + ".out", true));
+               fname = OnlyFilename(ChangeExtension(filename, ".log"));
+               bname = OnlyFilename(ChangeExtension(filename,
+                                       lyxrc.literate_extension + ".out"));
                path = OnlyPath(filename);
-               if (lyxrc->use_tempdir || (IsDirWriteable(path) < 1)) {
-                       path = current_view->currentBuffer()->tmppath;
+               if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
+                       path = current_view->buffer()->tmppath;
                }
                FileInfo f_fi(path + fname), b_fi(path + bname);
                if (b_fi.exist())
@@ -48,8 +49,13 @@ void ShowLatexLog()
                fl_raise_form(fd_latex_log->LaTeXLog);
        } else {
                fl_show_form(fd_latex_log->LaTeXLog,
-                            FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
+                            FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
                             use_build ? _("Build Program Log") : _("LaTeX Log"));
+               if (ow < 0) {
+                       ow = fd_latex_log->LaTeXLog->w;
+                       oh = fd_latex_log->LaTeXLog->h;
+               }
+               fl_set_form_minsize(fd_latex_log->LaTeXLog, ow, oh);
        }
 }