From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Wed, 18 Nov 2020 20:32:37 +0900
Subject: Don't change book file unless user's consent (Closes: #974974)

Forwarded: not-needed
Closes: #974974

This fix changes default value and behavior of ebook-viewer(1) preferences
"Miscellaneous"->"Keep a copy of annotations/bookmarks in the e-book file,
for easy sharing".

* Set "False" for "save_annotations_in_ebook".
* Give "False" if askes default value of "save_annotations_in_ebook".
---
 src/calibre/gui2/viewer/main.py  | 2 +-
 src/calibre/gui2/viewer/ui.py    | 2 +-
 src/pyj/read_book/prefs/misc.pyj | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py
index 3cdd57c..04980a0 100644
--- a/src/calibre/gui2/viewer/main.py
+++ b/src/calibre/gui2/viewer/main.py
@@ -44,7 +44,7 @@ def migrate_previous_viewer_prefs():
         ms = sd.get('standalone_misc_settings', {})
         ms['remember_window_geometry'] = bool(old_prefs.get('remember_window_size', False))
         ms['remember_last_read'] = bool(old_prefs.get('remember_current_page', True))
-        ms['save_annotations_in_ebook'] = bool(old_prefs.get('copy_bookmarks_to_file', True))
+        ms['save_annotations_in_ebook'] = bool(old_prefs.get('copy_bookmarks_to_file', False))
         ms['singleinstance'] = bool(old_vprefs.get('singleinstance', False))
         sd['standalone_misc_settings'] = ms
 
diff --git a/src/calibre/gui2/viewer/ui.py b/src/calibre/gui2/viewer/ui.py
index b9e6813..a299d5a 100644
--- a/src/calibre/gui2/viewer/ui.py
+++ b/src/calibre/gui2/viewer/ui.py
@@ -688,7 +688,7 @@ class EbookViewer(MainWindow):
             self.annotations_saver.start()
         self.annotations_saver.save_annotations(
             self.current_book_data,
-            in_book_file and get_session_pref('save_annotations_in_ebook', default=True),
+            in_book_file and get_session_pref('save_annotations_in_ebook', default=False),
             get_session_pref('sync_annots_user', default='')
         )
 
diff --git a/src/pyj/read_book/prefs/misc.pyj b/src/pyj/read_book/prefs/misc.pyj
index a3fa0dd..d312818 100644
--- a/src/pyj/read_book/prefs/misc.pyj
+++ b/src/pyj/read_book/prefs/misc.pyj
@@ -18,7 +18,7 @@ DEFAULTS = {
     'remember_last_read': True,
     'show_actions_toolbar': False,
     'show_actions_toolbar_in_fullscreen': False,
-    'save_annotations_in_ebook': True,
+    'save_annotations_in_ebook': False,
     'sync_annots_user': '',
     'singleinstance': False,
     'auto_hide_mouse': True,
