prefs/needauth: added warning if user tries to disable authorization for needauth converters.

This commit is contained in:
Tommaso Cucinotta 2017-07-27 00:01:51 +02:00
parent 964fb09baf
commit 8a4fcd3d95
2 changed files with 16 additions and 2 deletions

View File

@ -1684,8 +1684,6 @@ PrefConverters::PrefConverters(GuiPreferences * form)
this, SIGNAL(changed())); this, SIGNAL(changed()));
connect(needauthForbiddenCB, SIGNAL(toggled(bool)), connect(needauthForbiddenCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed())); this, SIGNAL(changed()));
connect(needauthCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
converterED->setValidator(new NoNewLineValidator(converterED)); converterED->setValidator(new NoNewLineValidator(converterED));
converterFlagED->setValidator(new NoNewLineValidator(converterFlagED)); 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 // FormatValidator

View File

@ -338,6 +338,7 @@ private Q_SLOTS:
void changeConverter(); void changeConverter();
void on_cacheCB_stateChanged(int state); void on_cacheCB_stateChanged(int state);
void on_needauthForbiddenCB_toggled(bool); void on_needauthForbiddenCB_toggled(bool);
void on_needauthCB_toggled(bool);
private: private:
void updateButtons(); void updateButtons();