Disable Restore to/from Zotero Server and add back Full Sync
Restore to/from will need to be reimplemented for API syncing (#914) Closes #916
This commit is contained in:
parent
c9c5e40e95
commit
85c0c086d5
4 changed files with 52 additions and 8 deletions
|
@ -494,7 +494,7 @@ Zotero_Preferences.Sync = {
|
|||
},
|
||||
|
||||
|
||||
handleSyncReset: function (action) {
|
||||
handleSyncReset: Zotero.Promise.coroutine(function* (action) {
|
||||
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
|
||||
|
@ -509,9 +509,44 @@ Zotero_Preferences.Sync = {
|
|||
return;
|
||||
}
|
||||
|
||||
var account = Zotero.Sync.Server.username;
|
||||
|
||||
switch (action) {
|
||||
case 'full-sync':
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL)
|
||||
+ ps.BUTTON_POS_1_DEFAULT;
|
||||
var index = ps.confirmEx(
|
||||
null,
|
||||
// TODO: localize
|
||||
Zotero.getString('general.warning'),
|
||||
"Zotero will compare all local and remote data and merge any data that does not "
|
||||
+ "exist in both locations.\n\n"
|
||||
+ "This option is not necessary during normal usage and should "
|
||||
+ "generally be used only to troubleshoot specific issues as recommended "
|
||||
+ "by Zotero support staff.",
|
||||
buttonFlags,
|
||||
"Sync",
|
||||
null, null, null, {}
|
||||
);
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
let libraries = Zotero.Libraries.getAll().filter(library => library.syncable);
|
||||
yield Zotero.DB.executeTransaction(function* () {
|
||||
for (let library of libraries) {
|
||||
library.libraryVersion = -1;
|
||||
yield library.save();
|
||||
}
|
||||
});
|
||||
yield Zotero.Sync.Runner.sync();
|
||||
break;
|
||||
|
||||
// Cancel
|
||||
case 1:
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'restore-from-server':
|
||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL)
|
||||
|
@ -659,5 +694,5 @@ Zotero_Preferences.Sync = {
|
|||
default:
|
||||
throw ("Invalid action '" + action + "' in handleSyncReset()");
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
|
|
|
@ -282,6 +282,7 @@
|
|||
</columns>
|
||||
|
||||
<rows>
|
||||
<!--
|
||||
<row id="zotero-restore-from-server" selected="true">
|
||||
<radio/>
|
||||
<vbox onclick="this.previousSibling.click()">
|
||||
|
@ -297,6 +298,14 @@
|
|||
<description>&zotero.preferences.sync.reset.restoreToServer.desc;</description>
|
||||
</vbox>
|
||||
</row>
|
||||
-->
|
||||
<row id="zotero-full-sync">
|
||||
<radio/>
|
||||
<vbox onclick="this.previousSibling.click()">
|
||||
<label value="&zotero.preferences.sync.reset.fullSync;"/>
|
||||
<description>&zotero.preferences.sync.reset.fullSync.desc;</description>
|
||||
</vbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
|
|
|
@ -1160,8 +1160,8 @@ Zotero.Sync.Data.Engine.prototype._upgradeCheck = Zotero.Promise.coroutine(funct
|
|||
* Perform a full sync
|
||||
*
|
||||
* Get all object versions from the API and compare to the local database. If any objects are
|
||||
* missing or outdated and not up-to-date in the sync cache, download them. If any local objects
|
||||
* are marked as synced but aren't available remotely, mark them as unsynced for later uploading.
|
||||
* missing or outdated, download them. If any local objects are marked as synced but aren't available
|
||||
* remotely, mark them as unsynced for later uploading.
|
||||
*
|
||||
* (Technically this isn't a full sync on its own, because local objects are only flagged for later
|
||||
* upload.)
|
||||
|
|
|
@ -77,8 +77,8 @@
|
|||
<!ENTITY zotero.preferences.sync.reset.warning1 "The following operations are for use only in rare, specific situations and should not be used for general troubleshooting. In many cases, resetting will cause additional problems. See ">
|
||||
<!ENTITY zotero.preferences.sync.reset.warning2 "Sync Reset Options">
|
||||
<!ENTITY zotero.preferences.sync.reset.warning3 " for more information.">
|
||||
<!ENTITY zotero.preferences.sync.reset.fullSync "Full Sync with Zotero Server">
|
||||
<!ENTITY zotero.preferences.sync.reset.fullSync.desc "Merge local Zotero data with data from the sync server, ignoring sync history.">
|
||||
<!ENTITY zotero.preferences.sync.reset.fullSync "Full Sync">
|
||||
<!ENTITY zotero.preferences.sync.reset.fullSync.desc "Merge local data with data from server, ignoring sync history.">
|
||||
<!ENTITY zotero.preferences.sync.reset.restoreFromServer "Restore from Zotero Server">
|
||||
<!ENTITY zotero.preferences.sync.reset.restoreFromServer.desc "Erase all local Zotero data and restore from the sync server.">
|
||||
<!ENTITY zotero.preferences.sync.reset.restoreToServer "Restore to Zotero Server">
|
||||
|
|
Loading…
Reference in a new issue