static void recheck_initialization (NMConnectionEditor *editor) { GtkNotebook *notebook; if (!editor_is_initialized (editor) || editor->init_run) return; editor->init_run = TRUE; populate_connection_ui (editor); /* Show the second page (the connection-type-specific data) first */ notebook = GTK_NOTEBOOK (gtk_builder_get_object (editor->builder, "notebook")); gtk_notebook_set_current_page (notebook, 1); /* When everything is initialized, re-present the window to ensure it's on top */ nm_connection_editor_present (editor); /* Validate the connection from an idle handler to ensure that stuff like * GtkFileChoosers have had a chance to asynchronously find their files. */ if (editor->validate_id) g_source_remove (editor->validate_id); editor->validate_id = g_idle_add (idle_validate, editor); }
void nm_connection_editor_run (NMConnectionEditor *self) { g_return_if_fail (NM_IS_CONNECTION_EDITOR (self)); g_signal_connect (G_OBJECT (self->window), "delete-event", G_CALLBACK (editor_closed_cb), self); g_signal_connect (G_OBJECT (self->ok_button), "clicked", G_CALLBACK (ok_button_clicked_cb), self); g_signal_connect (G_OBJECT (self->cancel_button), "clicked", G_CALLBACK (cancel_button_clicked_cb), self); g_signal_connect (G_OBJECT (self->export_button), "clicked", G_CALLBACK (export_button_clicked_cb), self); nm_connection_editor_present (self); }
static void edit_connection (NMConnectionList *list, NMConnection *connection) { NMConnectionEditor *editor; g_return_if_fail (connection != NULL); /* Don't allow two editors for the same connection */ editor = nm_connection_editor_get (connection); if (editor) { nm_connection_editor_present (editor); return; } editor = nm_connection_editor_new (GTK_WINDOW (list->dialog), NM_CONNECTION (connection), list->nm_client, list->settings); g_signal_connect (editor, "done", G_CALLBACK (edit_done_cb), list); nm_connection_editor_run (editor); }