diff --git a/omega-locales/cs/LC_MESSAGES/omega-web.po b/omega-locales/cs/LC_MESSAGES/omega-web.po index 6e7341c..8f24591 100644 --- a/omega-locales/cs/LC_MESSAGES/omega-web.po +++ b/omega-locales/cs/LC_MESSAGES/omega-web.po @@ -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říč " diff --git a/omega-locales/en_US/LC_MESSAGES/omega-web.po b/omega-locales/en_US/LC_MESSAGES/omega-web.po index 3509c99..f58af9f 100644 --- a/omega-locales/en_US/LC_MESSAGES/omega-web.po +++ b/omega-locales/en_US/LC_MESSAGES/omega-web.po @@ -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 " diff --git a/omega-locales/es_AR/LC_MESSAGES/omega-web.po b/omega-locales/es_AR/LC_MESSAGES/omega-web.po index 59ade3e..3dec32d 100644 --- a/omega-locales/es_AR/LC_MESSAGES/omega-web.po +++ b/omega-locales/es_AR/LC_MESSAGES/omega-web.po @@ -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 " diff --git a/omega-locales/ja/LC_MESSAGES/omega-web.po b/omega-locales/ja/LC_MESSAGES/omega-web.po index b9cb0ab..4952e63 100644 --- a/omega-locales/ja/LC_MESSAGES/omega-web.po +++ b/omega-locales/ja/LC_MESSAGES/omega-web.po @@ -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 " diff --git a/omega-locales/tr/LC_MESSAGES/omega-web.po b/omega-locales/tr/LC_MESSAGES/omega-web.po index 26519c4..c12149b 100644 --- a/omega-locales/tr/LC_MESSAGES/omega-web.po +++ b/omega-locales/tr/LC_MESSAGES/omega-web.po @@ -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 " diff --git a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po index 2827331..ef8c28b 100644 --- a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po +++ b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po @@ -341,6 +341,9 @@ msgstr "下载云端版本" msgid "options_syncDisable" msgstr "禁用同步" +msgid "options_syncReset" +msgstr "删除云端版本" + msgid "options_syncPristineHelp" msgstr "您可以将设置和情景模式同步到所有使用Chrome浏览器的桌面设备。" diff --git a/omega-locales/zh_TW/LC_MESSAGES/omega-web.po b/omega-locales/zh_TW/LC_MESSAGES/omega-web.po index 1c0163d..a657eb9 100644 --- a/omega-locales/zh_TW/LC_MESSAGES/omega-web.po +++ b/omega-locales/zh_TW/LC_MESSAGES/omega-web.po @@ -341,6 +341,9 @@ msgstr "下載雲端版本" msgid "options_syncDisable" msgstr "禁用同步" +msgid "options_syncReset" +msgstr "刪除雲端版本" + msgid "options_syncPristineHelp" msgstr "您可以將設定和情景模式同步到所有使用Chrome瀏覽器的桌面裝置。" diff --git a/omega-target-chromium-extension/omega_target_web.coffee b/omega-target-chromium-extension/omega_target_web.coffee index dd2dc5a..e423007 100644 --- a/omega-target-chromium-extension/omega_target_web.coffee +++ b/omega-target-chromium-extension/omega_target_web.coffee @@ -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 diff --git a/omega-target/src/options.coffee b/omega-target/src/options.coffee index 93f753f..40c480a 100644 --- a/omega-target/src/options.coffee +++ b/omega-target/src/options.coffee @@ -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 diff --git a/omega-web/src/omega/controllers/io.coffee b/omega-web/src/omega/controllers/io.coffee index e73407b..a3a5eb8 100644 --- a/omega-web/src/omega/controllers/io.coffee +++ b/omega-web/src/omega/controllers/io.coffee @@ -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() diff --git a/omega-web/src/partials/io.jade b/omega-web/src/partials/io.jade index c767277..f7faa5d 100644 --- a/omega-web/src/partials/io.jade +++ b/omega-web/src/partials/io.jade @@ -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')