[Frugalware-darcs] fw-control-center: gnetconfig: pre_up/down post_up/downs can now be added.

Priyank priyank at frugalware.org
Wed Jun 20 18:56:03 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=fw-control-center;a=darcs_commitdiff;h=20070620165204-5ce2c-11ef3eb21eb47327d6943ec6ea4f4518b12d96d6.gz;

[gnetconfig: pre_up/down post_up/downs can now be added.
Priyank <priyank at frugalware.org>**20070620165204] {
hunk ./gnetconfig/src/gnetconfig-interface.c 67
+GtkWidget *gn_iflabel;
hunk ./gnetconfig/src/gnetconfig-interface.c 142
+	gn_iflabel		= glade_xml_get_widget(xml, "fwn_interface_label");
hunk ./gnetconfig/src/gnetconfig-interface.c 746
+		/* set the interface name label */
+		markup = g_markup_printf_escaped ("<span size=\"medium\"><b>%s</b></span>", inte->name);
+		gtk_label_set_markup (GTK_LABEL(data), markup);
+		g_free (markup);
+
hunk ./gnetconfig/src/gnetconfig-interface.c 849
-		/* set the interface name label */
-		markup = g_markup_printf_escaped ("<span size=\"medium\"><b>%s</b></span>", inte->name);
-		gtk_label_set_markup (GTK_LABEL(data), markup);
-		g_free (markup);
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 40
+extern GtkWidget		*gn_iflabel;
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 47
+static fwnet_interface_t *gnetconfig_get_active_interface (void);
+
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 203
+static fwnet_interface_t *
+gnetconfig_get_active_interface (void)
+{
+	fwnet_interface_t	*inf = NULL;
+	GList				*iflist = NULL;
+	gchar				*name = NULL;
+
+	name = (gchar*)gtk_label_get_text (GTK_LABEL(gn_iflabel));
+	for (iflist = active_profile->interfaces; iflist != NULL; iflist = g_list_next(iflist))
+	{
+		inf = iflist->data;
+		if (strcmp(name, inf->name) == 0)
+			break;
+	}
+
+	return inf;
+}
+
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 226
+	fwnet_interface_t	*ift;
+	char				*command;
+	gint				res;
+
+	ift	= gnetconfig_get_active_interface ();
+	up:command = gn_input ("Gnetconfig", _("Enter the name of the command:"), &res);
+	if (res == GTK_RESPONSE_ACCEPT)
+	{
+		if (!command || !strlen(command))
+		{	
+			gn_error ("Required field cannot be blank. Please provide a valid command name.");
+			goto up;
+		}
+		ift->pre_ups = g_list_append (ift->pre_ups, (gpointer)strdup(command));
+		gnetconfig_save_profile (active_profile);
+		gnetconfig_populate_opts (ift);
+		g_free (command);
+	}
+
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 257
+	fwnet_interface_t	*ift;
+	char				*command;
+	gint				res;
+
+	ift	= gnetconfig_get_active_interface ();
+	up:command = gn_input ("Gnetconfig", _("Enter the name of the command:"), &res);
+	if (res == GTK_RESPONSE_ACCEPT)
+	{
+		if (!command || !strlen(command))
+		{	
+			gn_error ("Required field cannot be blank. Please provide a valid command name.");
+			goto up;
+		}
+		ift->pre_downs = g_list_append (ift->pre_downs, (gpointer)strdup(command));
+		gnetconfig_save_profile (active_profile);
+		gnetconfig_populate_opts (ift);
+		g_free (command);
+	}
+
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 288
+	fwnet_interface_t	*ift;
+	char				*command;
+	gint				res;
+
+	ift	= gnetconfig_get_active_interface ();
+	up:command = gn_input ("Gnetconfig", _("Enter the name of the command:"), &res);
+	if (res == GTK_RESPONSE_ACCEPT)
+	{
+		if (!command || !strlen(command))
+		{	
+			gn_error ("Required field cannot be blank. Please provide a valid command name.");
+			goto up;
+		}
+		ift->post_ups = g_list_append (ift->post_ups, (gpointer)strdup(command));
+		gnetconfig_save_profile (active_profile);
+		gnetconfig_populate_opts (ift);
+		g_free (command);
+	}
+
hunk ./gnetconfig/src/gnetconfig-interface_opts.c 319
+	fwnet_interface_t	*ift;
+	char				*command;
+	gint				res;
+
+	ift	= gnetconfig_get_active_interface ();
+	up:command = gn_input ("Gnetconfig", _("Enter the name of the command:"), &res);
+	if (res == GTK_RESPONSE_ACCEPT)
+	{
+		if (!command || !strlen(command))
+		{	
+			gn_error ("Required field cannot be blank. Please provide a valid command name.");
+			goto up;
+		}
+		ift->post_downs = g_list_append (ift->post_downs, (gpointer)strdup(command));
+		gnetconfig_save_profile (active_profile);
+		gnetconfig_populate_opts (ift);
+		g_free (command);
+	}
+
}


More information about the Frugalware-darcs mailing list