#include "insets/InsetERT.h"
#include "insets/InsetExternal.h"
#include "insets/InsetFloat.h"
-#include "insets/InsetListings.h"
#include "insets/InsetGraphics.h"
#include "insets/InsetInclude.h"
+#include "insets/InsetListings.h"
#include "insets/InsetNote.h"
#include "insets/InsetSpace.h"
#include "insets/InsetTabular.h"
if (cmd.action == LFUN_NOACTION) {
flag.message(from_utf8(N_("Nothing to do")));
- flag.enabled(false);
+ flag.setEnabled(false);
return flag;
}
case LFUN_THESAURUS_ENTRY:
#endif
flag.unknown(true);
- flag.enabled(false);
+ flag.setEnabled(false);
break;
default:
// no, exit directly
flag.message(from_utf8(N_("Command not allowed with"
"out any document open")));
- flag.enabled(false);
+ flag.setEnabled(false);
return flag;
}
bool enable = true;
switch (cmd.action) {
- // FIXME optimally this should be in Text::getStatus. In such a case the flags
- // are not passed when using context menu. This way it works.
- case LFUN_SET_GRAPHICS_GROUP: {
- if (!view())
- break;
- InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(view()->cursor());
- if (!ins)
- break;
- if (!cmd.argument().empty())
- flag.setOnOff(to_utf8(cmd.argument()) == ins->getParams().groupId);
- enable = true;
- break;
- }
-
case LFUN_BUFFER_TOGGLE_READ_ONLY:
flag.setOnOff(buf->isReadonly());
break;
case LFUN_PREFERENCES_SAVE:
case LFUN_MESSAGE:
case LFUN_INSET_EDIT:
- case LFUN_ALL_INSETS_TOGGLE:
- case LFUN_GRAPHICS_GROUPS_UNIFY:
case LFUN_BUFFER_LANGUAGE:
case LFUN_TEXTCLASS_APPLY:
case LFUN_TEXTCLASS_LOAD:
}
if (!enable)
- flag.enabled(false);
+ flag.setEnabled(false);
// Can we use a readonly buffer?
if (buf && buf->isReadonly()
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::ReadOnly)
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("Document is read-only")));
- flag.enabled(false);
+ flag.setEnabled(false);
}
// Are we in a DELETED change-tracking region?
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::ReadOnly)
&& !lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("This portion of the document is deleted.")));
- flag.enabled(false);
+ flag.setEnabled(false);
}
// the default error message if we disable the command
lyx_view_->message(from_utf8(argument));
break;
-
- case LFUN_ALL_INSETS_TOGGLE: {
- LASSERT(lyx_view_, /**/);
- string action;
- string const name = split(argument, action, ' ');
- InsetCode const inset_code = insetCode(name);
-
- Cursor & cur = view()->cursor();
- FuncRequest fr(LFUN_INSET_TOGGLE, action);
-
- Inset & inset = lyx_view_->buffer()->inset();
- InsetIterator it = inset_iterator_begin(inset);
- InsetIterator const end = inset_iterator_end(inset);
- for (; it != end; ++it) {
- if (!it->asInsetMath()
- && (inset_code == NO_CODE
- || inset_code == it->lyxCode())) {
- Cursor tmpcur = cur;
- tmpcur.pushBackward(*it);
- it->dispatch(tmpcur, fr);
- }
- }
- updateFlags = Update::Force | Update::FitCursor;
- break;
- }
-
- case LFUN_GRAPHICS_GROUPS_UNIFY: {
- LASSERT(lyx_view_, /**/);
- if (argument.empty() || !lyx_view_->buffer())
- break;
- //view()->cursor().recordUndoFullDocument(); let inset-apply do that job
- InsetGraphics::unifyGraphicsGroups(*lyx_view_->buffer(), argument);
- lyx_view_->buffer()->markDirty();
- updateFlags = Update::Force | Update::FitCursor;
- break;
- }
-
case LFUN_BUFFER_LANGUAGE: {
LASSERT(lyx_view_, /**/);
Buffer & buffer = *lyx_view_->buffer();
actOnUpdatedPrefs(lyxrc_orig, lyxrc);
+ // Set the language defined by the user.
+ LyX::ref().setRcGuiLanguage();
+
theApp()->resetGui();
/// We force the redraw in any case because there might be
case LyXRC::RC_CUSTOM_EXPORT_FORMAT:
case LyXRC::RC_DATE_INSERT_FORMAT:
case LyXRC::RC_DEFAULT_LANGUAGE:
+ case LyXRC::RC_GUI_LANGUAGE:
case LyXRC::RC_DEFAULT_PAPERSIZE:
case LyXRC::RC_DEFFILE:
case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN: