Button to switch back to scan panel results

This commit is contained in:
Kovid Goyal 2022-06-11 12:13:34 +05:30
parent 9fff268150
commit 31555eba05
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,7 @@ class FTSDialog(Dialog):
self.scan_status = ss = ScanStatus(self)
ss.switch_to_search_panel.connect(self.show_results_panel)
self.results_panel = rp = ResultsPanel(self)
rp.switch_to_scan_panel.connect(self.show_scan_status)
s.addWidget(ss), s.addWidget(rp)
if ss.indexing_progress.almost_complete:
self.show_results_panel()

View File

@ -76,7 +76,10 @@ class ScanProgress(QWidget):
l.addWidget(la)
self.switch_anyway = sa = QPushButton(self)
sa.clicked.connect(self.switch_to_search_panel)
l.addWidget(sa)
h = QHBoxLayout()
h.setContentsMargins(0, 0, 0, 0)
h.addWidget(sa), h.addStretch(10)
l.addLayout(h)
def change_speed(self):
db = get_db()

View File

@ -598,6 +598,8 @@ class LeftPanel(QWidget):
class ResultsPanel(QWidget):
switch_to_scan_panel = pyqtSignal()
def __init__(self, parent=None):
super().__init__(parent)
if isinstance(parent, QDialog):
@ -630,6 +632,7 @@ class ResultsPanel(QWidget):
def specialize_button_box(self, bb):
bb.clear()
bb.addButton(QDialogButtonBox.StandardButton.Close)
bb.addButton(_('Show &indexing status'), QDialogButtonBox.ButtonRole.ActionRole).clicked.connect(self.switch_to_scan_panel)
def clear_results(self):
self.results_view.m.clear_results()