1 /* wavbreaker - A tool to split a wave file up into multiple waves.
2 * Copyright (C) 2002-2006 Timothy Robinson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #include <gtk/gtk.h>
20 #include "wavbreaker.h"
21
22 #include "gettext.h"
23
reallyquit_show(GtkWidget * main_window)24 void reallyquit_show(GtkWidget *main_window)
25 {
26 GtkMessageDialog *dialog;
27 gint result;
28 const gchar *message = _("Quit wavbreaker?");
29 const gchar *info_text = _("If you quit wavbreaker now, any unsaved chunks will be lost.");
30
31 if( main_window == NULL) {
32 main_window = wavbreaker_get_main_window();
33 }
34
35 dialog = (GtkMessageDialog*)gtk_message_dialog_new( GTK_WINDOW(main_window),
36 GTK_DIALOG_DESTROY_WITH_PARENT,
37 GTK_MESSAGE_QUESTION,
38 GTK_BUTTONS_YES_NO,
39 "%s", message);
40
41
42 gtk_window_set_title( GTK_WINDOW(dialog), message);
43 gtk_message_dialog_format_secondary_text( dialog, "%s", info_text);
44
45 result = gtk_dialog_run( GTK_DIALOG(dialog));
46 switch( result) {
47 case GTK_RESPONSE_YES:
48 wavbreaker_quit();
49 break;
50 default:
51 gtk_widget_destroy( GTK_WIDGET( dialog));
52 break;
53 }
54 }
55
56