Buffer * buf = owner->buffer();
if (action == LFUN_UNKNOWN_ACTION) {
- setErrorMessage(N_("Unknown action"));
+ setStatusMessage(N_("Unknown action"));
return flag.unknown(true);
}
!lyxaction.funcHasFlag(action,
LyXAction::ReadOnly)) {
// no
- setErrorMessage(N_("Document is read-only"));
+ setStatusMessage(N_("Document is read-only"));
flag.disabled(true);
}
} else {
// no
- setErrorMessage(N_("Command not allowed with"
+ setStatusMessage(N_("Command not allowed with"
"out any document open"));
return flag.disabled(true);
}
}
-void const LyXFunc::verboseDispatch(string const & s, bool show_sc)
+void LyXFunc::verboseDispatch(string const & s, bool show_sc)
{
- // Split command string into command and argument
- string cmd;
- string line = frontStrip(s);
- string const arg = strip(frontStrip(split(line, cmd, ' ')));
-
- int action = lyxaction.LookupFunc(cmd);
+ int action = lyxaction.LookupFunc(frontStrip(s));
if (action == LFUN_UNKNOWN_ACTION) {
string const msg = string(_("Unknown function ("))
- + cmd + ")";
+ + s + ")";
owner->message(msg);
} else {
verboseDispatch(action, show_sc);
}
-void const LyXFunc::verboseDispatch(int ac, bool show_sc)
+void LyXFunc::verboseDispatch(int ac, bool show_sc)
{
string argument;
kb_action action;
-void const LyXFunc::verboseDispatch(kb_action action,
- string const & argument, bool show_sc)
+void LyXFunc::verboseDispatch(kb_action action,
+ string const & argument, bool show_sc)
{
string res = dispatch(action, argument);
<< lyxaction.getActionName(action)
<< " [" << action << "] is disabled at this location"
<< endl;
+ setErrorMessage(getStatusMessage());
goto exit_with_message;
}
// Undo/Redo is a bit tricky for insets.
if (action == LFUN_UNDO) {
owner->view()->menuUndo();
- return string();
+ goto exit_with_message;
} else if (action == LFUN_REDO) {
owner->view()->menuRedo();
- return string();
+ goto exit_with_message;
} else if (((result=owner->view()->theLockingInset()->
localDispatch(owner->view(), action, argument)) ==
UpdatableInset::DISPATCHED) ||
(result == UpdatableInset::DISPATCHED_NOUPDATE))
- return string();
+ goto exit_with_message;
else if (result == UpdatableInset::FINISHED) {
if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
}
- return string();
+ goto exit_with_message;
} 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();
+ goto exit_with_message;
} else if (result == UpdatableInset::FINISHED_UP) {
if (TEXT()->cursor.row()->previous()) {
TEXT()->cursorUp(owner->view());
moveCursorUpdate(true, false);
owner->showState();
}
- return string();
+ goto exit_with_message;
} else if (result == UpdatableInset::FINISHED_DOWN) {
if (TEXT()->cursor.row()->next())
TEXT()->cursorDown(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
- return string();
+ goto exit_with_message;
} else {
//setMessage(N_("Text mode"));
switch (action) {
moveCursorUpdate(true, false);
owner->showState();
}
- return string();
+ goto exit_with_message;
case LFUN_LEFT:
if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
}
- return string();
+ goto exit_with_message;
case LFUN_DOWN:
if (TEXT()->cursor.row()->next())
TEXT()->cursorDown(owner->view());
TEXT()->cursorRight(owner->view());
moveCursorUpdate(true, false);
owner->showState();
- return string();
+ goto exit_with_message;
default:
break;
}
{
string const filename =
MakeAbsPath(argument,
- OnlyPath(owner->buffer()->fileName()));
+ owner->buffer()->filePath());
setMessage(N_("Opening child document ") +
MakeDisplayPath(filename) + "...");
owner->view()->savePosition(0);
if (!res.empty())
owner->message(_(res));
-
+ owner->updateMenubar();
+ owner->updateToolbar();
+
return res;
}
string initpath = lyxrc.document_path;
if (owner->view()->available()) {
- string const trypath = owner->buffer()->filepath;
+ string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (IsDirWriteable(trypath))
initpath = trypath;
if (lyxrc.new_ask_filename) {
FileDialog fileDlg(owner, _("Enter filename for new document"),
LFUN_SELECT_FILE_SYNC,
- make_pair(string(_("Documents")),
+ make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
- make_pair(string(_("Templates")),
+ make_pair(string(_("Templates|#T#t")),
string(lyxrc.template_path)));
FileDialog::Result result =
if (fromTemplate) {
FileDialog fileDlg(owner, _("Select template file"),
LFUN_SELECT_FILE_SYNC,
- make_pair(string(_("Documents")),
+ make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
- make_pair(string(_("Templates")),
+ make_pair(string(_("Templates|#T#t")),
string(lyxrc.template_path)));
FileDialog::Result result =
string initpath = lyxrc.document_path;
if (owner->view()->available()) {
- string const trypath = owner->buffer()->filepath;
+ string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (IsDirWriteable(trypath))
initpath = trypath;
if (fname.empty()) {
FileDialog fileDlg(owner, _("Select document to open"),
LFUN_FILE_OPEN,
- make_pair(string(_("Documents")),
+ make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
- make_pair(string(_("Examples")),
+ make_pair(string(_("Examples|#E#e")),
string(AddPath(system_lyxdir, "examples"))));
FileDialog::Result result =
string initpath = lyxrc.document_path;
if (owner->view()->available()) {
- string const trypath = owner->buffer()->filepath;
+ string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (IsDirWriteable(trypath))
initpath = trypath;
FileDialog fileDlg(owner, text,
LFUN_IMPORT,
- make_pair(string(_("Documents")),
+ make_pair(string(_("Documents|#o#O")),
string(lyxrc.document_path)),
- make_pair(string(_("Examples")),
+ make_pair(string(_("Examples|#E#e")),
string(AddPath(system_lyxdir, "examples"))));
string const extension = "*." + formats.extension(format)
}
-void LyXFunc::setMessage(string const & m)
+void LyXFunc::setMessage(string const & m) const
{
dispatch_buffer = m;
}
+void LyXFunc::setStatusMessage(string const & m) const
+{
+ status_buffer = m;
+}
+
+
void LyXFunc::initMiniBuffer()
{
string text = _("Welcome to LyX!");