mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 23:08:13 -05:00
Update profiles on options import. Fix #120.
This commit is contained in:
parent
8e56c4f883
commit
8cef8bd627
@ -6,13 +6,18 @@ angular.module('omega').controller 'IoCtrl', ($scope, $rootScope) ->
|
|||||||
blob = new Blob [content], {type: "text/plain;charset=utf-8"}
|
blob = new Blob [content], {type: "text/plain;charset=utf-8"}
|
||||||
saveAs(blob, "OmegaOptions.bak")
|
saveAs(blob, "OmegaOptions.bak")
|
||||||
|
|
||||||
|
$scope.importSuccess = ->
|
||||||
|
$rootScope.showAlert(
|
||||||
|
type: 'success'
|
||||||
|
i18n: 'options_importSuccess'
|
||||||
|
message: 'Options imported.'
|
||||||
|
)
|
||||||
|
|
||||||
$scope.restoreLocal = (content) ->
|
$scope.restoreLocal = (content) ->
|
||||||
$rootScope.resetOptions(content).then ( ->
|
$rootScope.resetOptions(content).then ( ->
|
||||||
$rootScope.showAlert(
|
$scope.importSuccess()
|
||||||
type: 'success'
|
$rootScope.updateProfile().finally ->
|
||||||
i18n: 'options_importSuccess'
|
$scope.importSuccess()
|
||||||
message: 'Options imported.'
|
|
||||||
)
|
|
||||||
), -> $scope.restoreLocalError()
|
), -> $scope.restoreLocalError()
|
||||||
$scope.restoreLocalError = ->
|
$scope.restoreLocalError = ->
|
||||||
$rootScope.showAlert(
|
$rootScope.showAlert(
|
||||||
|
@ -211,7 +211,13 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window,
|
|||||||
|
|
||||||
$rootScope.updateProfile = (name) ->
|
$rootScope.updateProfile = (name) ->
|
||||||
$rootScope.applyOptionsConfirm().then(->
|
$rootScope.applyOptionsConfirm().then(->
|
||||||
$scope.updatingProfile[name] = true
|
if name?
|
||||||
|
$scope.updatingProfile[name] = true
|
||||||
|
else
|
||||||
|
OmegaPac.Profiles.each $scope.options, (key, profile) ->
|
||||||
|
if not profile.builtin
|
||||||
|
$scope.updatingProfile[profile.name] = true
|
||||||
|
|
||||||
omegaTarget.updateProfile(name).then((results) ->
|
omegaTarget.updateProfile(name).then((results) ->
|
||||||
success = 0
|
success = 0
|
||||||
error = 0
|
error = 0
|
||||||
@ -233,7 +239,10 @@ angular.module('omega').controller 'MasterCtrl', ($scope, $rootScope, $window,
|
|||||||
i18n: 'options_profileDownloadError'
|
i18n: 'options_profileDownloadError'
|
||||||
)
|
)
|
||||||
).finally ->
|
).finally ->
|
||||||
$scope.updatingProfile[name] = false
|
if name?
|
||||||
|
$scope.updatingProfile[name] = false
|
||||||
|
else
|
||||||
|
$scope.updatingProfile = {}
|
||||||
)
|
)
|
||||||
|
|
||||||
onOptionChange = (options, oldOptions) ->
|
onOptionChange = (options, oldOptions) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user