From: Tommaso Cucinotta Date: Wed, 26 Jul 2017 22:01:51 +0000 (+0200) Subject: prefs/needauth: added warning if user tries to disable authorization for needauth... X-Git-Tag: 2.3.0beta1~111 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=8a4fcd3d95ca4aeed1c46152cecadf29ed21e774;p=lyx.git prefs/needauth: added warning if user tries to disable authorization for needauth converters. --- diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 5f2f4740c4..95ea560601 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1684,8 +1684,6 @@ PrefConverters::PrefConverters(GuiPreferences * form) this, SIGNAL(changed())); connect(needauthForbiddenCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(needauthCB, SIGNAL(toggled(bool)), - this, SIGNAL(changed())); converterED->setValidator(new NoNewLineValidator(converterED)); converterFlagED->setValidator(new NoNewLineValidator(converterFlagED)); @@ -1874,6 +1872,21 @@ void PrefConverters::on_needauthForbiddenCB_toggled(bool checked) } +void PrefConverters::on_needauthCB_toggled(bool checked) +{ + if (checked) + return; + + 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")); + if (ret == 1) + changed(); + else + needauthCB->setChecked(true); +} + + ///////////////////////////////////////////////////////////////////// // // FormatValidator diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index 3b6ff60443..8f43a37e53 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -338,6 +338,7 @@ private Q_SLOTS: void changeConverter(); void on_cacheCB_stateChanged(int state); void on_needauthForbiddenCB_toggled(bool); + void on_needauthCB_toggled(bool); private: void updateButtons();