Option to mark newly added books

An option to mark newly added books with a temporary mark. Optionis in
Preferences->Adding books. Fixes #1238609 [[Enhancement] Set books as "Marked" when adding](https://bugs.launchpad.net/calibre/+bug/1238609)
This commit is contained in:
Kovid Goyal 2013-10-11 18:03:55 +05:30
parent e5f5f28180
commit 5572db6fde
4 changed files with 13 additions and 1 deletions

View File

@ -13,7 +13,7 @@ from itertools import izip, imap
from future_builtins import map
from calibre.ebooks.metadata import title_sort
from calibre.utils.config_base import tweaks
from calibre.utils.config_base import tweaks, prefs
from calibre.db.write import uniq
def sanitize_sort_field_name(field_metadata, field):
@ -426,4 +426,6 @@ class View(object):
ids = tuple(ids)
self._map = ids + self._map
self._map_filtered = ids + self._map_filtered
if prefs['mark_new_books']:
self.toggle_marked_ids(ids)

View File

@ -35,6 +35,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
(_('Create new record for each duplicate format'), 'new record')]
r('automerge', gprefs, choices=choices)
r('new_book_tags', prefs, setting=CommaSeparatedList)
r('mark_new_books', prefs)
r('auto_add_path', gprefs, restart_required=True)
r('auto_add_check_for_duplicates', gprefs)
r('auto_add_auto_convert', gprefs)

View File

@ -151,6 +151,13 @@ Author matching is exact.</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="opt_mark_new_books">
<property name="text">
<string>&amp;Mark newly added books</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">

View File

@ -400,6 +400,8 @@ def _prefs():
help=_('Add new formats to existing book records'))
c.add_opt('installation_uuid', default=None, help='Installation UUID')
c.add_opt('new_book_tags', default=[], help=_('Tags to apply to books added to the library'))
c.add_opt('mark_new_books', default=False, help=_(
'Mark newly added books. The mark is a temporary mark that is automatically removed when calibre is restarted.'))
# these are here instead of the gui preferences because calibredb and
# calibre server can execute searches