Commit 364cbdd7 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

Added Ctrl+Q to close all windows

[bug #654496, new feature]
parent f01a9f27
......@@ -823,7 +823,7 @@ extensions__dlg_preferences_apply (GtkWidget *dialog,
gtk_widget_destroy (dialog);
if (response == GTK_RESPONSE_OK)
gth_restart ();
gth_quit (TRUE);
}
g_slist_foreach (active_extensions, (GFunc) g_free, NULL);
......
......@@ -50,6 +50,7 @@ static const char *fixed_ui_info =
" </menu>"
" <placeholder name='Misc_Actions'/>"
" <separator/>"
" <menuitem action='File_Quit'/>"
" <menuitem action='File_CloseWindow'/>"
" </menu>"
" <menu name='Edit' action='EditMenu'>"
......
......@@ -21,6 +21,8 @@
#include <config.h>
#include "gth-window.h"
#include "main.h"
void
gth_window_activate_action_file_close_window (GtkAction *action,
......@@ -28,3 +30,11 @@ gth_window_activate_action_file_close_window (GtkAction *action,
{
gth_window_close ((GthWindow*)data);
}
void
gth_window_activate_action_file_quit_application (GtkAction *action,
gpointer data)
{
gth_quit (FALSE);
}
......@@ -27,5 +27,6 @@
#define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
DEFINE_ACTION(gth_window_activate_action_file_close_window)
DEFINE_ACTION(gth_window_activate_action_file_quit_application)
#endif /* GTH_WINDOW_ACTIONS_CALLBACK_H */
......@@ -30,7 +30,12 @@ static GtkActionEntry gth_window_action_entries[] = {
{ "File_CloseWindow", GTK_STOCK_CLOSE,
NULL, NULL,
N_("Close this window"),
G_CALLBACK (gth_window_activate_action_file_close_window) }
G_CALLBACK (gth_window_activate_action_file_close_window) },
{ "File_Quit", GTK_STOCK_QUIT,
N_("Close _All Windows"), NULL,
NULL,
G_CALLBACK (gth_window_activate_action_file_quit_application) }
};
static guint gth_window_action_entries_size = G_N_ELEMENTS (gth_window_action_entries);
......
......@@ -63,7 +63,7 @@ static UniqueApp *gthumb_app;
#endif
static char **remaining_args;
static const char *program_argv0; /* argv[0] from main(); used as the command to restart the program */
static gboolean restart = FALSE;
static gboolean Restart = FALSE;
static gboolean version = FALSE;
......@@ -579,7 +579,7 @@ main (int argc, char *argv[])
gth_main_release ();
gth_pref_release ();
if (restart)
if (Restart)
g_spawn_command_line_async (program_argv0, NULL);
return 0;
......@@ -587,7 +587,7 @@ main (int argc, char *argv[])
void
gth_restart (void)
gth_quit (gboolean restart)
{
GList *windows;
GList *scan;
......@@ -597,5 +597,5 @@ gth_restart (void)
gth_window_close (GTH_WINDOW (scan->data));
g_list_free (windows);
restart = TRUE;
Restart = restart;
}
......@@ -33,7 +33,7 @@ extern gboolean ImportPhotos;
extern int ClutterInitResult;
#endif
void gth_restart (void);
void gth_quit (gboolean restart);
G_END_DECLS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment