mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
This commit is contained in:
commit
070056f643
4
imgsrc/eye-quickview.svg
Normal file
4
imgsrc/eye-quickview.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" ?><svg id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style type="text/css">
|
||||
.st0{fill-rule:evenodd;clip-rule:evenodd;}
|
||||
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#7ACED7;}
|
||||
</style><g id="XMLID_11_"><path class="st0" d="M64,104L64,104c17.6,0,32.7-7.9,44.9-20.3c5.2-5.3,11.2-12.8,14.7-19.7 c-3.6-6.8-9.5-14.4-14.7-19.7C96.7,32,81.6,24.1,64,24.1c-17.6,0-32.7,7.9-44.9,20.3C13.9,49.7,7.9,57.2,4.4,64 c3.6,6.8,9.5,14.4,14.7,19.7C31.3,96,46.4,104,64,104L64,104z M64,108.1L64,108.1c-18.7,0-34.9-8.4-47.8-21.5 C10.4,80.7,3.9,72.4,0.2,64.9C0.1,64.6,0,64.3,0,64c0-0.3,0.1-0.6,0.2-0.9c3.7-7.5,10.2-15.8,15.9-21.6 C29.1,28.3,45.3,19.9,64,19.9l0,0c18.7,0,34.9,8.4,47.8,21.5c5.8,5.8,12.3,14.2,15.9,21.6c0.1,0.3,0.2,0.6,0.2,0.9 c0,0.3-0.1,0.6-0.2,0.9c-3.7,7.5-10.2,15.8-15.9,21.6C98.9,99.7,82.7,108.1,64,108.1L64,108.1z M64,27.6 c20.1,0,36.4,16.3,36.4,36.4c0,20.1-16.3,36.4-36.4,36.4c-20.1,0-36.4-16.3-36.4-36.4C27.6,43.9,43.9,27.6,64,27.6L64,27.6z M64,31.7c17.8,0,32.3,14.5,32.3,32.3S81.8,96.3,64,96.3c-17.8,0-32.3-14.5-32.3-32.3S46.2,31.7,64,31.7L64,31.7z M46.7,64h-4.1 c0-11.7,9.6-21.4,21.4-21.4v4.2C54.4,46.7,46.7,54.4,46.7,64L46.7,64z M64,50.1c7.7,0,13.9,6.2,13.9,13.9c0,7.7-6.2,13.9-13.9,13.9 c-7.7,0-13.9-6.2-13.9-13.9C50.1,56.4,56.3,50.1,64,50.1z" id="XMLID_16_"/><path class="st1" d="M64,31.7c17.8,0,32.3,14.5,32.3,32.3S81.8,96.3,64,96.3c-17.8,0-32.3-14.5-32.3-32.3 S46.2,31.7,64,31.7L64,31.7z M64,50.1c-7.7,0-13.9,6.2-13.9,13.9c0,7.7,6.2,13.9,13.9,13.9c7.7,0,13.9-6.2,13.9-13.9 C77.9,56.4,71.7,50.1,64,50.1L64,50.1z M46.7,64c0-9.5,7.7-17.2,17.3-17.2v-4.2c-11.8,0-21.4,9.6-21.4,21.4H46.7z" id="XMLID_12_"/></g></svg>
|
After Width: | Height: | Size: 1.8 KiB |
@ -586,27 +586,37 @@ browser` you can change the number of covers displayed, and even have the
|
||||
Quickview
|
||||
----------
|
||||
|
||||
Sometimes you want to select a book and quickly get a list of books with the same value in some category (authors, tags, publisher, series, etc) as the currently selected book, but without changing the current view of the library. You can do this with Quickview. Quickview opens a second window showing the list of books matching the value of interest.
|
||||
|
||||
For example, assume you want to see a list of all the books with the same author of the currently-selected book. Click in the author cell you are interested in and press the 'Q' key. A window will open with all the authors for that book on the left, and all the books by the selected author on the right.
|
||||
Sometimes you want to select a book and quickly get a list of books with the same value in some category (authors, tags, publisher, series, etc.) as the currently selected book, but without changing the current view of the library. You can do this with Quickview. Quickview opens either a second window or a panel in the book list showing the list of books matching the value of interest. For example, assume you want to see a list of all the books with the one or more of the authors of the currently-selected book. Click in the author cell you are interested in and press the 'Q' key or click the Quickview icon in the Layout section of the calibre window. A window or panel will open with all the authors for that book on the left, and all the books by the selected author on the right.
|
||||
|
||||
Some example Quickview usages: quickly seeing what other books:
|
||||
- have some tag that is applied to the currently selected book,
|
||||
- have some tag(s) applied to the currently selected book,
|
||||
- are in the same series as the current book
|
||||
- have the same values in a custom column as the current book
|
||||
- are written by one of the same authors of the current book
|
||||
- share values in a custom column
|
||||
|
||||
without changing the contents of the library view.
|
||||
There are two choices for where the Quickview information appears:
|
||||
|
||||
The Quickview window opens on top of the calibre window and will stay open until you explicitly close it. You can use Quickview and the calibre library view at the same time. For example, if in the calibre library view you click on a category column (tags, series, publisher, authors, etc) for a book, the Quickview window contents will change to show you in the left-hand side pane the items in that category for the selected book (e.g., the tags for that book). The first item in that list will be selected, and Quickview will show you on the right-hand side pane all the books in your library that reference that item. Click on an different item in the left-hand pane to see the books with that different item.
|
||||
1. It can open "undocked": on top of the calibre window and will stay open until you explicitly close it.
|
||||
2. It can open "docked": as a panel in the book list section of the calibre main window.
|
||||
|
||||
You can move the window from docked to undocked as desired using the "Dock/Undock" button.
|
||||
|
||||
Double-click on a book in the Quickview window to select that book in the library view. This will also change the items display in the QuickView window (the left-hand pane) to show the items in the newly-selected book.
|
||||
The Quickview panel can be left open permanently, in which case it follows movements on the book list. For example, if you click in the calibre library view on a category column (tags, series, publisher, authors, etc.) for a book, the Quickview window contents will change to show you in the left-hand side panel the values in that category for the selected book (e.g., the tags for that book). The first item in that list will be selected, and Quickview will show you on the right-hand side panel all the books in your library that use that value. Click on an different value in the left-hand panel to see the books with that different value.
|
||||
|
||||
Shift- (or Ctrl-) double-click on a book in the Quickview window to open the edit metadata dialog on that book in the calibre window.
|
||||
Double-click on a book in the Quickview window to select that book in the library view. This will also change the items display in the QuickView window (the left-hand panel) to show the items in the newly-selected book.
|
||||
|
||||
``Shift-`` or ``Ctrl-`` double-click on a book in the Quickview window to open the edit metadata dialog on that book in the calibre window. The edited book will be Quickview'ed when you close the edit metadata dialog.
|
||||
|
||||
You can see if a column can be Quickview'ed by hovering your mouse over the column heading and looking at the tooltip for that heading. You can also know by right-clicking on the column heading to see of the "Quickview" option is shown in the menu, in which case choosing that Quickview option is equivalent to pressing 'Q' in the current cell.
|
||||
|
||||
Quickview respects the virtual library setting, showing only books in the current virtual library.
|
||||
Options (in :guilabel:`Preferences->Look & feel->Quickview`):
|
||||
|
||||
* Respect (or not) the current virtual library. If checked then Quickview shows only books in the current virtual library. Default: respect virtual libraries
|
||||
* Change the Quickview window contents when the column is changed on the book list using the cursor keys. Default: don't follow changes made with cursor keys
|
||||
* Change the column being "quickview'ed" when a cell in the Quickview window is double-clicked. Otherwise the book is changed but the column being examined is not. Default: change the column
|
||||
* Change the column being "quickview'ed" to the current column when the return key is pressed in the Quickview panel. Otherwise the book is changed but the column being examined is not. Default: change the column
|
||||
* Choose which columns are shown in the Quickview window/panel.
|
||||
|
||||
.. raw:: html epub
|
||||
|
||||
|
BIN
resources/images/eye-quickview.png
Normal file
BIN
resources/images/eye-quickview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
@ -155,7 +155,7 @@ def create_defs():
|
||||
defs['qv_respects_vls'] = True
|
||||
defs['qv_dclick_changes_column'] = True
|
||||
defs['qv_retkey_changes_column'] = True
|
||||
defs['qv_show_on_startup'] = False
|
||||
defs['qv_follows_column'] = False
|
||||
|
||||
|
||||
create_defs()
|
||||
|
@ -10,21 +10,50 @@ from PyQt5.Qt import QAction
|
||||
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre.gui2.dialogs.quickview import Quickview
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.gui2 import error_dialog, gprefs
|
||||
from calibre.gui2.widgets import LayoutButton
|
||||
|
||||
|
||||
class QuickviewButton(LayoutButton): # {{{
|
||||
|
||||
def __init__(self, gui, quickview_manager):
|
||||
self.qv = quickview_manager
|
||||
qaction = quickview_manager.qaction
|
||||
LayoutButton.__init__(self, I('eye-quickview.png'), _('Quickview'),
|
||||
parent=gui, shortcut=qaction.shortcut().toString())
|
||||
self.toggled.connect(self.update_state)
|
||||
self.action_toggle = qaction
|
||||
self.action_toggle.triggered.connect(self.toggle)
|
||||
self.action_toggle.changed.connect(self.update_shortcut)
|
||||
|
||||
def update_state(self, checked):
|
||||
if checked:
|
||||
self.set_state_to_hide()
|
||||
self.qv._show_quickview()
|
||||
else:
|
||||
self.set_state_to_show()
|
||||
self.qv._hide_quickview()
|
||||
|
||||
def save_state(self):
|
||||
gprefs['quickview visible'] = bool(self.isChecked())
|
||||
|
||||
def restore_state(self):
|
||||
if gprefs.get('quickview visible', False):
|
||||
self.toggle()
|
||||
|
||||
# }}}
|
||||
|
||||
|
||||
class ShowQuickviewAction(InterfaceAction):
|
||||
|
||||
name = 'Show Quickview'
|
||||
action_spec = (_('Show Quickview'), 'search.png', None, _('Q'))
|
||||
action_spec = (_('Show Quickview'), 'eye-quickview.png', None, _('Q'))
|
||||
dont_add_to = frozenset(['context-menu-device'])
|
||||
action_type = 'current'
|
||||
|
||||
current_instance = None
|
||||
|
||||
def genesis(self):
|
||||
self.qaction.triggered.connect(self.show_quickview)
|
||||
|
||||
self.focus_action = QAction(self.gui)
|
||||
self.gui.addAction(self.focus_action)
|
||||
self.gui.keyboard.register_shortcut('Focus To Quickview', _('Focus to Quickview'),
|
||||
@ -42,55 +71,83 @@ class ShowQuickviewAction(InterfaceAction):
|
||||
self.search_action.triggered.connect(self.search_quickview)
|
||||
self.search_action.changed.connect(self.set_search_shortcut)
|
||||
self.menuless_qaction.changed.connect(self.set_search_shortcut)
|
||||
self.qv_button = QuickviewButton(self.gui, self)
|
||||
|
||||
def show_quickview(self, *args):
|
||||
def _hide_quickview(self):
|
||||
'''
|
||||
This is called only from the QV button toggle
|
||||
'''
|
||||
if self.current_instance:
|
||||
if not self.current_instance.is_closed:
|
||||
self.current_instance.reject()
|
||||
self.current_instance = None
|
||||
return
|
||||
self.current_instance._reject()
|
||||
self.current_instance = None
|
||||
|
||||
def _show_quickview(self, *args):
|
||||
'''
|
||||
This is called only from the QV button toggle
|
||||
'''
|
||||
if self.current_instance:
|
||||
if not self.current_instance.is_closed:
|
||||
self.current_instance._reject()
|
||||
self.current_instance = None
|
||||
if self.gui.current_view() is not self.gui.library_view:
|
||||
error_dialog(self.gui, _('No quickview available'),
|
||||
_('Quickview is not available for books '
|
||||
'on the device.')).exec_()
|
||||
return
|
||||
self.qv_button.set_state_to_hide()
|
||||
index = self.gui.library_view.currentIndex()
|
||||
self.current_instance = Quickview(self.gui, index)
|
||||
self.current_instance.reopen_quickview.connect(self.reopen_quickview)
|
||||
self.current_instance.reopen_after_dock_change.connect(self.open_quickview)
|
||||
self.set_search_shortcut()
|
||||
self.current_instance.show()
|
||||
self.current_instance.quickview_closed.connect(self.qv_button.set_state_to_show)
|
||||
|
||||
def set_search_shortcut(self):
|
||||
if self.current_instance and not self.current_instance.is_closed:
|
||||
self.current_instance.set_shortcuts(self.search_action.shortcut().toString(),
|
||||
self.menuless_qaction.shortcut().toString())
|
||||
|
||||
def reopen_quickview(self):
|
||||
def open_quickview(self):
|
||||
'''
|
||||
QV moved from/to dock. Close and reopen the pane/window.
|
||||
Also called when QV is closed and the user asks to move the focus
|
||||
'''
|
||||
if self.current_instance and not self.current_instance.is_closed:
|
||||
self.current_instance.reject()
|
||||
self.current_instance = None
|
||||
self.show_quickview()
|
||||
self.qaction.triggered.emit()
|
||||
|
||||
def refill_quickview(self):
|
||||
'''
|
||||
Called when the data or the columns shown in the QV pane might have changed.
|
||||
'''
|
||||
if self.current_instance and not self.current_instance.is_closed:
|
||||
self.current_instance.refill()
|
||||
|
||||
def change_quickview_column(self, idx):
|
||||
self.show_quickview()
|
||||
if self.current_instance:
|
||||
if self.current_instance.is_closed:
|
||||
return
|
||||
self.current_instance.change_quickview_column.emit(idx)
|
||||
'''
|
||||
Called from the column header context menu to change the QV query column
|
||||
'''
|
||||
self.focus_quickview()
|
||||
self.current_instance.slave(idx)
|
||||
|
||||
def library_changed(self, db):
|
||||
'''
|
||||
If QV is open, close it then reopen it so the columns are correct
|
||||
'''
|
||||
if self.current_instance and not self.current_instance.is_closed:
|
||||
self.current_instance.reject()
|
||||
self.qaction.triggered.emit()
|
||||
|
||||
def focus_quickview(self):
|
||||
if not (self.current_instance and not self.current_instance.is_closed):
|
||||
self.show_quickview()
|
||||
self.current_instance.set_focus()
|
||||
'''
|
||||
Used to move the focus to the QV books table. Open QV if needed
|
||||
'''
|
||||
if not self.current_instance or self.current_instance.is_closed:
|
||||
self.open_quickview()
|
||||
else:
|
||||
self.current_instance.set_focus()
|
||||
|
||||
def search_quickview(self):
|
||||
if not self.current_instance or self.current_instance.is_closed:
|
||||
|
@ -6,8 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
from PyQt5.Qt import (
|
||||
Qt, QDialog, QAbstractItemView, QTableWidgetItem, QIcon, QListWidgetItem,
|
||||
QCoreApplication, QEvent, QObject, QApplication, pyqtSignal,
|
||||
QDialogButtonBox, QByteArray)
|
||||
QCoreApplication, QEvent, QObject, QApplication, pyqtSignal, QByteArray)
|
||||
|
||||
from calibre.customize.ui import find_plugin
|
||||
from calibre.gui2 import gprefs
|
||||
@ -95,21 +94,22 @@ class WidgetTabFilter(QObject):
|
||||
|
||||
class Quickview(QDialog, Ui_Quickview):
|
||||
|
||||
change_quickview_column = pyqtSignal(object)
|
||||
reopen_quickview = pyqtSignal()
|
||||
tab_pressed_signal = pyqtSignal(object, object)
|
||||
reopen_after_dock_change = pyqtSignal()
|
||||
tab_pressed_signal = pyqtSignal(object, object)
|
||||
quickview_closed = pyqtSignal()
|
||||
|
||||
def __init__(self, gui, row):
|
||||
self.is_pane = gprefs.get('quickview_is_pane', False)
|
||||
|
||||
if not self.is_pane:
|
||||
QDialog.__init__(self, gui, flags=Qt.Window)
|
||||
QDialog.__init__(self, gui, flags=Qt.Widget)
|
||||
else:
|
||||
QDialog.__init__(self, gui)
|
||||
Ui_Quickview.__init__(self)
|
||||
self.setupUi(self)
|
||||
self.isClosed = False
|
||||
self.current_book = None
|
||||
self.closed_by_button = False
|
||||
|
||||
if self.is_pane:
|
||||
self.main_grid_layout.setContentsMargins(0, 0, 0, 0)
|
||||
@ -160,7 +160,7 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
focus_filter.focus_entered_signal.connect(self.focus_entered)
|
||||
self.books_table.installEventFilter(focus_filter)
|
||||
|
||||
self.close_button = self.buttonBox.button(QDialogButtonBox.Close)
|
||||
self.close_button.clicked.connect(self.close_button_clicked)
|
||||
|
||||
self.tab_order_widgets = [self.items, self.books_table, self.lock_qv,
|
||||
self.dock_button, self.search_button, self.close_button]
|
||||
@ -194,7 +194,7 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
self.refresh(row)
|
||||
|
||||
self.view.clicked.connect(self.slave)
|
||||
self.change_quickview_column.connect(self.slave)
|
||||
self.view.selectionModel().currentColumnChanged.connect(self.column_slave)
|
||||
QCoreApplication.instance().aboutToQuit.connect(self.save_state)
|
||||
self.search_button.clicked.connect(self.do_search)
|
||||
self.view.model().new_bookdisplay_data.connect(self.book_was_changed)
|
||||
@ -210,9 +210,8 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
self.lock_qv.setText(_('Lock Quickview contents'))
|
||||
self.search_button.setText(_('Search'))
|
||||
self.gui.quickview_splitter.add_quickview_dialog(self)
|
||||
self.close_button.setVisible(False)
|
||||
else:
|
||||
self.close_button.setText(_('&Close'))
|
||||
self.dock_button.setText(_('&Dock'))
|
||||
self.dock_button.setToolTip(_('Embed the quickview panel into the main calibre window'))
|
||||
self.dock_button.setIcon(QIcon(I('arrow-down.png')))
|
||||
self.set_focus()
|
||||
@ -314,7 +313,7 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
|
||||
def show_as_pane_changed(self):
|
||||
gprefs['quickview_is_pane'] = not gprefs.get('quickview_is_pane', False)
|
||||
self.reopen_quickview.emit()
|
||||
self.reopen_after_dock_change.emit()
|
||||
|
||||
# search button
|
||||
def do_search(self):
|
||||
@ -544,10 +543,20 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
self.view.column_map.index(key))
|
||||
|
||||
def set_focus(self):
|
||||
self.items.setFocus(Qt.ActiveWindowFocusReason)
|
||||
self.activateWindow()
|
||||
self.books_table.setFocus()
|
||||
|
||||
def column_slave(self, current):
|
||||
'''
|
||||
called when the column is changed on the booklist
|
||||
'''
|
||||
if gprefs['qv_follows_column']:
|
||||
self.slave(current)
|
||||
|
||||
# called when a book is clicked on the library view
|
||||
def slave(self, current):
|
||||
'''
|
||||
called when a book is clicked on the library view
|
||||
'''
|
||||
if self.is_closed:
|
||||
return
|
||||
self.refresh(current)
|
||||
@ -572,8 +581,17 @@ class Quickview(QDialog, Ui_Quickview):
|
||||
self.db = self.view = self.gui = None
|
||||
self.is_closed = True
|
||||
|
||||
# called by the close button
|
||||
def close_button_clicked(self):
|
||||
self.closed_by_button = True
|
||||
self.quickview_closed.emit()
|
||||
|
||||
def reject(self):
|
||||
if not self.closed_by_button:
|
||||
self.close_button_clicked()
|
||||
else:
|
||||
self._reject()
|
||||
|
||||
def _reject(self):
|
||||
if self.is_pane:
|
||||
self.gui.quickview_splitter.hide_quickview_widget()
|
||||
self.gui.library_view.setFocus(Qt.ActiveWindowFocusReason)
|
||||
|
@ -149,11 +149,11 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
<widget class="QPushButton" name="close_button">
|
||||
<property name="text">
|
||||
<string>&Close</string>
|
||||
</property>
|
||||
<property name="centerButtons">
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
@ -176,22 +176,4 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>Quickview</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>297</x>
|
||||
<y>217</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>234</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
@ -23,6 +23,7 @@ from calibre.gui2.tag_browser.ui import TagBrowserWidget
|
||||
from calibre.gui2.book_details import BookDetails
|
||||
from calibre.gui2.notify import get_notifier
|
||||
from calibre.gui2.layout_menu import LayoutMenu
|
||||
from calibre.customize.ui import find_plugin
|
||||
|
||||
_keep_refs = []
|
||||
|
||||
@ -552,7 +553,7 @@ class LayoutMixin(object): # {{{
|
||||
self.bd_splitter.addWidget(self.book_details)
|
||||
self.bd_splitter.setCollapsible(self.bd_splitter.other_index, False)
|
||||
self.centralwidget.layout().addWidget(self.bd_splitter)
|
||||
button_order = ('sb', 'tb', 'bd', 'gv', 'cb')
|
||||
button_order = ('sb', 'tb', 'bd', 'gv', 'cb', 'qv')
|
||||
# }}}
|
||||
else: # wide {{{
|
||||
self.bd_splitter = Splitter('book_details_splitter',
|
||||
@ -567,9 +568,13 @@ class LayoutMixin(object): # {{{
|
||||
self.bd_splitter.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,
|
||||
QSizePolicy.Expanding))
|
||||
self.centralwidget.layout().addWidget(self.bd_splitter)
|
||||
button_order = ('sb', 'tb', 'cb', 'gv', 'bd')
|
||||
button_order = ('sb', 'tb', 'cb', 'gv', 'qv', 'bd')
|
||||
# }}}
|
||||
|
||||
self.qv = find_plugin('Show Quickview')
|
||||
if self.qv:
|
||||
self.qv = self.qv.actual_plugin_
|
||||
|
||||
self.status_bar = StatusBar(self)
|
||||
stylename = unicode(self.style().objectName())
|
||||
self.grid_view_button = GridViewButton(self)
|
||||
@ -582,7 +587,14 @@ class LayoutMixin(object): # {{{
|
||||
if hasattr(self, x + '_splitter'):
|
||||
button = getattr(self, x + '_splitter').button
|
||||
else:
|
||||
button = self.grid_view_button if x == 'gv' else self.search_bar_button
|
||||
if x == 'gv':
|
||||
button = self.grid_view_button
|
||||
elif x == 'qv':
|
||||
if self.qv is None:
|
||||
continue
|
||||
button = self.qv.qv_button
|
||||
else:
|
||||
button = self.search_bar_button
|
||||
self.layout_buttons.append(button)
|
||||
button.setVisible(False)
|
||||
if isosx and stylename != u'Calibre':
|
||||
@ -722,6 +734,8 @@ class LayoutMixin(object): # {{{
|
||||
s.save_state()
|
||||
self.grid_view_button.save_state()
|
||||
self.search_bar_button.save_state()
|
||||
if self.qv:
|
||||
self.qv.qv_button.save_state()
|
||||
|
||||
def read_layout_settings(self):
|
||||
# View states are restored automatically when set_database is called
|
||||
@ -729,6 +743,7 @@ class LayoutMixin(object): # {{{
|
||||
getattr(self, x+'_splitter').restore_state()
|
||||
self.grid_view_button.restore_state()
|
||||
self.search_bar_button.restore_state()
|
||||
# Can't do quickview here because the gui isn't totally set up. Do it in ui
|
||||
|
||||
def update_status_bar(self, *args):
|
||||
v = self.current_view()
|
||||
|
@ -387,7 +387,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
r('qv_respects_vls', gprefs)
|
||||
r('qv_dclick_changes_column', gprefs)
|
||||
r('qv_retkey_changes_column', gprefs)
|
||||
r('qv_show_on_startup', gprefs)
|
||||
r('qv_follows_column', gprefs)
|
||||
|
||||
r('cover_flow_queue_length', config, restart_required=True)
|
||||
r('cover_browser_reflections', gprefs)
|
||||
|
@ -1134,7 +1134,7 @@ them to all have the same width and height</string>
|
||||
<widget class="QWidget" name="quickview_tab">
|
||||
<attribute name="icon">
|
||||
<iconset resource="../../../../resources/images.qrc">
|
||||
<normaloff>:/images/search.png</normaloff>:/images/search.png</iconset>
|
||||
<normaloff>:/images/eye-quickview.png</normaloff>:/images/eye-quickview.png</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>&Quickview</string>
|
||||
@ -1142,25 +1142,30 @@ them to all have the same width and height</string>
|
||||
<layout class="QGridLayout" name="gridLayout_122">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout_122">
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="opt_qv_respects_vls">
|
||||
<property name="text">
|
||||
<string>&Apply virtual libraries in Quickview pane</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Check this box to make Quickview show books only in the
|
||||
current virtual library. If unchecked, Quickview ignores virtual libraries.</string>
|
||||
current virtual library. If unchecked, Quickview ignores virtual libraries. If
|
||||
unchecked then only row changes are taken into account.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="opt_qv_show_on_startup">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="opt_qv_follows_column">
|
||||
<property name="text">
|
||||
<string>&Show Quickview on startup</string>
|
||||
<string>&Change QV item when book list column changes</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Check this box to make Quickview change the column being examined
|
||||
when the column in the book list is changed using the cursor arrow keys</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="opt_qv_retkey_changes_column">
|
||||
<property name="toolTip">
|
||||
<string>Pressing return in a cell changes both the book and the
|
||||
@ -1171,7 +1176,7 @@ column being examined (the left-hand pane)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="opt_qv_dclick_changes_column">
|
||||
<property name="toolTip">
|
||||
<string>Double-clicking in a cell changes both the book and the
|
||||
|
@ -426,12 +426,14 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
if self.system_tray_icon is not None and self.system_tray_icon.isVisible() and opts.start_in_tray:
|
||||
self.hide_windows()
|
||||
self.auto_adder = AutoAdder(gprefs['auto_add_path'], self)
|
||||
self.save_layout_state()
|
||||
|
||||
if gprefs['qv_show_on_startup']:
|
||||
qv = find_plugin('Show Quickview')
|
||||
if qv is not None:
|
||||
qv.actual_plugin_.show_quickview()
|
||||
# Now that the gui is initialized we can restore the quickview state
|
||||
# The same thing will be true for any action-based operation with a
|
||||
# layout button
|
||||
qv = find_plugin('Show Quickview')
|
||||
if qv is not None:
|
||||
qv.actual_plugin_.qv_button.restore_state()
|
||||
self.save_layout_state()
|
||||
|
||||
# Collect cycles now
|
||||
gc.collect()
|
||||
|
Loading…
x
Reference in New Issue
Block a user