network: Avoid jumping dialogs

The connection editor window is shown before all of its pages are
initialized, causing it to jump when it gets its final size. Avoid
that by not showing it before it is ready.

https://bugzilla.gnome.org/show_bug.cgi?id=693781
This commit is contained in:
Matthias Clasen 2013-04-12 21:18:00 -04:00 committed by Bastien Nocera
parent 3e511ede64
commit eb9c61f3e0
2 changed files with 8 additions and 0 deletions

View file

@ -392,6 +392,9 @@ recheck_initialization (NetConnectionEditor *editor)
notebook = GTK_NOTEBOOK (gtk_builder_get_object (editor->builder, "details_notebook")); notebook = GTK_NOTEBOOK (gtk_builder_get_object (editor->builder, "details_notebook"));
gtk_notebook_set_current_page (notebook, 0); gtk_notebook_set_current_page (notebook, 0);
if (editor->show_when_initialized)
gtk_window_present (GTK_WINDOW (editor->window));
g_idle_add (idle_validate, editor); g_idle_add (idle_validate, editor);
} }
@ -930,6 +933,10 @@ net_connection_editor_new (GtkWindow *parent_window,
void void
net_connection_editor_present (NetConnectionEditor *editor) net_connection_editor_present (NetConnectionEditor *editor)
{ {
if (!editor_is_initialized (editor)) {
editor->show_when_initialized = TRUE;
return;
}
gtk_window_present (GTK_WINDOW (editor->window)); gtk_window_present (GTK_WINDOW (editor->window));
} }

View file

@ -66,6 +66,7 @@ struct _NetConnectionEditor
NMClientPermissionResult can_modify; NMClientPermissionResult can_modify;
gboolean title_set; gboolean title_set;
gboolean show_when_initialized;
}; };
struct _NetConnectionEditorClass struct _NetConnectionEditorClass