mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-23 15:47:00 +00:00
TERuleQueryTab: Make the QProgressDialog more informative.
Also more agressively check cancelation, so processing will end sooner. Force repaints to try to ensure the dialog text is updated, as for large results, the GUI becomes unresponsive when resizing the table.
This commit is contained in:
parent
0e22483d82
commit
afab62934e
@ -113,7 +113,6 @@ class TERuleQueryTab(SEToolsWidget, QScrollArea):
|
||||
# create a "busy, please wait" dialog
|
||||
self.busy = QProgressDialog(self)
|
||||
self.busy.setModal(True)
|
||||
self.busy.setLabelText("Processing query...")
|
||||
self.busy.setRange(0, 0)
|
||||
self.busy.setMinimumDuration(0)
|
||||
self.busy.canceled.connect(self.thread.requestInterruption)
|
||||
@ -318,14 +317,31 @@ class TERuleQueryTab(SEToolsWidget, QScrollArea):
|
||||
return
|
||||
|
||||
# start processing
|
||||
self.busy.setLabelText("Processing query...")
|
||||
self.busy.show()
|
||||
self.raw_results.clear()
|
||||
self.update_results.emit()
|
||||
|
||||
def update_complete(self):
|
||||
# update sizes/location of result displays
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Resizing the result table's columns; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.table_results.resizeColumnsToContents()
|
||||
# If the permissions column width is too long, pull back
|
||||
# to a reasonable size
|
||||
header = self.table_results.horizontalHeader()
|
||||
if header.sectionSize(4) > 400:
|
||||
header.resizeSection(4, 400)
|
||||
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Resizing the result table's rows; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.table_results.resizeRowsToContents()
|
||||
|
||||
if not self.busy.wasCanceled():
|
||||
self.busy.setLabelText("Moving the raw result to top; GUI may be unresponsive")
|
||||
self.busy.repaint()
|
||||
self.raw_results.moveCursor(QTextCursor.Start)
|
||||
|
||||
self.busy.reset()
|
||||
|
Loading…
Reference in New Issue
Block a user