From 5aa463b5e0cb05d3607d2d83e711e2522408e3f3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Jun 2008 13:39:32 -0700 Subject: [PATCH 1/3] calibredb should ask the GUI to refresh its book list after setting metadata --- src/calibre/library/cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/library/cli.py b/src/calibre/library/cli.py index 451e91acc0..edda1c8502 100644 --- a/src/calibre/library/cli.py +++ b/src/calibre/library/cli.py @@ -337,6 +337,9 @@ def do_set_metadata(db, id, stream): mi = OPFReader(stream) db.set_metadata(id, mi) do_show_metadata(db, id, False) + if SingleApplication is not None: + sa = SingleApplication('calibre GUI') + sa.send_message('refreshdb:') def command_set_metadata(args, dbpath): parser = get_parser(_( From 589fa1ef13879c975ed6048d4e5e27dc8a77d3fc Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Jun 2008 23:17:18 -0700 Subject: [PATCH 2/3] Fix #788 --- src/calibre/library/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/database.py b/src/calibre/library/database.py index c357239fa5..dc4f4e31de 100644 --- a/src/calibre/library/database.py +++ b/src/calibre/library/database.py @@ -1422,7 +1422,7 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE; mi = OPFCreator(base, self.get_metadata(idx, index_is_id=index_is_id)) cover = self.cover(idx, index_is_id=index_is_id) if cover is not None: - cname = name + '.jpg' + cname = sanitize_file_name(name) + '.jpg' cpath = os.path.join(base, cname) open(cpath, 'wb').write(cover) mi.cover = cname From ecb18a05ea423277490139f9eaade84d908bb09b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 16 Jun 2008 23:29:22 -0700 Subject: [PATCH 3/3] Fix #792 --- src/calibre/gui2/dialogs/user_profiles.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 5cae63c6d7..a06191e48c 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -84,6 +84,7 @@ class UserProfiles(QDialog, Ui_Dialog): self.populate_options(recipe) self.stacks.setCurrentIndex(0) self.toggle_mode_button.setText(_('Switch to Advanced mode')) + self.source_code.setPlainText('') else: self.source_code.setPlainText(src) self.highlighter = PythonHighlighter(self.source_code.document())