]> git.lyx.org Git - lyx.git/commitdiff
prefs/needauth: added warning if user tries to disable authorization for needauth...
authorTommaso Cucinotta <tommaso@lyx.org>
Wed, 26 Jul 2017 22:01:51 +0000 (00:01 +0200)
committerTommaso Cucinotta <tommaso@lyx.org>
Wed, 26 Jul 2017 22:05:45 +0000 (00:05 +0200)
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h

index 5f2f4740c406fc8118deb7252f118e32d6034a56..95ea560601ecb33df6389ec4b0543d91cd94c780 100644 (file)
@@ -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
index 3b6ff60443a9d17f112cdf1f680b3ce758efdd6e..8f43a37e534871df58fbe482cff5e7376b1df5c4 100644 (file)
@@ -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();