]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
Upgrading of my xforms libs showed that lots of files thought they depended
[lyx.git] / src / lyxfunc.C
index 3691d747cd729edd10e4c39a7bf59ee5b025ac8d..5b8ea4cf835e07f4516797b6479e4cb7cd6671f1 100644 (file)
@@ -38,7 +38,6 @@
 #include "minibuffer.h"
 #include "vspace.h"
 #include "LyXView.h"
-#include "lyx_gui_misc.h"
 #include "FloatList.h"
 #include "converter.h"
 #include "exporter.h"
@@ -48,7 +47,6 @@
 #include "lyxfind.h"
 #include "undo_funcs.h"
 #include "ParagraphParameters.h"
-#include "figureForm.h"
 
 #include "insets/inseturl.h"
 #include "insets/insetlatexaccent.h"
 #include "frontends/Menubar.h"
 #include "frontends/Alert.h"
 
+#include "graphics/GraphicsCache.h"
+
 #include "support/lyxalgo.h"
 #include "support/LAssert.h"
 #include "support/filetools.h"
 #include "support/FileInfo.h"
-#include "support/syscall.h"
+#include "support/forkedcontr.h"
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/lyxfunctional.h"
@@ -576,7 +576,6 @@ FuncStatus LyXFunc::getStatus(kb_action action,
        case LFUN_INSET_ERT:
                code = Inset::ERT_CODE;         
                break;
-       case LFUN_FIGURE:
        case LFUN_INSET_GRAPHICS:
                code = Inset::GRAPHICS_CODE;
                break;
@@ -969,7 +968,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
        }
 
        switch (action) {
-               
+
        case LFUN_ESCAPE:
        {
                if (!owner->view()->available()) break;
@@ -1161,10 +1160,6 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                owner->getDialogs()->showTabularCreate();
                break;
                
-       case LFUN_FIGURE:
-               Figure();
-               break;
-
        case LFUN_AUTOSAVE:
                AutoSave(owner->view());
                break;
@@ -1604,6 +1599,10 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                        break;
                        }
 
+               bool const graphicsbg_changed =
+                       (lyx_name == lcolor.getLyXName(LColor::graphicsbg) &&
+                        x11_name != lcolor.getX11Name(LColor::graphicsbg));
+
                if (!lcolor.setColor(lyx_name, x11_name)) {
                        static string const err1 (N_("Set-color \""));
                        static string const err2 (
@@ -1612,7 +1611,14 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                        setErrorMessage(_(err1) + lyx_name + _(err2));
                        break;
                }
+
                lyxColorHandler->updateColor(lcolor.getFromLyXName(lyx_name));
+
+               if (graphicsbg_changed) {
+                       grfx::GCache & gc = grfx::GCache::get();
+                       gc.changeDisplay(true);
+               }
+               
                owner->view()->redraw();
                break;
        }
@@ -1629,6 +1635,21 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                owner->messagePop();
                break;
 
+       case LFUN_FORKS_SHOW:
+               owner->getDialogs()->showForks();
+               break;
+
+       case LFUN_FORKS_KILL:
+       {
+               if (!isStrInt(argument))
+                       break;
+
+               pid_t const pid = strToInt(argument);
+               ForkedcallsController & fcc = ForkedcallsController::get();
+               fcc.kill(pid);
+               break;
+       }
+
        default:
                // Then if it was none of the above
                // Trying the BufferView::pimpl dispatch: