]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
I reactivate the code to resize the InsetText on a resize event of the main
[lyx.git] / src / lyxfunc.C
index 21b21daf2caec4ab9dc1713f38d4eb00d6a5cca7..0857b261b34f8faa11f274d3cc3a3188c86705c6 100644 (file)
 #include "Lsstream.h"
 #include "trans_mgr.h"
 #include "layout.h"
-#include "WorkArea.h"
 #include "bufferview_funcs.h"
 #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 +46,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/forkedcontr.h"
 #include "support/lstrings.h"
 #include "support/path.h"
 #include "support/lyxfunctional.h"
@@ -112,7 +112,6 @@ using std::back_inserter;
 extern BufferList bufferlist;
 extern LyXServer * lyxserver;
 extern bool selection_possible;
-extern void MenuSendto();
 
 extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
@@ -301,7 +300,7 @@ void LyXFunc::processKeySym(KeySym keysym, unsigned int state)
        // why not return already here if action == -1 and
        // num_bytes == 0? (Lgb)
 
-       if (keyseq.length() > 1 && !keyseq.deleted()) {
+       if (keyseq.length() > 1) {
                owner->message(keyseq.print());
        }
 
@@ -575,7 +574,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;
@@ -676,6 +674,10 @@ FuncStatus LyXFunc::getStatus(kb_action action,
        
        // A few general toggles
        switch (action) {
+       case LFUN_TOOLTIPS_TOGGLE:
+               flag.setOnOff(owner->getDialogs()->tooltipsEnabled());
+               break;
+
        case LFUN_READ_ONLY_TOGGLE:
                flag.setOnOff(buf->isReadonly());
                break;
@@ -968,7 +970,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
        }
 
        switch (action) {
-               
+
        case LFUN_ESCAPE:
        {
                if (!owner->view()->available()) break;
@@ -1019,7 +1021,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                        owner->view()->update(TEXT(),
                                              BufferView::SELECT|BufferView::FITCUR);
                }
-               owner->message(keyseq.print());
+               owner->message(keyseq.printOptions());
        }
        break;
 
@@ -1118,7 +1120,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
 
        case LFUN_EXPORT:
                if (argument == "custom")
-                       MenuSendto();
+                       owner->getDialogs()->showSendto();
                else
                        Exporter::Export(owner->buffer(), argument, false);
                break;
@@ -1160,10 +1162,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;
@@ -1603,6 +1601,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 (
@@ -1611,7 +1613,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;
        }
@@ -1628,6 +1637,25 @@ 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;
+       }
+
+       case LFUN_TOOLTIPS_TOGGLE:
+               owner->getDialogs()->toggleTooltips();
+               break;
+
        default:
                // Then if it was none of the above
                // Trying the BufferView::pimpl dispatch: