]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
next step...
[lyx.git] / src / lyxfunc.C
index cd60c676d22b8ea2d3cd36ec7d804683b91a3679..3ac2af1e92a285e7246df6d0efb82faf96e08ac3 100644 (file)
@@ -104,7 +104,6 @@ using std::find_if;
 
 extern BufferList bufferlist;
 extern LyXServer * lyxserver;
-extern int greek_kb_flag;
 extern bool selection_possible;
 extern void MenuSendto();
 
@@ -241,7 +240,7 @@ void LyXFunc::processKeySym(KeySym keysym, unsigned int state)
                return;
        }
 
-       // Can we be sure that this will work for all X-Windows
+       // Can we be sure that this will work for all X Window
        // implementations? (Lgb)
        // This code snippet makes lyx ignore some keys. Perhaps
        // all of them should be explictly mentioned?
@@ -427,6 +426,11 @@ func_status::value_type LyXFunc::getStatus(int ac,
        case LFUN_SPELLCHECK:
                disable = lyxrc.isp_command == "none";
                break;
+#ifndef HAVE_LIBAIKSAURUS
+       case LFUN_THESAURUS_ENTRY:
+               disable = true;
+               break;
+#endif
        case LFUN_RUNCHKTEX:
                disable = lyxrc.chktex_command == "none";
                break;
@@ -725,12 +729,6 @@ func_status::value_type LyXFunc::getStatus(int ac,
                if (font.series() == LyXFont::BOLD_SERIES)
                        box = func_status::ToggleOn;
                break;
-#ifndef NO_LATEX
-       case LFUN_TEX:
-               if (font.latex() == LyXFont::ON)
-                       box = func_status::ToggleOn;
-               break;
-#endif
        case LFUN_READ_ONLY_TOGGLE:
                if (buf->isReadonly())
                        box = func_status::ToggleOn;
@@ -872,12 +870,40 @@ string const LyXFunc::dispatch(int ac,
                                        inset->edit(owner->view(),slx,sly,0); 
                                return string();
                        } else if (((result=owner->view()->theLockingInset()->
-                                  localDispatch(owner->view(), action,
-                                                argument)) ==
-                                  UpdatableInset::DISPATCHED) ||
-                                  (result == UpdatableInset::DISPATCHED_NOUPDATE))
+                                    localDispatch(owner->view(), action, argument)) ==
+                                   UpdatableInset::DISPATCHED) ||
+                                  (result == UpdatableInset::DISPATCHED_NOUPDATE))
+                               return string();
+                       else if (result == UpdatableInset::FINISHED) {
+                                       if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
+                                               TEXT()->cursorRight(owner->view());
+                                               moveCursorUpdate(true, false);
+                                               owner->showState();
+                                       }
+                                       return string();
+                       } else if (result == UpdatableInset::FINISHED_RIGHT) {
+                               if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
+                                       TEXT()->cursorRight(owner->view());
+                                       moveCursorUpdate(true, false);
+                                       owner->showState();
+                               }
+                               return string();
+                       } else if (result == UpdatableInset::FINISHED_UP) {
+                               if (TEXT()->cursor.row()->previous()) {
+                                       TEXT()->cursorUp(owner->view());
+                                       moveCursorUpdate(true, false);
+                                       owner->showState();
+                               }
                                return string();
-                       else {
+                       } else if (result == UpdatableInset::FINISHED_DOWN) {
+                               if (TEXT()->cursor.row()->next())
+                                       TEXT()->cursorDown(owner->view());
+                               else
+                                       TEXT()->cursorRight(owner->view());
+                               moveCursorUpdate(true, false);
+                               owner->showState();
+                               return string();
+                       } else {
                                //setMessage(N_("Text mode"));
                                switch (action) {
                                case LFUN_UNKNOWN_ACTION:
@@ -916,8 +942,6 @@ string const LyXFunc::dispatch(int ac,
                }
        }
 
-       lyx::Assert(action != LFUN_SELECT_FILE_SYNC);
-
        switch (action) {
                
        case LFUN_ESCAPE:
@@ -1158,14 +1182,6 @@ string const LyXFunc::dispatch(int ac,
                owner->getDialogs()->setUserFreeFont();
                break;
 
-#ifndef NO_LATEX
-       case LFUN_TEX:
-               Tex(owner->view());
-               owner->view()->setState();
-               owner->showState();
-               break;
-#endif
-               
        case LFUN_RECONFIGURE:
                Reconfigure(owner->view());
                break;
@@ -1183,16 +1199,16 @@ string const LyXFunc::dispatch(int ac,
                break;
 #else
 #ifdef WITH_WARNINGS
-#warning Find another implementation here (or another lyxfunc)!
+//#warning Find another implementation here (or another lyxfunc)!
 #endif
 #endif
        case LFUN_HELP_ABOUTLYX:
                owner->getDialogs()->showAboutlyx();
                break;
 
-       case LFUN_HELP_COPYRIGHT:
-       case LFUN_HELP_CREDITS:
-               
+       case LFUN_HELP_TEXINFO:
+               owner->getDialogs()->showTexinfo();
+               break;
 
         case LFUN_HELP_OPEN:
        {
@@ -1218,8 +1234,6 @@ string const LyXFunc::dispatch(int ac,
                break;
         }
 
-       case LFUN_HELP_VERSION:
-       
                // --- version control -------------------------------
        case LFUN_VC_REGISTER:
        {
@@ -1407,10 +1421,13 @@ string const LyXFunc::dispatch(int ac,
                        lyxerr[Debug::INFO] << "No matching paragraph found! ["
                                            << id << "]" << std::endl;
                        break;
+               } else {
+                       lyxerr << "Paragraph " << par->id()
+                              << " found." << endl;
                }
 
                // Set the cursor
-               TEXT()->setCursor(owner->view(), par, 0);
+               owner->view()->text->setCursor(owner->view(), par, 0);
                owner->view()->setState();
                owner->showState();
 
@@ -1875,7 +1892,7 @@ void LyXFunc::open(string const & fname)
                owner->message(str.str().c_str());
        } else {
                ostringstream str;
-               str << _("Could not open docuent") << ' ' << disp_fn;
+               str << _("Could not open document") << ' ' << disp_fn;
                owner->message(str.str().c_str());
        }
 }
@@ -2039,7 +2056,7 @@ void LyXFunc::initMiniBuffer()
                text += nicename;
                if (tmpbuf->lyxvc.inUse()) {
                        text += " [";
-                       text += tmpbuf->lyxvc.version();
+                       text += tmpbuf->lyxvc.versionString();
                        text += ' ';
                        text += tmpbuf->lyxvc.locker();
                        if (tmpbuf->isReadonly())