SF.net SVN: geany:[5416] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Thu Nov 18 17:51:16 UTC 2010


Revision: 5416
          http://geany.svn.sourceforge.net/geany/?rev=5416&view=rev
Author:   ntrel
Date:     2010-11-18 17:51:15 +0000 (Thu, 18 Nov 2010)

Log Message:
-----------
Don't change default build command entry color when cancelling
label editing.
Make dialogs_show_input() return NULL when cancelled.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/build.c
    trunk/src/callbacks.c
    trunk/src/dialogs.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-11-18 16:25:11 UTC (rev 5415)
+++ trunk/ChangeLog	2010-11-18 17:51:15 UTC (rev 5416)
@@ -5,6 +5,10 @@
    command label.
    Add 'parent' argument to some dialogs_show_input*() functions because
    the dialog parent may not always be the main window.
+ * src/build.c, src/dialogs.c, src/callbacks.c:
+   Don't change default build command entry color when cancelling
+   label editing.
+   Make dialogs_show_input() return NULL when cancelled.
 
 
 2010-11-17  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c	2010-11-18 16:25:11 UTC (rev 5415)
+++ trunk/src/build.c	2010-11-18 17:51:15 UTC (rev 5416)
@@ -1822,6 +1822,9 @@
 	gchar *str = dialogs_show_input(_("Set menu item label"),
 		NULL, NULL, old);
 
+	if (!str)
+		return;
+
 	gtk_button_set_label(GTK_BUTTON(wid), str);
 	g_free(str);
 	r->used_dst = TRUE;

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2010-11-18 16:25:11 UTC (rev 5415)
+++ trunk/src/callbacks.c	2010-11-18 17:51:15 UTC (rev 5416)
@@ -1437,11 +1437,12 @@
 		format = ui_prefs.custom_date_format;
 	else
 	{
-		setptr(ui_prefs.custom_date_format,
-			dialogs_show_input(_("Custom Date Format"), GTK_WINDOW(main_widgets.window),
+		gchar *str = dialogs_show_input(_("Custom Date Format"), GTK_WINDOW(main_widgets.window),
 				_("Enter here a custom date and time format. "
 				"You can use any conversion specifiers which can be used with the ANSI C strftime function."),
-				ui_prefs.custom_date_format));
+				ui_prefs.custom_date_format);
+		if (str)
+			setptr(ui_prefs.custom_date_format, str);
 		return;
 	}
 

Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c	2010-11-18 16:25:11 UTC (rev 5415)
+++ trunk/src/dialogs.c	2010-11-18 17:51:15 UTC (rev 5416)
@@ -1032,13 +1032,13 @@
 }
 
 
-/* Returns: newly allocated string - a copy of either the entry text or default_text. */
+/* Returns: new copy of user input or NULL if cancelled. */
 gchar *dialogs_show_input(const gchar *title, GtkWindow *parent, const gchar *label_text,
 	const gchar *default_text)
 {
 	dialog_input = NULL;
 	dialogs_show_input_full(title, parent, label_text, default_text, FALSE, on_dialog_input, NULL);
-	return NVL(dialog_input, g_strdup(default_text));
+	return dialog_input;
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list