Added Spanish translation
[anjuta.git] / src / action-callbacks.c
blob050c68292f3679418f82b8b012badcd02415cfdc
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * mainmenu_callbacks.c
4 * Copyright (C) 2003 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>
28 #include <sched.h>
29 #include <sys/wait.h>
30 #include <errno.h>
32 #include <libanjuta/anjuta-utils.h>
33 #include <libanjuta/resources.h>
34 #include <libanjuta/interfaces/ianjuta-preferences.h>
36 #include "anjuta-window.h"
37 #include "about.h"
38 #include "action-callbacks.h"
39 #include "anjuta-application.h"
41 #define TOOLBAR_VISIBLE "toolbar-visible"
43 void
44 on_exit_activate (GtkAction * action, AnjutaWindow *win)
46 GdkEvent *event = gdk_event_new (GDK_DELETE);
48 event->any.window = g_object_ref (gtk_widget_get_window (GTK_WIDGET(win)));
49 event->any.send_event = TRUE;
51 gtk_main_do_event (event);
52 gdk_event_free (event);
55 void
56 on_fullscreen_toggle (GtkAction *action, AnjutaWindow *win)
58 if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
59 gtk_window_fullscreen (GTK_WINDOW(win));
60 else
61 gtk_window_unfullscreen (GTK_WINDOW(win));
64 void
65 on_layout_lock_toggle (GtkAction *action, AnjutaWindow *win)
67 if (win->layout_manager)
68 g_object_set (gdl_dock_layout_get_master (win->layout_manager), "locked",
69 gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)),
70 NULL);
73 void
74 on_reset_layout_activate(GtkAction *action, AnjutaWindow *win)
76 anjuta_window_layout_reset (win);
79 void
80 on_toolbar_view_toggled (GtkAction *action, AnjutaWindow *win)
82 gboolean status = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action));
83 if (status)
85 gtk_widget_show (win->toolbar);
87 else
89 gtk_widget_hide (win->toolbar);
91 g_settings_set_boolean (win->settings,
92 TOOLBAR_VISIBLE,
93 status);
96 void
97 on_preferences_activate (GtkAction * action, AnjutaWindow *win)
100 GtkWidget *preferences_dialog;
102 if (anjuta_preferences_is_dialog_created (win->preferences))
104 gtk_window_present (GTK_WINDOW (anjuta_preferences_get_dialog (win->preferences)));
105 return;
107 preferences_dialog = anjuta_preferences_get_dialog (win->preferences);
109 /* Install main application preferences */
110 anjuta_window_install_preferences (win);
112 g_signal_connect_swapped (G_OBJECT (preferences_dialog),
113 "response",
114 G_CALLBACK (gtk_widget_destroy),
115 preferences_dialog);
117 gtk_window_set_transient_for (GTK_WINDOW (preferences_dialog),
118 GTK_WINDOW (win));
120 gtk_widget_show (preferences_dialog);
123 void
124 on_help_manual_activate (GtkAction *action, gpointer data)
126 anjuta_util_help_display (GTK_WIDGET (data), "anjuta-manual", NULL);
129 void
130 on_help_faqs_activate (GtkAction *action, gpointer data)
132 anjuta_util_help_display (GTK_WIDGET (data), "anjuta-faqs", NULL);
135 void
136 on_url_home_activate (GtkAction * action, gpointer user_data)
138 anjuta_res_url_show("http://www.anjuta.org");
141 void
142 on_url_bugs_activate (GtkAction * action, gpointer user_data)
144 anjuta_res_url_show("https://bugzilla.gnome.org/enter_bug.cgi?product=anjuta");
147 void
148 on_url_faqs_activate (GtkAction * action, gpointer user_data)
150 anjuta_res_url_show("mailto:anjuta-list@gnome.org");
153 void
154 on_about_activate (GtkAction * action, AnjutaWindow *win)
156 GtkWidget *about_dlg = about_box_new (GTK_WINDOW (win));
158 g_signal_connect_swapped(about_dlg, "response",
159 G_CALLBACK(gtk_widget_destroy), about_dlg);
161 gtk_widget_show (about_dlg);