diff --git a/src/dialogs.c b/src/dialogs.c index 162b78a8..9365e36f 100644 --- a/src/dialogs.c +++ b/src/dialogs.c @@ -225,7 +225,7 @@ void dialogs_show_file_open_error(void) } -/// 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 @@ void dialogs_show_info(const gchar *text, ...) } -/// 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 @@ GtkWidget *dialogs_add_file_open_extra_widget(void) } +/// TODO remove this function and use dialogs_show_question instead gboolean dialogs_show_mkcfgdir_error(gint error_nr) { GtkWidget *dialog; @@ -1837,12 +1816,13 @@ gboolean dialogs_show_question(const gchar *text, ...) 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); diff --git a/src/dialogs.h b/src/dialogs.h index 679a1ae1..65d40592 100644 --- a/src/dialogs.h +++ b/src/dialogs.h @@ -42,8 +42,6 @@ void dialogs_show_info(const gchar *text, ...); 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. */ diff --git a/src/main.c b/src/main.c index 8ddcdd15..dccd8943 100644 --- a/src/main.c +++ b/src/main.c @@ -386,7 +386,7 @@ static void create_fifo(gint argc, gchar **argv, const gchar *config_dir) } 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); }