Updated Spanish translation
[anjuta-git-plugin.git] / src / anjuta-callbacks.c
blob6e317715c5c38e68674da2d9ac46d0c8255d5f6f
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 anjuta-callbacks.c
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifdef HAVE_CONFIG_H
21 # include <config.h>
22 #endif
24 #include <sys/stat.h>
25 #include <unistd.h>
26 #include <signal.h>
27 #include <string.h>
29 #include <gnome.h>
31 #include <libanjuta/resources.h>
33 #include "anjuta-app.h"
34 #include "anjuta-callbacks.h"
36 #if 0
38 static void
39 build_msg_save_real (void)
41 gchar *filename;
42 FILE *msgfile;
44 filename = fileselection_get_filename (app->save_as_build_msg_sel);
45 msgfile = fopen(filename, "w");
46 if (! msgfile)
48 anjuta_error (_("Could not open file for writing"));
49 return;
52 an_message_manager_save_build(app->messages, msgfile);
54 fclose(msgfile);
56 return;
59 void
60 on_build_msg_save_ok_clicked(GtkButton * button, gpointer user_data)
62 gchar *filename;
64 filename = fileselection_get_filename (app->save_as_build_msg_sel);
65 if (file_is_regular (filename))
67 GtkWidget *dialog;
68 dialog = gtk_message_dialog_new (GTK_WINDOW (app),
69 GTK_DIALOG_DESTROY_WITH_PARENT,
70 GTK_MESSAGE_QUESTION,
71 GTK_BUTTONS_NONE,
72 _("The file '%s' already exists.\n"
73 "Do you want to replace it with the one you are saving?."),
74 filename);
75 gtk_dialog_add_button (GTK_DIALOG (dialog),
76 GTK_STOCK_CANCEL,
77 GTK_RESPONSE_CANCEL);
78 anjuta_dialog_add_button (GTK_DIALOG (dialog),
79 _("_Replace"),
80 GTK_STOCK_REFRESH,
81 GTK_RESPONSE_YES);
82 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)
83 build_msg_save_real ();
84 gtk_widget_destroy (dialog);
86 else
87 build_msg_save_real ();
88 g_free (filename);
91 void
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;
98 void
99 on_anjuta_progress_cancel (gpointer data)
101 app->in_progress = FALSE;
102 app->progress_cancel_cb (data);
103 return;
106 gdouble
107 on_anjuta_progress_cb (gpointer data)
109 return (app->progress_value);
111 #endif