mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
6e9f81954a
commit
941849c58f
@ -160,7 +160,7 @@ class Comments(Base):
|
|||||||
self._layout = QVBoxLayout()
|
self._layout = QVBoxLayout()
|
||||||
self._tb = QPlainTextEdit(self._box)
|
self._tb = QPlainTextEdit(self._box)
|
||||||
self._tb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
|
self._tb.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||||
self._tb.setTabChangesFocus()
|
self._tb.setTabChangesFocus(True)
|
||||||
self._layout.addWidget(self._tb)
|
self._layout.addWidget(self._tb)
|
||||||
self._box.setLayout(self._layout)
|
self._box.setLayout(self._layout)
|
||||||
self.widgets = [self._box]
|
self.widgets = [self._box]
|
||||||
@ -275,3 +275,6 @@ def populate_single_metadata_page(left, right, db, book_id, parent=None):
|
|||||||
|
|
||||||
return ans, items
|
return ans, items
|
||||||
|
|
||||||
|
def populate_bulk_metadata_page(left, right, db, book_id, parent=None):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ from calibre.gui2.dialogs.metadata_bulk_ui import Ui_MetadataBulkDialog
|
|||||||
from calibre.gui2.dialogs.tag_editor import TagEditor
|
from calibre.gui2.dialogs.tag_editor import TagEditor
|
||||||
from calibre.ebooks.metadata import string_to_authors, authors_to_sort_string, \
|
from calibre.ebooks.metadata import string_to_authors, authors_to_sort_string, \
|
||||||
authors_to_string
|
authors_to_string
|
||||||
|
from calibre.gui2.custom_column_widgets import populate_bulk_metadata_page
|
||||||
|
|
||||||
class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
||||||
|
|
||||||
@ -19,7 +20,8 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.db = db
|
self.db = db
|
||||||
self.ids = [db.id(r) for r in rows]
|
self.ids = [db.id(r) for r in rows]
|
||||||
self.groupBox.setTitle(_('Editing meta information for %d books') %
|
self.box_title.setText('<p>' +
|
||||||
|
_('Editing meta information for <b>%d books</b>') %
|
||||||
len(rows))
|
len(rows))
|
||||||
self.write_series = False
|
self.write_series = False
|
||||||
self.changed = False
|
self.changed = False
|
||||||
@ -38,9 +40,16 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
QObject.connect(self.series, SIGNAL('currentIndexChanged(int)'), self.series_changed)
|
QObject.connect(self.series, SIGNAL('currentIndexChanged(int)'), self.series_changed)
|
||||||
QObject.connect(self.series, SIGNAL('editTextChanged(QString)'), self.series_changed)
|
QObject.connect(self.series, SIGNAL('editTextChanged(QString)'), self.series_changed)
|
||||||
QObject.connect(self.tag_editor_button, SIGNAL('clicked()'), self.tag_editor)
|
QObject.connect(self.tag_editor_button, SIGNAL('clicked()'), self.tag_editor)
|
||||||
|
if len(db.custom_column_label_map) == 0:
|
||||||
|
self.central_widget.tabBar().setVisible(False)
|
||||||
|
else:
|
||||||
|
self.create_custom_column_editors()
|
||||||
|
|
||||||
self.exec_()
|
self.exec_()
|
||||||
|
|
||||||
|
def create_custom_column_editors(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def initialize_combos(self):
|
def initialize_combos(self):
|
||||||
self.initalize_authors()
|
self.initalize_authors()
|
||||||
self.initialize_series()
|
self.initialize_series()
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>495</width>
|
<width>526</width>
|
||||||
<height>468</height>
|
<height>499</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -18,6 +18,16 @@
|
|||||||
<normaloff>:/images/edit_input.svg</normaloff>:/images/edit_input.svg</iconset>
|
<normaloff>:/images/edit_input.svg</normaloff>:/images/edit_input.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="box_title">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout">
|
<layout class="QVBoxLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@ -27,239 +37,249 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QTabWidget" name="central_widget">
|
||||||
<property name="title">
|
<property name="currentIndex">
|
||||||
<string>Meta information</string>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<widget class="QWidget" name="tabWidgetPage1">
|
||||||
<item row="0" column="0">
|
<attribute name="title">
|
||||||
<widget class="QLabel" name="label_2">
|
<string>&Basic metadata</string>
|
||||||
<property name="text">
|
</attribute>
|
||||||
<string>&Author(s): </string>
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
</property>
|
<item row="0" column="0">
|
||||||
<property name="alignment">
|
<widget class="QLabel" name="label_2">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="text">
|
||||||
</property>
|
<string>&Author(s): </string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>authors</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="1" column="1">
|
<cstring>authors</cstring>
|
||||||
<widget class="QCheckBox" name="auto_author_sort">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>A&utomatically set author sort</string>
|
</item>
|
||||||
</property>
|
<item row="1" column="1">
|
||||||
</widget>
|
<widget class="QCheckBox" name="auto_author_sort">
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="2" column="0">
|
<string>A&utomatically set author sort</string>
|
||||||
<widget class="QLabel" name="label_8">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Author s&ort: </string>
|
</item>
|
||||||
</property>
|
<item row="2" column="0">
|
||||||
<property name="alignment">
|
<widget class="QLabel" name="label_8">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="text">
|
||||||
</property>
|
<string>Author s&ort: </string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>author_sort</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="2" column="1" colspan="2">
|
<cstring>author_sort</cstring>
|
||||||
<widget class="EnLineEdit" name="author_sort">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles.</string>
|
</item>
|
||||||
</property>
|
<item row="2" column="1" colspan="2">
|
||||||
</widget>
|
<widget class="EnLineEdit" name="author_sort">
|
||||||
</item>
|
<property name="toolTip">
|
||||||
<item row="3" column="0">
|
<string>Specify how the author(s) of this book should be sorted. For example Charles Dickens should be sorted as Dickens, Charles.</string>
|
||||||
<widget class="QLabel" name="label_6">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>&Rating:</string>
|
</item>
|
||||||
</property>
|
<item row="3" column="0">
|
||||||
<property name="alignment">
|
<widget class="QLabel" name="label_6">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="text">
|
||||||
</property>
|
<string>&Rating:</string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>rating</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="3" column="1" colspan="2">
|
<cstring>rating</cstring>
|
||||||
<widget class="QSpinBox" name="rating">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Rating of this book. 0-5 stars</string>
|
</item>
|
||||||
</property>
|
<item row="3" column="1" colspan="2">
|
||||||
<property name="whatsThis">
|
<widget class="QSpinBox" name="rating">
|
||||||
<string>Rating of this book. 0-5 stars</string>
|
<property name="toolTip">
|
||||||
</property>
|
<string>Rating of this book. 0-5 stars</string>
|
||||||
<property name="buttonSymbols">
|
</property>
|
||||||
<enum>QAbstractSpinBox::PlusMinus</enum>
|
<property name="whatsThis">
|
||||||
</property>
|
<string>Rating of this book. 0-5 stars</string>
|
||||||
<property name="specialValueText">
|
</property>
|
||||||
<string>No change</string>
|
<property name="buttonSymbols">
|
||||||
</property>
|
<enum>QAbstractSpinBox::PlusMinus</enum>
|
||||||
<property name="suffix">
|
</property>
|
||||||
<string> stars</string>
|
<property name="specialValueText">
|
||||||
</property>
|
<string>No change</string>
|
||||||
<property name="minimum">
|
</property>
|
||||||
<number>-1</number>
|
<property name="suffix">
|
||||||
</property>
|
<string> stars</string>
|
||||||
<property name="maximum">
|
</property>
|
||||||
<number>5</number>
|
<property name="minimum">
|
||||||
</property>
|
<number>-1</number>
|
||||||
<property name="value">
|
</property>
|
||||||
<number>-1</number>
|
<property name="maximum">
|
||||||
</property>
|
<number>5</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="value">
|
||||||
<item row="4" column="0">
|
<number>-1</number>
|
||||||
<widget class="QLabel" name="label_3">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>&Publisher: </string>
|
</item>
|
||||||
</property>
|
<item row="4" column="0">
|
||||||
<property name="alignment">
|
<widget class="QLabel" name="label_3">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="text">
|
||||||
</property>
|
<string>&Publisher: </string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>publisher</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="4" column="1">
|
<cstring>publisher</cstring>
|
||||||
<widget class="EnComboBox" name="publisher">
|
</property>
|
||||||
<property name="editable">
|
</widget>
|
||||||
<bool>true</bool>
|
</item>
|
||||||
</property>
|
<item row="4" column="1">
|
||||||
</widget>
|
<widget class="EnComboBox" name="publisher">
|
||||||
</item>
|
<property name="editable">
|
||||||
<item row="5" column="0">
|
<bool>true</bool>
|
||||||
<widget class="QLabel" name="label_4">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Add ta&gs: </string>
|
</item>
|
||||||
</property>
|
<item row="5" column="0">
|
||||||
<property name="alignment">
|
<widget class="QLabel" name="label_4">
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="text">
|
||||||
</property>
|
<string>Add ta&gs: </string>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>tags</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="5" column="1">
|
<cstring>tags</cstring>
|
||||||
<widget class="TagsLineEdit" name="tags">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string>
|
</item>
|
||||||
</property>
|
<item row="5" column="1">
|
||||||
</widget>
|
<widget class="TagsLineEdit" name="tags">
|
||||||
</item>
|
<property name="toolTip">
|
||||||
<item row="5" column="2">
|
<string>Tags categorize the book. This is particularly useful while searching. <br><br>They can be any words or phrases, separated by commas.</string>
|
||||||
<widget class="QToolButton" name="tag_editor_button">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Open Tag Editor</string>
|
</item>
|
||||||
</property>
|
<item row="5" column="2">
|
||||||
<property name="text">
|
<widget class="QToolButton" name="tag_editor_button">
|
||||||
<string>Open Tag Editor</string>
|
<property name="toolTip">
|
||||||
</property>
|
<string>Open Tag Editor</string>
|
||||||
<property name="icon">
|
</property>
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
<property name="text">
|
||||||
<normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset>
|
<string>Open Tag Editor</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="icon">
|
||||||
</item>
|
<iconset resource="../../../../resources/images.qrc">
|
||||||
<item row="6" column="0">
|
<normaloff>:/images/chapters.svg</normaloff>:/images/chapters.svg</iconset>
|
||||||
<widget class="QLabel" name="label">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>&Remove tags:</string>
|
</item>
|
||||||
</property>
|
<item row="6" column="0">
|
||||||
<property name="buddy">
|
<widget class="QLabel" name="label">
|
||||||
<cstring>remove_tags</cstring>
|
<property name="text">
|
||||||
</property>
|
<string>&Remove tags:</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="6" column="1" colspan="2">
|
<cstring>remove_tags</cstring>
|
||||||
<widget class="TagsLineEdit" name="remove_tags">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Comma separated list of tags to remove from the books. </string>
|
</item>
|
||||||
</property>
|
<item row="6" column="1" colspan="2">
|
||||||
</widget>
|
<widget class="TagsLineEdit" name="remove_tags">
|
||||||
</item>
|
<property name="toolTip">
|
||||||
<item row="7" column="0">
|
<string>Comma separated list of tags to remove from the books. </string>
|
||||||
<widget class="QLabel" name="label_7">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>&Series:</string>
|
</item>
|
||||||
</property>
|
<item row="7" column="0">
|
||||||
<property name="textFormat">
|
<widget class="QLabel" name="label_7">
|
||||||
<enum>Qt::PlainText</enum>
|
<property name="text">
|
||||||
</property>
|
<string>&Series:</string>
|
||||||
<property name="alignment">
|
</property>
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
<property name="textFormat">
|
||||||
</property>
|
<enum>Qt::PlainText</enum>
|
||||||
<property name="buddy">
|
</property>
|
||||||
<cstring>series</cstring>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="7" column="1">
|
<cstring>series</cstring>
|
||||||
<widget class="EnComboBox" name="series">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>List of known series. You can add new series.</string>
|
</item>
|
||||||
</property>
|
<item row="7" column="1">
|
||||||
<property name="whatsThis">
|
<widget class="EnComboBox" name="series">
|
||||||
<string>List of known series. You can add new series.</string>
|
<property name="toolTip">
|
||||||
</property>
|
<string>List of known series. You can add new series.</string>
|
||||||
<property name="editable">
|
</property>
|
||||||
<bool>true</bool>
|
<property name="whatsThis">
|
||||||
</property>
|
<string>List of known series. You can add new series.</string>
|
||||||
<property name="insertPolicy">
|
</property>
|
||||||
<enum>QComboBox::InsertAlphabetically</enum>
|
<property name="editable">
|
||||||
</property>
|
<bool>true</bool>
|
||||||
<property name="sizeAdjustPolicy">
|
</property>
|
||||||
<enum>QComboBox::AdjustToContents</enum>
|
<property name="insertPolicy">
|
||||||
</property>
|
<enum>QComboBox::InsertAlphabetically</enum>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="sizeAdjustPolicy">
|
||||||
<item row="9" column="0">
|
<enum>QComboBox::AdjustToContents</enum>
|
||||||
<widget class="QLabel" name="label_5">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>Remove &format:</string>
|
</item>
|
||||||
</property>
|
<item row="9" column="0">
|
||||||
<property name="buddy">
|
<widget class="QLabel" name="label_5">
|
||||||
<cstring>remove_format</cstring>
|
<property name="text">
|
||||||
</property>
|
<string>Remove &format:</string>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="buddy">
|
||||||
<item row="9" column="1">
|
<cstring>remove_format</cstring>
|
||||||
<widget class="QComboBox" name="remove_format"/>
|
</property>
|
||||||
</item>
|
</widget>
|
||||||
<item row="0" column="1">
|
</item>
|
||||||
<widget class="EnComboBox" name="authors">
|
<item row="9" column="1">
|
||||||
<property name="editable">
|
<widget class="QComboBox" name="remove_format"/>
|
||||||
<bool>true</bool>
|
</item>
|
||||||
</property>
|
<item row="0" column="1">
|
||||||
</widget>
|
<widget class="EnComboBox" name="authors">
|
||||||
</item>
|
<property name="editable">
|
||||||
<item row="10" column="0" colspan="2">
|
<bool>true</bool>
|
||||||
<widget class="QCheckBox" name="swap_title_and_author">
|
</property>
|
||||||
<property name="text">
|
</widget>
|
||||||
<string>&Swap title and author</string>
|
</item>
|
||||||
</property>
|
<item row="10" column="0" colspan="2">
|
||||||
</widget>
|
<widget class="QCheckBox" name="swap_title_and_author">
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="8" column="1">
|
<string>&Swap title and author</string>
|
||||||
<widget class="QCheckBox" name="autonumber_series">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>Selected books will be automatically numbered,
|
</item>
|
||||||
|
<item row="8" column="1">
|
||||||
|
<widget class="QCheckBox" name="autonumber_series">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Selected books will be automatically numbered,
|
||||||
in the order you selected them.
|
in the order you selected them.
|
||||||
So if you selected Book A and then Book B,
|
So if you selected Book A and then Book B,
|
||||||
Book A will have series number 1 and Book B series number 2.</string>
|
Book A will have series number 1 and Book B series number 2.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Automatically number books in this series</string>
|
<string>Automatically number books in this series</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>&Custom metadata</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -342,21 +362,5 @@ Book A will have series number 1 and Book B series number 2.</string>
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>auto_author_sort</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>author_sort</receiver>
|
|
||||||
<slot>setDisabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>240</x>
|
|
||||||
<y>95</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>240</x>
|
|
||||||
<y>113</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user