Skip to content
Snippets Groups Projects
Commit 09541329 authored by Eva Schiffer's avatar Eva Schiffer
Browse files

using a wait cursor when doing potentially slow things in the gui

parent 82276bea
No related branches found
No related tags found
No related merge requests found
......@@ -540,10 +540,16 @@ class GlanceGUIView (QWidget) :
if (tempFilePath is not None) and (len(tempFilePath) > 0) :
self.lastFilePath = os.path.dirname(str(tempFilePath))
# turn on the wait cursor, in case this takes a long time
self.setCursor(Qt.WaitCursor)
# let our listeners know that the user picked a file
for listener in self.userUpdateListeners :
listener.newFileSelected(file_prefix, tempFilePath)
# now that we're done, put the cursor back to an arrow
self.setCursor(Qt.ArrowCursor)
def reportVariableSelected (self, file_prefix=None) :
"""
......@@ -803,10 +809,16 @@ class GlanceGUIView (QWidget) :
# make sure the focus isn't in a line-edit box
self.statsButton.setFocus()
# turn on the wait cursor, in case this takes a long time
self.setCursor(Qt.WaitCursor)
# now report to our listeners that the user wants stats
for listener in self.userUpdateListeners :
listener.userRequestsStats()
# now that we're done, put the cursor back to an arrow
self.setCursor(Qt.ArrowCursor)
def reportDisplayRawDataClicked (self) :
"""
......@@ -815,22 +827,34 @@ class GlanceGUIView (QWidget) :
# make sure the focus isn't in a line-edit box
self.rawDataButton.setFocus()
# turn on the wait cursor, in case this takes a long time
self.setCursor(Qt.WaitCursor)
for listener in self.userUpdateListeners :
listener.userRequestsRawData()
# now that we're done, put the cursor back to an arrow
self.setCursor(Qt.ArrowCursor)
def reportDisplayPlotClicked (self) :
"""
the user clicked the display plot button
the user clicked the create plot button
"""
# first we need to clean up focus in case it's in one of the line-edit boxes
self.displayButton.setFocus()
# turn on the wait cursor, in case this takes a long time
self.setCursor(Qt.WaitCursor)
# now report to our listeners that the user wants a plot
for listener in self.userUpdateListeners :
listener.userRequestsPlot()
# now that we're done, put the cursor back to an arrow
self.setCursor(Qt.ArrowCursor)
def reportDisplayGlobalAttrsClicked(self):
"""
the user clicked the show global attributes button
......@@ -839,9 +863,15 @@ class GlanceGUIView (QWidget) :
# make sure the focus isn't in a line-edit box
self.gAttrsButton.setFocus()
# turn on the wait cursor, in case this takes a long time
self.setCursor(Qt.WaitCursor)
for listener in self.userUpdateListeners:
listener.userRequestsGlobalAttrs()
# now that we're done, put the cursor back to an arrow
self.setCursor(Qt.ArrowCursor)
def _extra_number_validation (self, string_that_should_be_a_number) :
"""
try to validate the string that should be a number
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment