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 user_toggled_cb (GtkCellRendererToggle *renderer, gchar *path, gpointer user_data) { GstSharesTool *tool; GtkWidget *table; GtkTreeModel *model; GtkTreeIter iter; OobsUser *user; gboolean active; tool = GST_SHARES_TOOL (user_data); table = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "users_table"); model = gtk_tree_view_get_model (GTK_TREE_VIEW (table)); if (! gtk_tree_model_get_iter_from_string (model, &iter, path)) return; gtk_tree_model_get (model, &iter, COL_ACTIVE, &active, COL_USER, &user, -1); /* we want to invert the state */ active ^= 1; if (!active) { oobs_smb_config_delete_user_password (OOBS_SMB_CONFIG (tool->smb_config), user); } else { GtkWidget *dialog; gint response; dialog = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "smb_password_dialog"); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (GST_TOOL (tool)->main_dialog)); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_hide (dialog); if (response == GTK_RESPONSE_OK) { GtkWidget *entry; const gchar *password; entry = gst_dialog_get_widget (GST_TOOL (tool)->main_dialog, "smb_password_entry"); password = gtk_entry_get_text (GTK_ENTRY (entry)); oobs_smb_config_set_user_password (OOBS_SMB_CONFIG (tool->smb_config), user, password); } } active = oobs_smb_config_user_has_password (OOBS_SMB_CONFIG (tool->smb_config), user); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_ACTIVE, active, -1); g_object_unref (user); gst_tool_commit_async (GST_TOOL (tool), tool->smb_config, NULL, NULL, NULL); }
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); }