mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 08:00:53 +00:00
libsysprof-ui: focus record button by default
Because if we break the "hit enter to launch, escape to stop" workflow some people will be angry.
This commit is contained in:
@ -33,6 +33,7 @@
|
|||||||
#include "sysprof-display.h"
|
#include "sysprof-display.h"
|
||||||
#include "sysprof-empty-state-view.h"
|
#include "sysprof-empty-state-view.h"
|
||||||
#include "sysprof-recording-state-view.h"
|
#include "sysprof-recording-state-view.h"
|
||||||
|
#include "sysprof-ui-private.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -581,3 +582,13 @@ sysprof_display_stop_recording (SysprofDisplay *self)
|
|||||||
if (priv->profiler != NULL)
|
if (priv->profiler != NULL)
|
||||||
sysprof_profiler_stop (priv->profiler);
|
sysprof_profiler_stop (priv->profiler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_sysprof_display_focus_record (SysprofDisplay *self)
|
||||||
|
{
|
||||||
|
SysprofDisplayPrivate *priv = sysprof_display_get_instance_private (self);
|
||||||
|
|
||||||
|
g_return_if_fail (SYSPROF_IS_DISPLAY (self));
|
||||||
|
|
||||||
|
_sysprof_profiler_assistant_focus_record (priv->assistant);
|
||||||
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
#include "sysprof-display.h"
|
#include "sysprof-display.h"
|
||||||
#include "sysprof-notebook.h"
|
#include "sysprof-notebook.h"
|
||||||
#include "sysprof-tab.h"
|
#include "sysprof-tab.h"
|
||||||
|
#include "sysprof-ui-private.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (SysprofNotebook, sysprof_notebook, GTK_TYPE_NOTEBOOK)
|
G_DEFINE_TYPE (SysprofNotebook, sysprof_notebook, GTK_TYPE_NOTEBOOK)
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ sysprof_notebook_page_added (GtkNotebook *notebook,
|
|||||||
g_assert (SYSPROF_IS_NOTEBOOK (notebook));
|
g_assert (SYSPROF_IS_NOTEBOOK (notebook));
|
||||||
g_assert (GTK_IS_WIDGET (child));
|
g_assert (GTK_IS_WIDGET (child));
|
||||||
|
|
||||||
|
gtk_notebook_set_show_tabs (notebook,
|
||||||
|
gtk_notebook_get_n_pages (notebook) > 1);
|
||||||
|
|
||||||
if (SYSPROF_IS_DISPLAY (child))
|
if (SYSPROF_IS_DISPLAY (child))
|
||||||
{
|
{
|
||||||
GtkWidget *tab = sysprof_tab_new (SYSPROF_DISPLAY (child));
|
GtkWidget *tab = sysprof_tab_new (SYSPROF_DISPLAY (child));
|
||||||
@ -86,10 +90,9 @@ sysprof_notebook_page_added (GtkNotebook *notebook,
|
|||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (notebook), properties [PROP_CAN_SAVE]);
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties [PROP_CAN_SAVE]);
|
||||||
g_object_notify_by_pspec (G_OBJECT (notebook), properties [PROP_CURRENT]);
|
g_object_notify_by_pspec (G_OBJECT (notebook), properties [PROP_CURRENT]);
|
||||||
}
|
|
||||||
|
|
||||||
gtk_notebook_set_show_tabs (notebook,
|
_sysprof_display_focus_record (SYSPROF_DISPLAY (child));
|
||||||
gtk_notebook_get_n_pages (notebook) > 1);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
#include "sysprof-profiler-assistant.h"
|
#include "sysprof-profiler-assistant.h"
|
||||||
#include "sysprof-proxy-aid.h"
|
#include "sysprof-proxy-aid.h"
|
||||||
#include "sysprof-process-model-row.h"
|
#include "sysprof-process-model-row.h"
|
||||||
|
#include "sysprof-ui-private.h"
|
||||||
|
|
||||||
struct _SysprofProfilerAssistant
|
struct _SysprofProfilerAssistant
|
||||||
{
|
{
|
||||||
@ -314,3 +315,11 @@ sysprof_profiler_assistant_init (SysprofProfilerAssistant *self)
|
|||||||
|
|
||||||
sysprof_environ_editor_set_environ (self->environ_editor, environ);
|
sysprof_environ_editor_set_environ (self->environ_editor, environ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_sysprof_profiler_assistant_focus_record (SysprofProfilerAssistant *self)
|
||||||
|
{
|
||||||
|
g_return_if_fail (SYSPROF_IS_PROFILER_ASSISTANT (self));
|
||||||
|
|
||||||
|
gtk_widget_grab_focus (GTK_WIDGET (self->record_button));
|
||||||
|
}
|
||||||
|
|||||||
@ -21,7 +21,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "sysprof-callgraph-view.h"
|
#include "sysprof-callgraph-view.h"
|
||||||
|
#include "sysprof-display.h"
|
||||||
#include "sysprof-marks-view.h"
|
#include "sysprof-marks-view.h"
|
||||||
|
#include "sysprof-profiler-assistant.h"
|
||||||
#include "sysprof-visualizer-view.h"
|
#include "sysprof-visualizer-view.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
@ -36,18 +38,20 @@ typedef struct
|
|||||||
guint64 avg_count;
|
guint64 avg_count;
|
||||||
} SysprofMarkStat;
|
} SysprofMarkStat;
|
||||||
|
|
||||||
SysprofMarkStat *_sysprof_mark_stat_new (const gchar *name);
|
SysprofMarkStat *_sysprof_mark_stat_new (const gchar *name);
|
||||||
void _sysprof_mark_stat_free (SysprofMarkStat *self);
|
void _sysprof_mark_stat_free (SysprofMarkStat *self);
|
||||||
void _sysprof_marks_view_set_hadjustment (SysprofMarksView *self,
|
void _sysprof_marks_view_set_hadjustment (SysprofMarksView *self,
|
||||||
GtkAdjustment *hadjustment);
|
GtkAdjustment *hadjustment);
|
||||||
void _sysprof_visualizer_view_set_hadjustment (SysprofVisualizerView *self,
|
void _sysprof_visualizer_view_set_hadjustment (SysprofVisualizerView *self,
|
||||||
GtkAdjustment *hadjustment);
|
GtkAdjustment *hadjustment);
|
||||||
void _sysprof_rounded_rectangle (cairo_t *cr,
|
void _sysprof_rounded_rectangle (cairo_t *cr,
|
||||||
const GdkRectangle *rect,
|
const GdkRectangle *rect,
|
||||||
gint x_radius,
|
gint x_radius,
|
||||||
gint y_radius);
|
gint y_radius);
|
||||||
gchar *_sysprof_format_duration (gint64 duration);
|
gchar *_sysprof_format_duration (gint64 duration);
|
||||||
void _sysprof_callgraph_view_set_failed (SysprofCallgraphView *self);
|
void _sysprof_callgraph_view_set_failed (SysprofCallgraphView *self);
|
||||||
|
void _sysprof_display_focus_record (SysprofDisplay *self);
|
||||||
|
void _sysprof_profiler_assistant_focus_record (SysprofProfilerAssistant *self);
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofMarkStat, _sysprof_mark_stat_free)
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofMarkStat, _sysprof_mark_stat_free)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user