* plugins/document-manager/anjuta-document-manager.ui:
[anjuta-git-plugin.git] / src / action-callbacks.c
blob1c2eef7280f3e9b11c7f79800f02f386ee8b77ca
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>
5 *
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 * T
12 his program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifdef HAVE_CONFIG_H
22 # include <config.h>
23 #endif
25 #include <sys/stat.h>
26 #include <unistd.h>
27 #include <signal.h>
28 #include <string.h>
29 #include <sched.h>
30 #include <sys/wait.h>
31 #include <errno.h>
33 #include <gnome.h>
35 #include <libgnomeui/gnome-window-icon.h>
37 #include <libanjuta/anjuta-utils.h>
38 #include <libanjuta/resources.h>
39 #include <libanjuta/interfaces/ianjuta-preferences.h>
41 #include "anjuta-app.h"
42 #include "about.h"
43 #include "action-callbacks.h"
44 #include "anjuta.h"
46 void
47 on_exit1_activate (GtkAction * action, AnjutaApp *app)
49 GdkEvent *event = gdk_event_new (GDK_DELETE);
51 event->any.window = g_object_ref (GTK_WIDGET(app)->window);
52 event->any.send_event = TRUE;
54 gtk_main_do_event (event);
55 gdk_event_free (event);
58 void
59 on_fullscreen_toggle (GtkAction *action, AnjutaApp *app)
61 if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
62 gtk_window_fullscreen (GTK_WINDOW(app));
63 else
64 gtk_window_unfullscreen (GTK_WINDOW(app));
67 void
68 on_layout_lock_toggle (GtkAction *action, AnjutaApp *app)
70 if (app->layout_manager)
71 g_object_set (app->layout_manager->master, "locked",
72 gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)),
73 NULL);
76 void
77 on_reset_layout_activate(GtkAction *action, AnjutaApp *app)
79 anjuta_app_layout_reset (app);
82 void
83 on_set_preferences1_activate (GtkAction * action, AnjutaApp *app)
86 GtkWidget *preferences_dialog;
88 preferences_dialog = anjuta_preferences_get_dialog (app->preferences);
90 /* Install main application preferences */
91 anjuta_app_install_preferences (app);
93 g_signal_connect_swapped (G_OBJECT (preferences_dialog),
94 "response",
95 G_CALLBACK (gtk_widget_destroy),
96 preferences_dialog);
98 gtk_window_set_transient_for (GTK_WINDOW (preferences_dialog),
99 GTK_WINDOW (app));
101 gtk_widget_show (preferences_dialog);
104 static void
105 help_activate (const gchar *doc_id, const gchar *item)
107 if (gnome_help_display_with_doc_id (NULL, doc_id, item, NULL, NULL) == FALSE)
109 anjuta_util_dialog_error (NULL, _("Unable to display help. Please make sure Anjuta documentation package is install. It can be downloaded from http://anjuta.org"));
113 void
114 on_help_manual_activate (GtkAction *action, gpointer data)
116 help_activate ("anjuta-manual", "anjuta-manual.xml");
119 void
120 on_help_tutorial_activate (GtkAction *action, gpointer data)
122 help_activate ("anjuta-tutorial", "anjuta-tutorial.xml");
125 void
126 on_help_advanced_tutorial_activate (GtkAction *action, gpointer data)
128 help_activate ("anjuta-advanced-tutorial", "anjuta-advanced-tutorial.xml");
131 void
132 on_help_faqs_activate (GtkAction *action, gpointer data)
134 help_activate ("anjuta-faqs", "anjuta-faqs.xml");
137 void
138 on_url_home_activate (GtkAction * action, gpointer user_data)
140 anjuta_res_url_show("http://www.anjuta.org");
143 void
144 on_url_bugs_activate (GtkAction * action, gpointer user_data)
146 anjuta_res_url_show("http://bugzilla.gnome.org/simple-bug-guide.cgi");
149 void
150 on_url_faqs_activate (GtkAction * action, gpointer user_data)
152 anjuta_res_url_show("mailto:anjuta-list@lists.sourceforge.net");
155 void
156 on_about_activate (GtkAction * action, gpointer user_data)
158 GtkWidget *about_dlg = about_box_new ();
160 g_signal_connect_swapped(about_dlg, "response",
161 G_CALLBACK(gtk_widget_destroy), about_dlg);
163 gtk_widget_show (about_dlg);