commit a0a2502947fb66741b5ffaf271b6b98742908291
parent 83dfd07306a472ef1b84f48c7ee3b86254710866
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 5 Aug 2017 19:44:58 +0200
Allow debug output logging to be enabled after later restart
With the new system, it wasn't possible through the UI to generate debug
output for another action that happened after a restart, since it just
restarted immediately. This adds a prompt after selecting the menu
option that allows for restarting now, restarting later, or cancelling.
Diffstat:
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js
@@ -400,8 +400,24 @@ ZoteroStandalone.DebugOutput = {
restartEnabled: function () {
- Zotero.Prefs.set('debug.store', true);
- Zotero.Utilities.Internal.quit(true);
+ var ps = Services.prompt;
+ var buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING
+ + ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL
+ + ps.BUTTON_POS_2 * ps.BUTTON_TITLE_IS_STRING;
+ var index = ps.confirmEx(
+ null,
+ Zotero.getString('zotero.debugOutputLogging'),
+ Zotero.getString('zotero.debugOutputLogging.enabledAfterRestart', [Zotero.clientName]),
+ buttonFlags,
+ Zotero.getString('general.restartNow'),
+ null, Zotero.getString('general.restartLater'), null, {}
+ );
+ if (index != 1) {
+ Zotero.Prefs.set('debug.store', true);
+ }
+ if (index == 0) {
+ Zotero.Utilities.Internal.quit(true);
+ }
},
diff --git a/chrome/locale/en-US/zotero/standalone.dtd b/chrome/locale/en-US/zotero/standalone.dtd
@@ -81,7 +81,7 @@
<!ENTITY debugOutputLogging.submit "Submit Output">
<!ENTITY debugOutputLogging.view "View Output">
<!ENTITY debugOutputLogging.clear "Clear Output">
-<!ENTITY debugOutputLogging.restartWithLoggingEnabled "Restart with Logging Enabled">
+<!ENTITY debugOutputLogging.restartWithLoggingEnabled "Restart with Logging Enabled…">
<!ENTITY helpCheckForUpdates.label "Check for Updates…">
<!ENTITY helpCheckForUpdates.accesskey "U">
diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties
@@ -677,10 +677,12 @@ zotero.preferences.advanced.migrateDataDir.directoryWillBeMoved = Your %1
zotero.preferences.advanced.migrateDataDir.appMustBeRestarted = %S must be restarted to complete the migration.
zotero.preferences.advanced.migrateDataDir.manualMigration = You can also quit %1$S and move your existing data directory to %2$S manually, which may be faster for larger data directories. %3$S will automatically detect the new location.
+zotero.debugOutputLogging = Debug Output Logging
zotero.debugOutputLogging.linesLogged = %1$S line logged;%1$S lines logged
zotero.debugOutputLogging.dialog.title = Debug Output Submitted
zotero.debugOutputLogging.dialog.sent = Debug output has been sent to %S.\n\nThe Debug ID is D%S.
zotero.debugOutputLogging.dialog.error = An error occurred sending debug output.
+zotero.debugOutputLogging.enabledAfterRestart = Debug output logging will be enabled after %S restarts.
dragAndDrop.existingFiles = The following files already existed in the destination directory and were not copied:
dragAndDrop.filesNotFound = The following files were not found and could not be copied: