window.configInfo = {

    load: function (panel, addon) {
        var UI = getAllUIElements(panel);
        var path = app.getValue('burn2MM4exePath', 'C:\\Program Files (x86)\\MediaMonkey\\MediaMonkey.exe');
        UI.editPath.controlClass.value = path;

        localListen(UI.btnDir, 'click', function () {
            //window.uitools.showSelectFolderDlg(UI.btnDir.controlClass.value).then(function (path) {
            var promise = app.utils.dialogOpenFile('', 'exe', 'MediaMonkey executable file (*.exe)|*.exe', 'Select MediaMonkey.exe', false /* not - multiselect */ );
            window.localPromise(promise).then(function (newPath) {
                if (newPath != '')
                    UI.editPath.controlClass.value = newPath;
            });
        });

        localListen(UI.btnGetMM4, 'click', function () {
            window.uitools.openWeb('http://www.mediamonkey.com/MediaMonkey-4_Setup.exe');
        });
    },

    save: function (panel, addon) {
        var UI = getAllUIElements(panel);
        var path = UI.editPath.controlClass.value;
        app.setValue('burn2MM4exePath', path);
    }
}
