[Frugalware-darcs] fw-control-center: gnetconfig: new function gn_message()

Priyank priyank at frugalware.org
Sun Jun 10 21:07:18 CEST 2007


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

[gnetconfig: new function gn_message()
Priyank <priyank at frugalware.org>**20070610190604
 * Replace question dialogs with calls to gn_message()
] {
hunk ./gnetconfig/src/gnetconfig-interface.c 578
-		GtkWidget *ask = gtk_message_dialog_new (GTK_WINDOW(gn_main_window),
-							GTK_DIALOG_DESTROY_WITH_PARENT,
-							GTK_MESSAGE_QUESTION,
-							GTK_BUTTONS_YES_NO,
-							"%s",
-							_("Are you sure you want to delete this profile ?"));
-		switch ( gtk_dialog_run(GTK_DIALOG(ask)) )
+		switch ( gn_question (_("Are you sure you want to delete this profile ?")) )
hunk ./gnetconfig/src/gnetconfig-interface.c 595
-		gtk_widget_destroy (ask);
hunk ./gnetconfig/src/gnetconfig-interface.c 860
+	if (gn_question (_("Are you sure you want to delete this interface ?")) == GTK_RESPONSE_NO)
+		return;
+
hunk ./gnetconfig/src/gnetconfig-messages.c 72
+
+gint
+gn_question (const char *message_str)
+{
+	GtkWidget 	*dialog;
+	gint 		ret;
+
+	dialog = gtk_message_dialog_new (GTK_WINDOW(gn_main_window),
+					GTK_DIALOG_DESTROY_WITH_PARENT,
+					GTK_MESSAGE_QUESTION,
+					GTK_BUTTONS_YES_NO,
+					"%s",
+					message_str);
+	gtk_window_set_resizable (GTK_WINDOW(dialog), FALSE), 
+	ret = gtk_dialog_run (GTK_DIALOG(dialog));
+	gtk_widget_destroy (dialog);
+
+	return ret;
+}
+
hunk ./gnetconfig/src/gnetconfig-messages.h 17
-	ERROR_GUI			/* Display error on gui */
+	ERROR_GUI		/* Display error on gui */
hunk ./gnetconfig/src/gnetconfig-messages.h 24
+gint gn_question (const char *);
+
}


More information about the Frugalware-darcs mailing list