mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from custcol trunk
This commit is contained in:
commit
aa8f04a14e
@ -151,6 +151,9 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
new_authors = string_to_authors(title)
|
new_authors = string_to_authors(title)
|
||||||
self.db.set_authors(id, new_authors, notify=False)
|
self.db.set_authors(id, new_authors, notify=False)
|
||||||
|
|
||||||
|
if self.remove_conversion_settings.isChecked():
|
||||||
|
self.db.delete_conversion_options(id, 'PIPE')
|
||||||
|
|
||||||
self.changed = True
|
self.changed = True
|
||||||
for w in getattr(self, 'custom_column_widgets', []):
|
for w in getattr(self, 'custom_column_widgets', []):
|
||||||
w.commit(self.ids)
|
w.commit(self.ids)
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0" colspan="2">
|
<item row="11" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="swap_title_and_author">
|
<widget class="QCheckBox" name="swap_title_and_author">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Swap title and author</string>
|
<string>&Swap title and author</string>
|
||||||
@ -273,6 +273,18 @@ Book A will have series number 1 and Book B series number 2.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="remove_conversion_settings">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Remove stored conversion settings for the selected books.
|
||||||
|
|
||||||
|
Future conversion of these books will use the default settings.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove &stored conversion settings for the selected books</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
|
@ -11,8 +11,8 @@ from PyQt4.QtGui import QTableView, QAbstractItemView, QColor, \
|
|||||||
QPainterPath, QLinearGradient, QBrush, \
|
QPainterPath, QLinearGradient, QBrush, \
|
||||||
QPen, QStyle, QPainter, QStyleOptionViewItemV4, \
|
QPen, QStyle, QPainter, QStyleOptionViewItemV4, \
|
||||||
QIcon, QImage, QMenu, QSpinBox, QDoubleSpinBox, \
|
QIcon, QImage, QMenu, QSpinBox, QDoubleSpinBox, \
|
||||||
QStyledItemDelegate, QCompleter, QIntValidator, \
|
QStyledItemDelegate, QCompleter, \
|
||||||
QDoubleValidator, QComboBox
|
QComboBox
|
||||||
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt, pyqtSignal, \
|
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt, pyqtSignal, \
|
||||||
SIGNAL, QObject, QSize, QModelIndex, QDate
|
SIGNAL, QObject, QSize, QModelIndex, QDate
|
||||||
|
|
||||||
|
@ -147,12 +147,21 @@ class SideBar(QToolBar):
|
|||||||
tb_state = dynamic.get('tag_browser_state', None)
|
tb_state = dynamic.get('tag_browser_state', None)
|
||||||
if tb_state is not None:
|
if tb_state is not None:
|
||||||
self.horizontal_splitter.restoreState(tb_state)
|
self.horizontal_splitter.restoreState(tb_state)
|
||||||
|
tb_last_open_state = dynamic.get('tag_browser_last_open_state', None)
|
||||||
|
if tb_last_open_state is not None and \
|
||||||
|
not self.horizontal_splitter.is_side_index_hidden:
|
||||||
|
self.horizontal_splitter.restoreState(tb_last_open_state)
|
||||||
|
|
||||||
bi_state = dynamic.get('book_info_state', None)
|
bi_state = dynamic.get('book_info_state', None)
|
||||||
if bi_state is not None:
|
if bi_state is not None:
|
||||||
self.vertical_splitter.restoreState(bi_state)
|
self.vertical_splitter.restoreState(bi_state)
|
||||||
self.horizontal_splitter.initialize()
|
bi_last_open_state = dynamic.get('book_info_last_open_state', None)
|
||||||
self.vertical_splitter.initialize()
|
if bi_last_open_state is not None and \
|
||||||
|
not self.vertical_splitter.is_side_index_hidden:
|
||||||
|
self.vertical_splitter.restoreState(bi_last_open_state)
|
||||||
|
|
||||||
|
self.horizontal_splitter.initialize(name='tag_browser')
|
||||||
|
self.vertical_splitter.initialize(name='book_info')
|
||||||
self.view_status_changed('book_info', not
|
self.view_status_changed('book_info', not
|
||||||
self.vertical_splitter.is_side_index_hidden)
|
self.vertical_splitter.is_side_index_hidden)
|
||||||
self.view_status_changed('tag_browser', not
|
self.view_status_changed('tag_browser', not
|
||||||
|
@ -354,7 +354,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
|||||||
self.view_menu = QMenu()
|
self.view_menu = QMenu()
|
||||||
self.view_menu.addAction(_('View'))
|
self.view_menu.addAction(_('View'))
|
||||||
ac = self.view_menu.addAction(_('View specific format'))
|
ac = self.view_menu.addAction(_('View specific format'))
|
||||||
ac.setShortcut(Qt.AltModifier+Qt.Key_V)
|
ac.setShortcut((Qt.ControlModifier if isosx else Qt.AltModifier)+Qt.Key_V)
|
||||||
self.action_view.setMenu(self.view_menu)
|
self.action_view.setMenu(self.view_menu)
|
||||||
|
|
||||||
self.delete_menu = QMenu()
|
self.delete_menu = QMenu()
|
||||||
|
@ -14,7 +14,7 @@ from PyQt4.Qt import QListView, QIcon, QFont, QLabel, QListWidget, \
|
|||||||
QMenu, QStringListModel, QCompleter, QStringList
|
QMenu, QStringListModel, QCompleter, QStringList
|
||||||
|
|
||||||
from calibre.gui2 import human_readable, NONE, TableView, \
|
from calibre.gui2 import human_readable, NONE, TableView, \
|
||||||
error_dialog, pixmap_to_data
|
error_dialog, pixmap_to_data, dynamic
|
||||||
from calibre.gui2.dialogs.job_view_ui import Ui_Dialog
|
from calibre.gui2.dialogs.job_view_ui import Ui_Dialog
|
||||||
from calibre.gui2.filename_pattern_ui import Ui_Form
|
from calibre.gui2.filename_pattern_ui import Ui_Form
|
||||||
from calibre import fit_image
|
from calibre import fit_image
|
||||||
@ -991,7 +991,9 @@ class Splitter(QSplitter):
|
|||||||
def createHandle(self):
|
def createHandle(self):
|
||||||
return SplitterHandle(self.orientation(), self)
|
return SplitterHandle(self.orientation(), self)
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self, name=None):
|
||||||
|
if name is not None:
|
||||||
|
self._name = name
|
||||||
for i in range(self.count()):
|
for i in range(self.count()):
|
||||||
h = self.handle(i)
|
h = self.handle(i)
|
||||||
if h is not None:
|
if h is not None:
|
||||||
@ -1014,13 +1016,23 @@ class Splitter(QSplitter):
|
|||||||
self.double_clicked(None)
|
self.double_clicked(None)
|
||||||
|
|
||||||
def double_clicked(self, handle):
|
def double_clicked(self, handle):
|
||||||
|
visible = not self.is_side_index_hidden
|
||||||
sizes = list(self.sizes())
|
sizes = list(self.sizes())
|
||||||
if 0 in sizes:
|
if 0 in sizes:
|
||||||
idx = sizes.index(0)
|
idx = sizes.index(0)
|
||||||
sizes[idx] = 80
|
sizes[idx] = 80
|
||||||
else:
|
else:
|
||||||
sizes[self.side_index] = 0
|
sizes[self.side_index] = 0
|
||||||
self.setSizes(sizes)
|
|
||||||
|
if visible:
|
||||||
|
dynamic.set(self._name + '_last_open_state', str(self.saveState()))
|
||||||
|
self.setSizes(sizes)
|
||||||
|
else:
|
||||||
|
state = dynamic.get(self._name+ '_last_open_state', None)
|
||||||
|
if state is not None:
|
||||||
|
self.restoreState(state)
|
||||||
|
else:
|
||||||
|
self.setSizes(sizes)
|
||||||
self.initialize()
|
self.initialize()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user