From a0a2502947fb66741b5ffaf271b6b98742908291 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 5 Aug 2017 19:44:58 +0200 Subject: [PATCH] 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. --- .../content/zotero/standalone/standalone.js | 20 +++++++++++++++++-- chrome/locale/en-US/zotero/standalone.dtd | 2 +- chrome/locale/en-US/zotero/zotero.properties | 2 ++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/standalone/standalone.js b/chrome/content/zotero/standalone/standalone.js index e9f08b4284..aa7f920149 100644 --- 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 index 6c7f1272bd..0d72e18b8b 100644 --- a/chrome/locale/en-US/zotero/standalone.dtd +++ b/chrome/locale/en-US/zotero/standalone.dtd @@ -81,7 +81,7 @@ - + diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 3ed037097d..0fd35be179 100644 --- 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: