sysprof: allow passing program path to sysprof

If the path provided to us is an executable program (instead of a syscap
file) then we can setup the path as the binary to execute in the profiler
assistant and save the user a couple clicks.
This commit is contained in:
Christian Hergert
2020-01-23 11:59:07 -08:00
parent 599ecaebe1
commit 731b6dd379
3 changed files with 33 additions and 3 deletions

View File

@ -455,3 +455,22 @@ _sysprof_profiler_assistant_focus_record (SysprofProfilerAssistant *self)
gtk_widget_grab_focus (GTK_WIDGET (self->record_button));
}
void
sysprof_profiler_assistant_set_executable (SysprofProfilerAssistant *self,
const gchar *path)
{
g_return_if_fail (SYSPROF_IS_PROFILER_ASSISTANT (self));
if (path == NULL || path[0] == 0)
{
gtk_entry_set_text (GTK_ENTRY (self->command_line), "");
gtk_switch_set_active (self->launch_switch, FALSE);
}
else
{
gtk_entry_set_text (GTK_ENTRY (self->command_line), path);
gtk_switch_set_active (self->launch_switch, TRUE);
gtk_widget_grab_focus (GTK_WIDGET (self->command_line));
}
}