From d0f7fd6df780b93e8f41448e76f3fd02c5c70ad2 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 26 Feb 2019 22:23:43 -0500 Subject: [PATCH] Add separate "Rename linked files" pref for auto-renaming Defaulting to false People who've been relying on auto-renaming of linked files for the last year will have to turn this back on. --- .../zotero/preferences/preferences_general.js | 7 +++ .../preferences/preferences_general.xul | 9 +++- chrome/content/zotero/xpcom/attachments.js | 11 ++++ chrome/content/zotero/xpcom/itemTreeView.js | 4 +- chrome/content/zotero/xpcom/recognizePDF.js | 2 +- chrome/content/zotero/zoteroPane.js | 2 +- chrome/locale/en-US/zotero/preferences.dtd | 1 + chrome/skin/default/zotero/preferences.css | 8 +++ defaults/preferences/zotero.js | 1 + test/tests/itemTreeViewTest.js | 50 ++++++++++++++++++- 10 files changed, 89 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences_general.js b/chrome/content/zotero/preferences/preferences_general.js index a0f8706ba0..883cf8e7f1 100644 --- a/chrome/content/zotero/preferences/preferences_general.js +++ b/chrome/content/zotero/preferences/preferences_general.js @@ -40,9 +40,16 @@ Zotero_Preferences.General = { document.getElementById('noteFontSize').value = Zotero.Prefs.get('note.fontSize'); + this.updateAutoRenameFilesUI(); this._updateFileHandlerUI(); }, + updateAutoRenameFilesUI: function () { + setTimeout(() => { + document.getElementById('rename-linked-files').disabled = !Zotero.Prefs.get('autoRenameFiles'); + }); + }, + // // File handlers // diff --git a/chrome/content/zotero/preferences/preferences_general.xul b/chrome/content/zotero/preferences/preferences_general.xul index 1233e63907..aa021b424f 100644 --- a/chrome/content/zotero/preferences/preferences_general.xul +++ b/chrome/content/zotero/preferences/preferences_general.xul @@ -38,6 +38,7 @@ + @@ -118,7 +119,13 @@ preference="pref-automaticSnapshots"/> - + +