Kaydet (Commit) 554f1b05 authored tarafından Nick Treleaven's avatar Nick Treleaven

Don't change default build command entry color when cancelling

label editing.
Make dialogs_show_input() return NULL when cancelled.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5416 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 63df228c
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
command label. command label.
Add 'parent' argument to some dialogs_show_input*() functions because Add 'parent' argument to some dialogs_show_input*() functions because
the dialog parent may not always be the main window. 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> 2010-11-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
...@@ -1822,6 +1822,9 @@ static void on_label_button_clicked(GtkWidget *wid, gpointer user_data) ...@@ -1822,6 +1822,9 @@ static void on_label_button_clicked(GtkWidget *wid, gpointer user_data)
gchar *str = dialogs_show_input(_("Set menu item label"), gchar *str = dialogs_show_input(_("Set menu item label"),
NULL, NULL, old); NULL, NULL, old);
if (!str)
return;
gtk_button_set_label(GTK_BUTTON(wid), str); gtk_button_set_label(GTK_BUTTON(wid), str);
g_free(str); g_free(str);
r->used_dst = TRUE; r->used_dst = TRUE;
......
...@@ -1437,11 +1437,12 @@ on_insert_date_activate (GtkMenuItem *menuitem, ...@@ -1437,11 +1437,12 @@ on_insert_date_activate (GtkMenuItem *menuitem,
format = ui_prefs.custom_date_format; format = ui_prefs.custom_date_format;
else else
{ {
setptr(ui_prefs.custom_date_format, gchar *str = dialogs_show_input(_("Custom Date Format"), GTK_WINDOW(main_widgets.window),
dialogs_show_input(_("Custom Date Format"), GTK_WINDOW(main_widgets.window),
_("Enter here a custom date and time format. " _("Enter here a custom date and time format. "
"You can use any conversion specifiers which can be used with the ANSI C strftime function."), "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; return;
} }
......
...@@ -1032,13 +1032,13 @@ static void on_dialog_input(const gchar *str) ...@@ -1032,13 +1032,13 @@ static void on_dialog_input(const gchar *str)
} }
/* 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, gchar *dialogs_show_input(const gchar *title, GtkWindow *parent, const gchar *label_text,
const gchar *default_text) const gchar *default_text)
{ {
dialog_input = NULL; dialog_input = NULL;
dialogs_show_input_full(title, parent, label_text, default_text, FALSE, on_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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment