File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -243,11 +243,22 @@ def run(self):
243
243
244
244
if response == Gtk .ResponseType .OK :
245
245
# run the selected actions
246
+ self .uistate .set_busy_cursor (True )
247
+ self .uistate .progress .show ()
248
+ self .uistate .pulse_progressbar (0 )
249
+ # get the list of actions to be run
250
+ # this helps give meaningful progress information (because we know how many actions in total will be run)
251
+ actions = []
246
252
for action_type_row in self .model :
247
253
for action_row in action_type_row .iterchildren ():
248
254
if action_row .model .get_value (action_row .iter , self .RUN_ACTION_COL ):
249
- command = action_row .model .get_value (action_row .iter , self .ACTION_COMMAND_COL )
250
- (command )(self .dbstate , self .uistate , self .track )
255
+ actions .append (action_row .model .get_value (action_row .iter , self .ACTION_COMMAND_COL ))
256
+ # run the actions
257
+ for index , action in enumerate (actions ):
258
+ (action )(self .dbstate , self .uistate , self .track )
259
+ self .uistate .pulse_progressbar ((index + 1 ) / len (actions ) * 100 )
260
+ self .uistate .progress .hide ()
261
+ self .uistate .set_busy_cursor (False )
251
262
252
263
self .top .destroy ()
253
264
You can’t perform that action at this time.
0 commit comments