mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
new enter_display_mode() function
This commit is contained in:
49
sysprof.c
49
sysprof.c
@ -285,6 +285,8 @@ set_busy (GtkWidget *widget,
|
||||
|
||||
if (cursor)
|
||||
gdk_cursor_unref (cursor);
|
||||
|
||||
gdk_display_flush (gdk_display_get_default());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -632,16 +634,8 @@ fill_lists (Application *app)
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_profile (Application *app)
|
||||
enter_display_mode (Application *app)
|
||||
{
|
||||
if (app->profile)
|
||||
return;
|
||||
|
||||
app->profile = collector_create_profile (app->collector);
|
||||
|
||||
collector_stop (app->collector);
|
||||
collector_reset (app->collector);
|
||||
|
||||
app->state = DISPLAYING;
|
||||
|
||||
update_sensitivity (app);
|
||||
@ -658,6 +652,20 @@ ensure_profile (Application *app)
|
||||
app->inhibit_forced_redraw = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_profile (Application *app)
|
||||
{
|
||||
if (app->profile)
|
||||
return;
|
||||
|
||||
app->profile = collector_create_profile (app->collector);
|
||||
|
||||
collector_stop (app->collector);
|
||||
collector_reset (app->collector);
|
||||
|
||||
enter_display_mode (app);
|
||||
}
|
||||
|
||||
static void
|
||||
on_about_activated (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
@ -817,24 +825,16 @@ set_loaded_profile (Application *app,
|
||||
g_return_if_fail (name != NULL);
|
||||
g_return_if_fail (profile != NULL);
|
||||
|
||||
set_busy (app->main_window, TRUE);
|
||||
collector_stop (app->collector);
|
||||
|
||||
delete_data (app);
|
||||
|
||||
app->state = DISPLAYING;
|
||||
|
||||
app->profile = profile;
|
||||
app->profile_from_file = TRUE;
|
||||
|
||||
fill_lists (app);
|
||||
|
||||
|
||||
set_application_title (app, name);
|
||||
|
||||
update_sensitivity (app);
|
||||
|
||||
collector_stop (app->collector);
|
||||
|
||||
set_busy (app->main_window, FALSE);
|
||||
|
||||
enter_display_mode (app);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1663,14 +1663,17 @@ load_file (gpointer data)
|
||||
|
||||
profile = profile_load (filename, &err);
|
||||
|
||||
set_busy (app->main_window, FALSE);
|
||||
|
||||
if (profile)
|
||||
{
|
||||
set_loaded_profile (app, filename, profile);
|
||||
|
||||
gdk_window_process_all_updates ();
|
||||
set_busy (app->main_window, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_busy (app->main_window, FALSE);
|
||||
|
||||
show_could_not_open (app, filename, err);
|
||||
g_error_free (err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user