#include "BufferView.h"
#include "ColorHandler.h"
#include "lyxserver.h"
-#include "figure_form.h"
#include "intl.h"
#include "lyx_main.h"
#include "lyx_cb.h"
if (!do_not_use_this_arg.empty())
argument = do_not_use_this_arg; // except here
}
-
+
+#ifdef NEW_DISPATCHER
+ // We try do call the most specific dispatcher first:
+ // 1. the lockinginset's dispatch
+ // 2. the bufferview's dispatch
+ // 3. the lyxview's dispatch
+#endif
+
selection_possible = false;
if (owner->view()->available())
setErrorMessage(N_("Missing argument"));
break;
}
- ProhibitInput(owner->view());
+ owner->prohibitInput();
string const fname = i18nLibFileSearch("doc", arg, "lyx");
if (fname.empty()) {
lyxerr << "LyX: unable to find documentation file `"
<< arg << "'. Bad installation?" << endl;
- AllowInput(owner->view());
+ owner->allowInput();
break;
}
ostringstream str;
str << _("Opening help file") << ' '
<< MakeDisplayPath(fname) << "...";
owner->message(str.str().c_str());
- owner->view()->buffer(bufferlist.loadLyXFile(fname,false));
- AllowInput(owner->view());
+ owner->view()->buffer(bufferlist.loadLyXFile(fname, false));
+ owner->allowInput();
break;
}
case LFUN_HELP_VERSION: {
- ProhibitInput(owner->view());
+ owner->prohibitInput();
string msg(_("LyX Version "));
msg += LYX_VERSION;
msg += " of ";
+ MakeDisplayPath(system_lyxdir)).c_str(),
(_("User directory: ")
+ MakeDisplayPath(user_lyxdir)).c_str());
- AllowInput(owner->view());
+ owner->allowInput();
break;
}
case LFUN_GOTOFILEROW:
{
+#if 0
char file_name[100];
int row;
::sscanf(argument.c_str(), " %s %d", file_name, &row);
-
+#else
+ string file_name;
+ int row;
+ istringstream istr(argument.c_str());
+ istr >> file_name >> row;
+#endif
// Must replace extension of the file to be .lyx and get full path
- string s = ChangeExtension(string(file_name), ".lyx");
+ string const s(ChangeExtension(file_name, ".lyx"));
// Either change buffer or load the file
- if (bufferlist.exists(s))
+ if (bufferlist.exists(s)) {
owner->view()->buffer(bufferlist.getBuffer(s));
- else
+ } else {
owner->view()->buffer(bufferlist.loadLyXFile(s));
-
+ }
+
// Set the cursor
owner->view()->setCursorFromRow(row);
int id;
istr >> id;
Paragraph * par = TEXT()->getParFromID(id);
- if (par == 0)
+ if (par == 0) {
+ lyxerr[Debug::INFO] << "No matching paragraph found! ["
+ << id << "]" << std::endl;
break;
+ }
// Set the cursor
TEXT()->setCursor(owner->view(), par, 0);