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)
|
||||
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
|
||||
for w in getattr(self, 'custom_column_widgets', []):
|
||||
w.commit(self.ids)
|
||||
|
@ -253,7 +253,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="2">
|
||||
<item row="11" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="swap_title_and_author">
|
||||
<property name="text">
|
||||
<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>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
|
@ -11,8 +11,8 @@ from PyQt4.QtGui import QTableView, QAbstractItemView, QColor, \
|
||||
QPainterPath, QLinearGradient, QBrush, \
|
||||
QPen, QStyle, QPainter, QStyleOptionViewItemV4, \
|
||||
QIcon, QImage, QMenu, QSpinBox, QDoubleSpinBox, \
|
||||
QStyledItemDelegate, QCompleter, QIntValidator, \
|
||||
QDoubleValidator, QComboBox
|
||||
QStyledItemDelegate, QCompleter, \
|
||||
QComboBox
|
||||
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt, pyqtSignal, \
|
||||
SIGNAL, QObject, QSize, QModelIndex, QDate
|
||||
|
||||
|
@ -147,12 +147,21 @@ class SideBar(QToolBar):
|
||||
tb_state = dynamic.get('tag_browser_state', None)
|
||||
if tb_state is not None:
|
||||
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)
|
||||
if bi_state is not None:
|
||||
self.vertical_splitter.restoreState(bi_state)
|
||||
self.horizontal_splitter.initialize()
|
||||
self.vertical_splitter.initialize()
|
||||
bi_last_open_state = dynamic.get('book_info_last_open_state', None)
|
||||
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.vertical_splitter.is_side_index_hidden)
|
||||
self.view_status_changed('tag_browser', not
|
||||
|
@ -354,7 +354,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
self.view_menu = QMenu()
|
||||
self.view_menu.addAction(_('View'))
|
||||
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.delete_menu = QMenu()
|
||||
|
@ -14,7 +14,7 @@ from PyQt4.Qt import QListView, QIcon, QFont, QLabel, QListWidget, \
|
||||
QMenu, QStringListModel, QCompleter, QStringList
|
||||
|
||||
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.filename_pattern_ui import Ui_Form
|
||||
from calibre import fit_image
|
||||
@ -991,7 +991,9 @@ class Splitter(QSplitter):
|
||||
def createHandle(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()):
|
||||
h = self.handle(i)
|
||||
if h is not None:
|
||||
@ -1014,12 +1016,22 @@ class Splitter(QSplitter):
|
||||
self.double_clicked(None)
|
||||
|
||||
def double_clicked(self, handle):
|
||||
visible = not self.is_side_index_hidden
|
||||
sizes = list(self.sizes())
|
||||
if 0 in sizes:
|
||||
idx = sizes.index(0)
|
||||
sizes[idx] = 80
|
||||
else:
|
||||
sizes[self.side_index] = 0
|
||||
|
||||
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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user