}
+static void activatePrefsWindow(GuiPreferences * form_)
+{
+ if (guiApp->platformName() == "cocoa") {
+ QWidget * dialog_ = form_->asQWidget();
+ dialog_->raise();
+ dialog_->activateWindow();
+ }
+}
+
+
/////////////////////////////////////////////////////////////////////
//
// PrefOutput
int ret = frontend::Alert::prompt(
_("SECURITY WARNING!"), _("Unchecking this option has the effect that potentially harmful converters would be run without asking your permission first. This is UNSAFE and NOT recommended, unless you know what you are doing. Are you sure you would like to proceed? The recommended and safe answer is NO!"),
0, 0, _("&No"), _("&Yes"));
+ activatePrefsWindow(form_);
if (ret == 1)
changed();
else
_("You cannot change a format's short name "
"if the format is used by a converter. "
"Please remove the converter first."));
+ activatePrefsWindow(form_);
updateView();
return;
}
Alert::error(_("Format in use"),
_("Cannot remove a Format used by a Converter. "
"Remove the converter first."));
+ activatePrefsWindow(form_);
return;
}
uiStyleCO->currentIndex()).toString();
if (rc.ui_style != fromqstr(uistyle)) {
rc.ui_style = fromqstr(uistyle);
- if (rc.ui_style == "default")
+ if (rc.ui_style == "default") {
// FIXME: This should work with frontend::GuiApplication::setStyle(QString())
// Qt bug https://bugreports.qt.io/browse/QTBUG-58268
frontend::Alert::warning(_("Restart needed"),
_("Resetting the user interface style to 'Default'"
" requires a restart of LyX."));
+ activatePrefsWindow(form_);
+ }
else
frontend::GuiApplication::setStyle(uistyle);
}
if (func.action() == LFUN_UNKNOWN_ACTION) {
Alert::error(_("Failed to create shortcut"),
_("Unknown or invalid LyX function"));
+ activatePrefsWindow(form_);
return false;
}
if (lyxaction.getActionType(func.action()) == LyXAction::Hidden) {
Alert::error(_("Failed to create shortcut"),
_("This LyX function is hidden and cannot be bound."));
+ activatePrefsWindow(form_);
return false;
}
if (k.length() == 0) {
Alert::error(_("Failed to create shortcut"),
_("Invalid or empty key sequence"));
+ activatePrefsWindow(form_);
return false;
}
k.print(KeySequence::ForGui), new_action_string);
int ret = Alert::prompt(_("Redefine shortcut?"),
text, 0, 1, _("&Redefine"), _("&Cancel"));
+ activatePrefsWindow(form_);
if (ret != 0)
return false;
QString const sequence_text = toqstr(k.print(KeySequence::ForGui));
new_action_string);
int ret = Alert::prompt(_("Redefine shortcut?"),
text, 0, 1, _("&Redefine"), _("&Cancel"));
+ activatePrefsWindow(form_);
if (ret != 0)
return false;
QString const sequence_text = toqstr(k.print(KeySequence::ForGui));
} else {
Alert::error(_("Failed to create shortcut"),
_("Can not insert shortcut to the list"));
+ activatePrefsWindow(form_);
return;
}
}
guilyxfiles_->selectItem(name);
guilyxfiles_->exec();
- if (frontend::guiApp->platformName() == "cocoa") {
- QWidget * dialog_ = asQWidget();
- dialog_->raise();
- dialog_->activateWindow();
- }
+ activatePrefsWindow(this);
QString const result = uifile_;