mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
Allow clearing remote copy of options in sync storage. Fix #282.
This commit is contained in:
parent
40266f5ffa
commit
dab98bb943
@ -381,6 +381,9 @@ msgstr "Stáhnout ze synchronizace"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "Zrušit synchronizaci"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "Clear remote copy"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr ""
|
||||
"Vy můžete nyní automaticky synchronizovat Vaše nastavení, profily napříč "
|
||||
|
@ -373,6 +373,9 @@ msgstr "Download from Syncing"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "Disable syncing"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "Clear remote copy"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr ""
|
||||
"You can now automatically synchroize your settings and profiles across all "
|
||||
|
@ -381,6 +381,9 @@ msgstr "Download from Syncing"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "Disable syncing"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "Clear remote copy"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr ""
|
||||
"You can now automatically synchroize your settings and profiles across all "
|
||||
|
@ -374,6 +374,9 @@ msgstr "Download from Syncing"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "Disable syncing"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "Clear remote copy"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr ""
|
||||
"You can now automatically synchroize your settings and profiles across all "
|
||||
|
@ -380,6 +380,9 @@ msgstr "Download from Syncing"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "Disable syncing"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "Clear remote copy"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr ""
|
||||
"You can now automatically synchroize your settings and profiles across all "
|
||||
|
@ -341,6 +341,9 @@ msgstr "下载云端版本"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "禁用同步"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "删除云端版本"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr "您可以将设置和情景模式同步到所有使用Chrome浏览器的桌面设备。"
|
||||
|
||||
|
@ -341,6 +341,9 @@ msgstr "下載雲端版本"
|
||||
msgid "options_syncDisable"
|
||||
msgstr "禁用同步"
|
||||
|
||||
msgid "options_syncReset"
|
||||
msgstr "刪除雲端版本"
|
||||
|
||||
msgid "options_syncPristineHelp"
|
||||
msgstr "您可以將設定和情景模式同步到所有使用Chrome瀏覽器的桌面裝置。"
|
||||
|
||||
|
@ -140,6 +140,7 @@ angular.module('omegaTarget', []).factory 'omegaTarget', ($q) ->
|
||||
chrome.tabs.create url: 'chrome://extensions/configureCommands'
|
||||
setOptionsSync: (enabled, args) ->
|
||||
callBackground('setOptionsSync', enabled, args)
|
||||
resetOptionsSync: (enabled, args) -> callBackground('resetOptionsSync')
|
||||
setRequestInfoCallback: (callback) ->
|
||||
requestInfoCallback = callback
|
||||
|
||||
|
@ -985,4 +985,20 @@ class Options
|
||||
@_syncWatchStop = @sync.watchAndPull(@_storage)
|
||||
return
|
||||
|
||||
###*
|
||||
# Clear the sync storage, resetting syncing state to pristine.
|
||||
# @returns {Promise} A promise which is fulfilled when the syncing is reset.
|
||||
###
|
||||
resetOptionsSync: ->
|
||||
@log.method('Options#resetOptionsSync', this, arguments)
|
||||
if not @sync?
|
||||
return Promise.reject(new Error('Options syncing is unsupported.'))
|
||||
@sync.enabled = false
|
||||
@_syncWatchStop?()
|
||||
@_syncWatchStop = null
|
||||
@_state.set({'syncOptions': 'conflict'})
|
||||
|
||||
return @sync.storage.remove().then =>
|
||||
@_state.set({'syncOptions': 'pristine'})
|
||||
|
||||
module.exports = Options
|
||||
|
@ -60,3 +60,8 @@ angular.module('omega').controller 'IoCtrl', ($scope, $rootScope,
|
||||
omegaTarget.setOptionsSync(false).then ->
|
||||
$rootScope.applyOptionsConfirm().then ->
|
||||
$window.location.reload()
|
||||
|
||||
$scope.resetOptionsSync = ->
|
||||
omegaTarget.resetOptionsSync().then ->
|
||||
$rootScope.applyOptionsConfirm().then ->
|
||||
$window.location.reload()
|
||||
|
@ -66,5 +66,10 @@ section.settings-group
|
||||
span.glyphicon.glyphicon-cloud-download
|
||||
= ' '
|
||||
| {{'options_syncEnableForce' | tr}}
|
||||
= ' '
|
||||
button.btn.btn-link(ng-click='resetOptionsSync()')
|
||||
span.glyphicon.glyphicon-erase
|
||||
= ' '
|
||||
| {{'options_syncReset' | tr}}
|
||||
div(ng-show='syncOptions == "unsupported"')
|
||||
p.help-block(omega-html='"options_syncUnsupportedHelp" | tr')
|
||||
|
Loading…
Reference in New Issue
Block a user