Chargement/Sauvegarde profil via l'UI

This commit is contained in:
2015-09-18 12:13:24 +02:00
parent 383f70f7f3
commit 6c8d26139e
9 changed files with 140 additions and 13 deletions

View File

@ -10,7 +10,7 @@ exports.loadProfile = function(profilePath) {
dispatch({ type: LOAD_PROFILE, profilePath: profilePath });
return Util.System.loadJSONFile(profilePath)
return Util.System.loadJSON(profilePath)
.then(function(profile) {
dispatch({ type: LOAD_PROFILE_SUCCESS, profile: profile });
return profile;

View File

@ -39,10 +39,19 @@ exports.loadDesktopApps = function() {
};
};
exports.saveProfile = function(profile) {
exports.saveProfile = function(destPath, profile) {
return function(dispatch, getState) {
dispatch({ type: SAVE_PROFILE, profile: profile, path: destPath });
return Util.System.saveJSON(destPath, profile)
.then(function() {
dispatch({ type: SAVE_PROFILE_SUCCESS, profile: profile, path: destPath });
})
.catch(function(err) {
dispatch({ type: SAVE_PROFILE_FAILED, error: err });
})
;
};
};

View File

@ -10,7 +10,7 @@ exports.runApp = function(execPath) {
dispatch({ type: RUN_APP, execPath: execPath });
return Util.System.runApp(execPath)
return Util.System.runApp(execPath, { clearFreeDesktopFlags: true })
.then(function() {
dispatch({ type: RUN_APP_SUCCESS, execPath: execPath });
return execPath;