mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Add 'copy author sort to author' button. Change faq.
This commit is contained in:
parent
0868ec5846
commit
dafd7b2746
@ -66,8 +66,8 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
|
|||||||
self.sort_by_author_sort.setChecked(True)
|
self.sort_by_author_sort.setChecked(True)
|
||||||
self.author_sort_order = 1
|
self.author_sort_order = 1
|
||||||
|
|
||||||
# set up author sort calc button
|
|
||||||
self.recalc_author_sort.clicked.connect(self.do_recalc_author_sort)
|
self.recalc_author_sort.clicked.connect(self.do_recalc_author_sort)
|
||||||
|
self.auth_sort_to_author.clicked.connect(self.do_auth_sort_to_author)
|
||||||
|
|
||||||
if select_item is not None:
|
if select_item is not None:
|
||||||
self.table.setCurrentItem(select_item)
|
self.table.setCurrentItem(select_item)
|
||||||
@ -108,6 +108,17 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog):
|
|||||||
self.table.setFocus(Qt.OtherFocusReason)
|
self.table.setFocus(Qt.OtherFocusReason)
|
||||||
self.table.cellChanged.connect(self.cell_changed)
|
self.table.cellChanged.connect(self.cell_changed)
|
||||||
|
|
||||||
|
def do_auth_sort_to_author(self):
|
||||||
|
self.table.cellChanged.disconnect()
|
||||||
|
for row in range(0,self.table.rowCount()):
|
||||||
|
item = self.table.item(row, 1)
|
||||||
|
aus = unicode(item.text()).strip()
|
||||||
|
c = self.table.item(row, 0)
|
||||||
|
# Sometimes trailing commas are left by changing between copy algs
|
||||||
|
c.setText(aus)
|
||||||
|
self.table.setFocus(Qt.OtherFocusReason)
|
||||||
|
self.table.cellChanged.connect(self.cell_changed)
|
||||||
|
|
||||||
def cell_changed(self, row, col):
|
def cell_changed(self, row, col):
|
||||||
if col == 0:
|
if col == 0:
|
||||||
item = self.table.item(row, 0)
|
item = self.table.item(row, 0)
|
||||||
|
@ -52,13 +52,26 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="recalc_author_sort">
|
<widget class="QPushButton" name="recalc_author_sort">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Reset all the author sort values to a value automatically generated from the author. Exactly how this value is automatically generated can be controlled via Preferences->Advanced->Tweaks</string>
|
<string>Reset all the author sort values to a value automatically
|
||||||
|
generated from the author. Exactly how this value is automatically
|
||||||
|
generated can be controlled via Preferences->Advanced->Tweaks</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Recalculate all author sort values</string>
|
<string>Recalculate all author sort values</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="auth_sort_to_author">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Copy author sort to author for every author. You typically use this button
|
||||||
|
after changing Preferences->Advanced->Tweaks->Author sort name algorithm</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Copy all author sort values to author</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -327,10 +327,22 @@ Now coming to author name sorting:
|
|||||||
* When recalculating the author sort values for books, |app| uses the author sort values for each individual author. Therefore, ensure that the individual author sort values are correct before recalculating the books' author sort values.
|
* When recalculating the author sort values for books, |app| uses the author sort values for each individual author. Therefore, ensure that the individual author sort values are correct before recalculating the books' author sort values.
|
||||||
* You can control whether the Tag Browser display authors using their names or their sort values by setting the :guilabel:`categories_use_field_for_author_name` tweak in Preferences->Tweaks
|
* You can control whether the Tag Browser display authors using their names or their sort values by setting the :guilabel:`categories_use_field_for_author_name` tweak in Preferences->Tweaks
|
||||||
|
|
||||||
With all this flexibility, it is possible to have |app| manage your author names however you like. For example, one common request is to have |app| display author names LN, FN. To do this first set the ``author_sort_copy_method`` to ``copy``. Then change all author names to LN, FN via the Manage authors dialog. Then have |app| recalculate author sort values for both authors and books as described above.
|
|
||||||
|
|
||||||
Note that you can set an individual author's sort value to whatever you want using :guilabel:`Manage authors`. This is useful when dealing with names that |app| will not get right, such as complex multi-part names like Miguel de Cervantes Saavedra or when dealing with Asian names like Sun Tzu.
|
Note that you can set an individual author's sort value to whatever you want using :guilabel:`Manage authors`. This is useful when dealing with names that |app| will not get right, such as complex multi-part names like Miguel de Cervantes Saavedra or when dealing with Asian names like Sun Tzu.
|
||||||
|
|
||||||
|
With all this flexibility, it is possible to have |app| manage your author names however you like. For example, one common request is to have |app| display author names LN, FN. To do this, and if the note below does not apply to you, then:
|
||||||
|
* Set the ``author_sort_copy_method`` tweak to ``copy`` as described above.
|
||||||
|
* Restart calibre. Do not change any book metadata before doing the remaining steps.
|
||||||
|
* Change all author names to LN, FN using the Manage authors dialog.
|
||||||
|
* After you have changed all the authors, press the `Recalculate all author sort values` button.
|
||||||
|
* Press OK, at which point |app| will change the authors in all your books. This can take a while.
|
||||||
|
|
||||||
|
**Note**: when changing from FN LN to LN, FN, it is often the case that the values in author_sort are already in LN, FN format. If this is your case, then do the following:
|
||||||
|
* set the ``author_sort_copy_method`` tweak to ``copy`` as described above.
|
||||||
|
* restart calibre. Do not change any book metadata before doing the remaining steps.
|
||||||
|
* open the Manage authors dialog. Press the ``copy all author sort values to author`` button.
|
||||||
|
* Check through the authors to be sure you are happy. You can still press Cancel to abandon the changes. Once you press OK, there is no undo.
|
||||||
|
* Press OK, at which point |app| will change the authors in all your books. This can take a while.
|
||||||
|
|
||||||
|
|
||||||
Why doesn't |app| let me store books in my own directory structure?
|
Why doesn't |app| let me store books in my own directory structure?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user