]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_gui_misc.C
more changes, read the Changelog
[lyx.git] / src / lyx_gui_misc.C
index e759718f2a9c4fefe570edd5bb5d9c03dcaad551..1262e486a474886fbc8a5ae04fbf1ff42cbeaa05 100644 (file)
@@ -32,6 +32,7 @@
 #include "insets/insetindex.h"
 #include "LyXView.h"
 #include "bufferview_funcs.h"
+#include "support/filetools.h"
 
 using std::pair;
 using std::make_pair;
@@ -47,7 +48,6 @@ extern FD_form_table_options * fd_form_table_options;
 extern FD_form_quotes * fd_form_quotes;
 extern FD_form_preamble * fd_form_preamble;
 extern FD_form_table * fd_form_table;
-extern FD_form_print * fd_form_print;
 extern FD_form_sendto * fd_form_sendto;
 extern FD_form_figure * fd_form_figure;
 extern FD_form_toc * fd_form_toc;
@@ -87,7 +87,7 @@ extern "C" int IgnoreCloseBoxCB(FL_FORM *, void *)
 // This is also one of the functions that we _really_ dont want
 // we should try to finds way to help us with that.
 // The signal/slot mechanism can probably help. 
-void CloseAllBufferRelatedPopups()
+void CloseAllBufferRelatedDialogs()
 {
        // don't forget to check that dynamically created forms
        // have been created otherwise hiding one could cause a crash
@@ -114,9 +114,6 @@ void CloseAllBufferRelatedPopups()
        if (fd_form_table->form_table->visible) {
                fl_hide_form(fd_form_table->form_table);
        }
-       if (fd_form_print->form_print->visible) {
-               fl_hide_form(fd_form_print->form_print);
-       }
        if (fd_form_figure->form_figure->visible) {
                fl_hide_form(fd_form_figure->form_figure);
        }
@@ -174,8 +171,8 @@ void CloseAllBufferRelatedPopups()
                }
        }
        if (citation_form) {
-               if (citation_form->citation_form->visible) {
-                       fl_hide_form(citation_form->citation_form);
+               if (citation_form->form->visible) {
+                       fl_hide_form(citation_form->form);
                }
        }
        if (bibitem_form) {
@@ -198,7 +195,7 @@ void CloseAllBufferRelatedPopups()
 
 // This is another function we really don't want.
 // Again the Signal/Slot mechanism is tailor made for this task.
-void updateAllVisibleBufferRelatedPopups()
+void updateAllVisibleBufferRelatedDialogs()
 {
        if (fd_form_document->form_document->visible) {
                UpdateLayoutDocument();
@@ -229,6 +226,9 @@ void updateAllVisibleBufferRelatedPopups()
        if (fd_form_toc->browser_toc->visible) {
                TocUpdateCB(0, 0);
        }
+       if (fd_latex_log->LaTeXLog->visible) {
+               LatexLogUpdate(0,0);
+       }
 #ifdef ALWAYS_UPDATE_REF
        // Ideally, the RefUpdateCB should be modified so that if the
        // current document is a subdocument the reference list should come
@@ -250,12 +250,51 @@ void updateAllVisibleBufferRelatedPopups()
                if (fd_form_table->form_table->visible) {
                        fl_hide_form(fd_form_table->form_table);
                }
+
+#ifndef ALWAYS_UPDATE_REF
+               // We must update the popup in order to make the
+               // insert ref buttons insactive
+               if (fd_form_ref->form_ref->visible) {
+                       RefUpdateCB(0, 0);
+               }
+#endif
+
+#ifndef ALWAYS_CLOSE_MATH_PANELS
+               // The math popups should be closed only if we switch
+               // to a readonly buffer
+               if (fd_panel) {
+                       if (fd_panel->panel->visible) {
+                               fl_hide_form(fd_panel->panel);
+                       }
+               }
+               if (fd_delim) {
+                       if (fd_delim->delim->visible) {
+                               fl_hide_form(fd_delim->delim);
+                       }
+               }
+               if (fd_deco) {
+                       if (fd_deco->deco->visible) {
+                               fl_hide_form(fd_deco->deco);
+                       }
+               }
+               if (fd_space) {
+                       if (fd_space->space->visible) {
+                               fl_hide_form(fd_space->space);
+                       }
+               }
+               if (fd_matrix) {
+                       if (fd_matrix->matrix->visible) {
+                               fl_hide_form(fd_matrix->matrix);
+                       }
+               }
+#endif
        }
 
        // We have either changed buffers or changed the readonly status
        // so the safest thing to do is hide all inset popups that
        // are editting insets from the previous buffer or aren't
        // allowed in readonly docs.
+#ifdef ALWAYS_CLOSE_MATH_PANELS
        if (fd_panel) {
                if (fd_panel->panel->visible) {
                        fl_hide_form(fd_panel->panel);
@@ -281,9 +320,10 @@ void updateAllVisibleBufferRelatedPopups()
                        fl_hide_form(fd_matrix->matrix);
                }
        }
+#endif
        if (citation_form) {
-               if (citation_form->citation_form->visible) {
-                       fl_hide_form(citation_form->citation_form);
+               if (citation_form->form->visible) {
+                       fl_hide_form(citation_form->form);
                }
        }
        if (bibitem_form) {
@@ -407,7 +447,7 @@ void WarnReadonly(string const & file)
 {
        WriteAlert(_("Any changes will be ignored"),
                   _("The document is read-only:"),
-                  file);
+                  MakeDisplayPath(file));
 }
 
 /// Get the dpi setting of the current screen