mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Restore splitter state
This commit is contained in:
parent
7d8fe94078
commit
43a99da50b
@ -17,7 +17,7 @@ from calibre.gui2.widgets2 import Dialog
|
|||||||
class FTSDialog(Dialog):
|
class FTSDialog(Dialog):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super().__init__(_('Search the text of all books in the library'), 'library-fts-dialog-2',
|
super().__init__(_('Search the text of all books in the library'), 'library-fts-dialog',
|
||||||
default_buttons=QDialogButtonBox.StandardButton.Close)
|
default_buttons=QDialogButtonBox.StandardButton.Close)
|
||||||
self.setWindowIcon(QIcon.ic('fts.png'))
|
self.setWindowIcon(QIcon.ic('fts.png'))
|
||||||
|
|
||||||
|
@ -731,6 +731,9 @@ class ResultsPanel(QWidget):
|
|||||||
rv.search_started.connect(d.clear)
|
rv.search_started.connect(d.clear)
|
||||||
rv.result_with_context_found.connect(d.result_with_context_found)
|
rv.result_with_context_found.connect(d.result_with_context_found)
|
||||||
s.addWidget(d)
|
s.addWidget(d)
|
||||||
|
st = gprefs.get('fts_search_splitter_state')
|
||||||
|
if st is not None:
|
||||||
|
s.restoreState(st)
|
||||||
|
|
||||||
def request_stop_search(self):
|
def request_stop_search(self):
|
||||||
if question_dialog(self, _('Are you sure?'), _('Abort the current search?')):
|
if question_dialog(self, _('Are you sure?'), _('Abort the current search?')):
|
||||||
@ -745,6 +748,8 @@ class ResultsPanel(QWidget):
|
|||||||
self.results_view.m.clear_results()
|
self.results_view.m.clear_results()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
|
b = self.splitter.saveState()
|
||||||
|
gprefs['fts_search_splitter_state'] = bytearray(b)
|
||||||
self.clear_results()
|
self.clear_results()
|
||||||
|
|
||||||
def on_show(self):
|
def on_show(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user