mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
window: protect against delayed ::stopped
Large captures could take a while to complete the stop request, so protect against that so that the user can't accidentally start another capture.
This commit is contained in:
@ -379,14 +379,6 @@ sp_window_start_recording (SpWindow *self)
|
||||
{
|
||||
g_assert (SP_IS_WINDOW (self));
|
||||
|
||||
if (self->state == SP_WINDOW_STATE_RECORDING)
|
||||
{
|
||||
/* SpProfiler::stopped will move us to generating */
|
||||
gtk_label_set_label (self->subtitle, _("Stopping…"));
|
||||
sp_profiler_stop (self->profiler);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((self->state == SP_WINDOW_STATE_EMPTY) ||
|
||||
(self->state == SP_WINDOW_STATE_FAILED) ||
|
||||
(self->state == SP_WINDOW_STATE_BROWSING))
|
||||
@ -407,7 +399,16 @@ sp_window_stop_recording (SpWindow *self)
|
||||
if (self->state == SP_WINDOW_STATE_RECORDING)
|
||||
{
|
||||
if (self->profiler != NULL)
|
||||
sp_profiler_stop (self->profiler);
|
||||
{
|
||||
/* SpProfiler::stopped will move us to generating */
|
||||
gtk_label_set_label (self->subtitle, _("Stopping…"));
|
||||
/*
|
||||
* In case that ::stopped takes a while to execute,
|
||||
* disable record button immediately.
|
||||
*/
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (self->record_button), FALSE);
|
||||
sp_profiler_stop (self->profiler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user