mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Quickview: add a "Refresh" action that is enabled when QV is locked.
This commit is contained in:
parent
a25013945a
commit
7a9d3a2c79
@ -87,6 +87,15 @@ class ShowQuickviewAction(InterfaceAction):
|
|||||||
group=self.action_spec[0])
|
group=self.action_spec[0])
|
||||||
self.focus_bl_action.triggered.connect(self.focus_booklist)
|
self.focus_bl_action.triggered.connect(self.focus_booklist)
|
||||||
|
|
||||||
|
self.focus_refresh_action = QAction(self.gui)
|
||||||
|
self.gui.addAction(self.focus_refresh_action)
|
||||||
|
self.gui.keyboard.register_shortcut('Refresh from Quickview',
|
||||||
|
_('Refresh Quickview'),
|
||||||
|
description=_('Refresh the information shown in the Quickview pane'),
|
||||||
|
action=self.focus_refresh_action,
|
||||||
|
group=self.action_spec[0])
|
||||||
|
self.focus_refresh_action.triggered.connect(self.refill_quickview)
|
||||||
|
|
||||||
self.search_action = QAction(self.gui)
|
self.search_action = QAction(self.gui)
|
||||||
self.gui.addAction(self.search_action)
|
self.gui.addAction(self.search_action)
|
||||||
self.gui.keyboard.register_shortcut('Search from Quickview', _('Search from Quickview'),
|
self.gui.keyboard.register_shortcut('Search from Quickview', _('Search from Quickview'),
|
||||||
@ -96,6 +105,7 @@ class ShowQuickviewAction(InterfaceAction):
|
|||||||
self.search_action.triggered.connect(self.search_quickview)
|
self.search_action.triggered.connect(self.search_quickview)
|
||||||
self.search_action.changed.connect(self.set_search_shortcut)
|
self.search_action.changed.connect(self.set_search_shortcut)
|
||||||
self.menuless_qaction.changed.connect(self.set_search_shortcut)
|
self.menuless_qaction.changed.connect(self.set_search_shortcut)
|
||||||
|
|
||||||
self.qv_button = QuickviewButton(self.gui, self)
|
self.qv_button = QuickviewButton(self.gui, self)
|
||||||
|
|
||||||
def initialization_complete(self):
|
def initialization_complete(self):
|
||||||
|
@ -193,9 +193,11 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.books_table.installEventFilter(focus_filter)
|
self.books_table.installEventFilter(focus_filter)
|
||||||
|
|
||||||
self.close_button.clicked.connect(self.close_button_clicked)
|
self.close_button.clicked.connect(self.close_button_clicked)
|
||||||
|
self.refresh_button.clicked.connect(self.refill)
|
||||||
|
|
||||||
self.tab_order_widgets = [self.items, self.books_table, self.lock_qv,
|
self.tab_order_widgets = [self.items, self.books_table, self.lock_qv,
|
||||||
self.dock_button, self.search_button, self.close_button]
|
self.dock_button, self.search_button, self.refresh_button,
|
||||||
|
self.close_button]
|
||||||
for idx,widget in enumerate(self.tab_order_widgets):
|
for idx,widget in enumerate(self.tab_order_widgets):
|
||||||
widget.installEventFilter(WidgetTabFilter(widget, idx, self.tab_pressed_signal))
|
widget.installEventFilter(WidgetTabFilter(widget, idx, self.tab_pressed_signal))
|
||||||
|
|
||||||
@ -239,8 +241,10 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.dock_button.setText(_('Undock'))
|
self.dock_button.setText(_('Undock'))
|
||||||
self.dock_button.setToolTip(_('Pop up the quickview panel into its own floating window'))
|
self.dock_button.setToolTip(_('Pop up the quickview panel into its own floating window'))
|
||||||
self.dock_button.setIcon(QIcon(I('arrow-up.png')))
|
self.dock_button.setIcon(QIcon(I('arrow-up.png')))
|
||||||
|
# Remove the ampersands from the buttons because shortcuts exist.
|
||||||
self.lock_qv.setText(_('Lock Quickview contents'))
|
self.lock_qv.setText(_('Lock Quickview contents'))
|
||||||
self.search_button.setText(_('Search'))
|
self.search_button.setText(_('Search'))
|
||||||
|
self.refresh_button.setText(_('Refresh'))
|
||||||
self.gui.quickview_splitter.add_quickview_dialog(self)
|
self.gui.quickview_splitter.add_quickview_dialog(self)
|
||||||
self.close_button.setVisible(False)
|
self.close_button.setVisible(False)
|
||||||
else:
|
else:
|
||||||
@ -252,6 +256,13 @@ class Quickview(QDialog, Ui_Quickview):
|
|||||||
self.dock_button.clicked.connect(self.show_as_pane_changed)
|
self.dock_button.clicked.connect(self.show_as_pane_changed)
|
||||||
self.gui.search.cleared.connect(self.indicate_no_items)
|
self.gui.search.cleared.connect(self.indicate_no_items)
|
||||||
|
|
||||||
|
# Enable the refresh button only when QV is locked
|
||||||
|
self.refresh_button.setEnabled(False)
|
||||||
|
self.lock_qv.stateChanged.connect(self.lock_qv_changed)
|
||||||
|
|
||||||
|
def lock_qv_changed(self, state):
|
||||||
|
self.refresh_button.setEnabled(state)
|
||||||
|
|
||||||
def add_columns_to_widget(self):
|
def add_columns_to_widget(self):
|
||||||
'''
|
'''
|
||||||
Get the list of columns from the preferences. Clear the current table
|
Get the list of columns from the preferences. Clear the current table
|
||||||
|
@ -148,6 +148,32 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="refresh_button">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Refresh</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>When Quickview is locked, refresh the window using the last selected book and that book's value in the last selected column.</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="close_button">
|
<widget class="QPushButton" name="close_button">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user