1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) 2000 Naba Kumar <naba@gnome.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include <libanjuta/resources.h>
33 #include "anjuta-app.h"
34 #include "anjuta-callbacks.h"
39 build_msg_save_real (void)
44 filename
= fileselection_get_filename (app
->save_as_build_msg_sel
);
45 msgfile
= fopen(filename
, "w");
48 anjuta_error (_("Could not open file for writing"));
52 an_message_manager_save_build(app
->messages
, msgfile
);
60 on_build_msg_save_ok_clicked(GtkButton
* button
, gpointer user_data
)
64 filename
= fileselection_get_filename (app
->save_as_build_msg_sel
);
65 if (file_is_regular (filename
))
68 dialog
= gtk_message_dialog_new (GTK_WINDOW (app
),
69 GTK_DIALOG_DESTROY_WITH_PARENT
,
72 _("The file '%s' already exists.\n"
73 "Do you want to replace it with the one you are saving?."),
75 gtk_dialog_add_button (GTK_DIALOG (dialog
),
78 anjuta_dialog_add_button (GTK_DIALOG (dialog
),
82 if (gtk_dialog_run (GTK_DIALOG (dialog
)) == GTK_RESPONSE_YES
)
83 build_msg_save_real ();
84 gtk_widget_destroy (dialog
);
87 build_msg_save_real ();
92 on_build_msg_save_cancel_clicked(GtkButton
* button
, gpointer user_data
)
94 gtk_widget_hide (app
->save_as_build_msg_sel
);
95 closing_state
= FALSE
;
99 on_anjuta_progress_cancel (gpointer data
)
101 app
->in_progress
= FALSE
;
102 app
->progress_cancel_cb (data
);
107 on_anjuta_progress_cb (gpointer data
)
109 return (app
->progress_value
);