(For this question, I promise that I’m running the actual confirm() method, and not the alert() method. )
I created a test userscript consisting of only the following line of code: require( "ko/dialogs" ).confirm( "confirm(): doNotAskPref", { doNotAskPref: true } );
When I ran it the first time, it of course included the checkbox labeled “Don’t ask me again.” I enabled the checkbox and dismissed the dialog. Running the userscript again, the dialog was not shown, as expected. Naturally, I began to wonder how I could make it appear again. I restarted Komodo IDE normally, but that didn’t reset the dialog so it would appear again. I then rebooted my laptop (this is Windows, after all…). Even that didn’t reset the dialog. When working on a different issue, I restarted in safe mode, and that did the trick, i.e., running the userscript resulted in the dialog being shown.
I’m assuming that there is a far easier way to reset dialogs like this for which the user has clicked that checkbox. Any ideas? I did a search, but couldn’t find anything possibly related except deleting C:\Users[user]\AppData\Local\ActiveState\KomodoIDE\11.0\doc-state.xmlc, and that didn’t work.
@mjross the documentation is a bit wrong here, it says a Boolean. But if you want to use the doNotAskPref you should insert a unique string here:
var prefs = require("ko/prefs");
require( "ko/dialogs" ).confirm( "Confirm me please", { doNotAskPref: 'uniquePrefName' } );
console.log(prefs.getBoolean('donotask_uniquePrefName')); // Looks if the pref is set
console.log(prefs.getStringPref('donotask_action_uniquePrefName')); // The stored action ok/cancel
If you want the dialog to show again, you will have to reset the pref:
var prefs = require("ko/prefs");
prefs.setBoolean('donotask_uniquePrefName', false);
You’ll most likely want to use those in a userscript. There should be a brief explanation of when it’s appropriate to use which in the modules themselves.