static void iface_state_changed (OobsIface *iface, gpointer user_data) { GtkTreeModel *model; GtkTreeIter iter; OobsIface *model_iface; gboolean valid, found; found = FALSE; model = GST_NETWORK_TOOL (tool)->interfaces_model; valid = gtk_tree_model_get_iter_first (model, &iter); while (valid && !found) { gtk_tree_model_get (model, &iter, COL_OBJECT, &model_iface, -1); if (iface == model_iface) { ifaces_model_modify_interface_at_iter (&iter); found = TRUE; } g_object_unref (iface); valid = gtk_tree_model_iter_next (model, &iter); } }
static void accept_connection_dialog (GstTool *tool) { GstConnectionDialog *dialog; GtkTreeSelection *selection; GtkTreeIter iter; dialog = GST_NETWORK_TOOL (tool)->dialog; connection_dialog_hide (dialog); if (dialog->changed) { connection_save (dialog); selection = gtk_tree_view_get_selection (GST_NETWORK_TOOL (tool)->interfaces_list); if (gtk_tree_selection_get_selected (selection, NULL, &iter)) { ifaces_model_modify_interface_at_iter (&iter); g_signal_emit_by_name (G_OBJECT (selection), "changed"); } gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config), _("Changing interface configuration"), on_configuration_changed, tool); } g_object_unref (dialog->iface); if (dialog->standalone) gtk_main_quit (); }
static void ifaces_model_set_interface_at_iter (OobsIface *iface, GtkTreeIter *iter, gboolean show_name) { GtkTreeModel *model; g_return_if_fail (iface != NULL); model = GST_NETWORK_TOOL (tool)->interfaces_model; gtk_list_store_set (GTK_LIST_STORE (model), iter, COL_OBJECT, iface, COL_SHOW_IFACE_NAME, show_name, -1); ifaces_model_modify_interface_at_iter (iter); }
void on_iface_toggled (GtkCellRendererToggle *renderer, gchar *path_str, gpointer data) { GtkTreePath *path; GtkTreeModel *model = GTK_TREE_MODEL (data); GtkTreeIter iter; gboolean active, inconsistent; OobsIface *iface; path = gtk_tree_path_new_from_string (path_str); if (gtk_tree_model_get_iter (model, &iter, path)) { gtk_tree_model_get (model, &iter, COL_ACTIVE, &active, COL_INCONSISTENT, &inconsistent, COL_OBJECT, &iface, -1); if (!inconsistent) { active ^= 1; oobs_iface_set_active (iface, active); oobs_iface_set_auto (iface, active); ifaces_model_modify_interface_at_iter (&iter); gst_tool_commit_async (tool, OOBS_OBJECT (GST_NETWORK_TOOL (tool)->ifaces_config), _("Changing interface configuration"), on_configuration_changed, tool); } g_object_unref (iface); } gtk_tree_path_free (path); }