Revision: 375 Author: eht16 Date: 2006-05-30 08:27:38 -0700 (Tue, 30 May 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=375&view=rev
Log Message: ----------- Removed unneeded function dialogs_show_fifo_error(), fixed small memory leak in dialogs_show_question()
Modified Paths: -------------- trunk/src/dialogs.c trunk/src/dialogs.h trunk/src/main.c Modified: trunk/src/dialogs.c =================================================================== --- trunk/src/dialogs.c 2006-05-29 21:49:56 UTC (rev 374) +++ trunk/src/dialogs.c 2006-05-30 15:27:38 UTC (rev 375) @@ -225,7 +225,7 @@ }
-/// TODO is there a difference to dialogs_show_question? if not, remove this one +/// TODO replace by dialogs_show_question gboolean dialogs_show_not_found(const gchar *text) { GtkWidget *dialog; @@ -276,28 +276,6 @@ }
-/// TODO is there a difference to dialogs_show_question? if not, remove this one -gboolean dialogs_show_fifo_error(const gchar *text, ...) -{ - GtkWidget *dialog; - gchar string[300]; - gint ret; - va_list args; - - va_start(args, text); - g_vsnprintf(string, 299, text, args); - va_end(args); - - dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, string); - ret = gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - - if (ret == GTK_RESPONSE_YES) return TRUE; - else return FALSE; -} - - void dialogs_show_error(const gchar *text, ...) { #ifndef GEANY_WIN32 @@ -1271,6 +1249,7 @@ }
+/// TODO remove this function and use dialogs_show_question instead gboolean dialogs_show_mkcfgdir_error(gint error_nr) { GtkWidget *dialog; @@ -1837,12 +1816,13 @@ va_end(args);
#ifdef GEANY_WIN32 - if (MessageBox(NULL, string, _("Question"), MB_YESNO | MB_ICONWARNING) == IDYES) return TRUE; - else return FALSE; + if (MessageBox(NULL, string, _("Question"), MB_YESNO | MB_ICONWARNING) == IDYES) + ret = TRUE; #else dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, string); - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) ret = TRUE; + if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) + ret = TRUE; gtk_widget_destroy(dialog); #endif g_free(string);
Modified: trunk/src/dialogs.h =================================================================== --- trunk/src/dialogs.h 2006-05-29 21:49:56 UTC (rev 374) +++ trunk/src/dialogs.h 2006-05-30 15:27:38 UTC (rev 375) @@ -42,8 +42,6 @@
void dialogs_show_error(const gchar *text, ...);
-gboolean dialogs_show_fifo_error(const gchar *text, ...); - gboolean dialogs_show_unsaved_file(gint idx);
/* This shows the font selection dialog to choose a font. */
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2006-05-29 21:49:56 UTC (rev 374) +++ trunk/src/main.c 2006-05-30 15:27:38 UTC (rev 375) @@ -386,7 +386,7 @@ } else { - if (dialogs_show_fifo_error(_("Geany is exiting because a named pipe was found. Mostly this means, Geany is already running. If you know Geany is not running, you can delete the file and start Geany anyway.\nDelete the named pipe and start Geany?"))) + if (dialogs_show_question(_("Geany is exiting because a named pipe was found. Mostly this means, Geany is already running. If you know Geany is not running, you can delete the file and start Geany anyway.\nDelete the named pipe and start Geany?"))) { unlink(fifo_name); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.