[Xfce4-commits] <terminal:master> Remove the custom accelerator code.
Nick Schermer
noreply at xfce.org
Sat Dec 22 22:22:03 CET 2012
Updating branch refs/heads/master
to 5d125a0f991a7ec8df750924875892796aba9bfd (commit)
from d7de42b139b3359fcb4770f79125b306d5250e13 (commit)
commit 5d125a0f991a7ec8df750924875892796aba9bfd
Author: Nick Schermer <nick at xfce.org>
Date: Fri Dec 21 18:16:49 2012 +0100
Remove the custom accelerator code.
Have not restored the Alt+N bindings.
po/POTFILES.in | 2 -
terminal/Makefile.am | 4 -
terminal/terminal-accel-map.c | 207 -------------
terminal/terminal-accel-map.h | 47 ---
terminal/terminal-app.c | 50 +++-
terminal/terminal-preferences-dialog.c | 9 -
terminal/terminal-preferences.c | 319 --------------------
terminal/terminal-shortcut-editor.c | 517 --------------------------------
terminal/terminal-shortcut-editor.h | 47 ---
terminal/terminal-window.c | 24 +-
xfce4-terminal.glade | 43 +---
11 files changed, 56 insertions(+), 1213 deletions(-)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e9d3516..fcad49d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,4 @@
terminal/main.c
-terminal/terminal-accel-map.c
terminal/terminal-app.c
terminal/terminal-gdbus.c
terminal/terminal-dialogs.c
@@ -9,7 +8,6 @@ terminal/terminal-options.c
terminal/terminal-preferences-dialog.c
terminal/terminal-preferences.c
terminal/terminal-screen.c
-terminal/terminal-shortcut-editor.c
terminal/terminal-widget.c
terminal/terminal-window.c
diff --git a/terminal/Makefile.am b/terminal/Makefile.am
index 4e58f82..894f262 100644
--- a/terminal/Makefile.am
+++ b/terminal/Makefile.am
@@ -16,7 +16,6 @@ xfce4_terminal_built_sources = \
terminal-marshal.h
xfce4_terminal_headers = \
- terminal-accel-map.h \
terminal-app.h \
terminal-dialogs.h \
terminal-encoding-action.h \
@@ -27,7 +26,6 @@ xfce4_terminal_headers = \
terminal-preferences-dialog.h \
terminal-private.h \
terminal-screen.h \
- terminal-shortcut-editor.h \
terminal-widget.h \
terminal-window.h \
terminal-window-ui.h
@@ -36,7 +34,6 @@ xfce4_terminal_SOURCES = \
$(xfce4_terminal_built_sources) \
$(xfce4_terminal_headers) \
main.c \
- terminal-accel-map.c \
terminal-app.c \
terminal-dialogs.c \
terminal-encoding-action.c \
@@ -46,7 +43,6 @@ xfce4_terminal_SOURCES = \
terminal-preferences.c \
terminal-preferences-dialog.c \
terminal-screen.c \
- terminal-shortcut-editor.c \
terminal-widget.c \
terminal-window.c
diff --git a/terminal/terminal-accel-map.c b/terminal/terminal-accel-map.c
deleted file mode 100644
index ee75338..0000000
--- a/terminal/terminal-accel-map.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*-
- * Copyright (C) 2012 Nick Schermer <nick at xfce.org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <terminal/terminal-accel-map.h>
-#include <terminal/terminal-preferences.h>
-#include <terminal/terminal-private.h>
-
-
-
-static void terminal_accel_map_finalize (GObject *object);
-static gboolean terminal_accel_map_connect_idle (gpointer user_data);
-static void terminal_accel_map_connect_destroy (gpointer user_data);
-static void terminal_accel_map_notify (TerminalPreferences *preferences,
- GParamSpec *pspec,
- TerminalAccelMap *map);
-static void terminal_accel_map_changed (GtkAccelMap *object,
- gchar *accel_path,
- guint accel_key,
- GdkModifierType accel_mods,
- TerminalAccelMap *map);
-
-
-
-struct _TerminalAccelMap
-{
- GObject __parent__;
- TerminalPreferences *preferences;
-
- guint accels_connect_id;
-};
-
-
-
-G_DEFINE_TYPE (TerminalAccelMap, terminal_accel_map, G_TYPE_OBJECT)
-
-
-
-static void
-terminal_accel_map_class_init (TerminalAccelMapClass *klass)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = terminal_accel_map_finalize;
-}
-
-
-
-static void
-terminal_accel_map_init (TerminalAccelMap *map)
-{
- map->preferences = terminal_preferences_get ();
-
- /* schedule a accel map load, this is quite slow so don't do this
- * during startup since we don't need it right away */
- map->accels_connect_id = g_idle_add_full (G_PRIORITY_LOW,
- terminal_accel_map_connect_idle, map,
- terminal_accel_map_connect_destroy);
-}
-
-
-
-static void
-terminal_accel_map_finalize (GObject *object)
-{
- TerminalAccelMap *map = TERMINAL_ACCEL_MAP (object);
-
- if (G_UNLIKELY (map->accels_connect_id != 0))
- g_source_remove (map->accels_connect_id);
-
- g_signal_handlers_disconnect_by_func (G_OBJECT (map->preferences),
- G_CALLBACK (terminal_accel_map_notify), map);
- g_object_unref (G_OBJECT (map->preferences));
-
- (*G_OBJECT_CLASS (terminal_accel_map_parent_class)->finalize) (object);
-}
-
-
-
-static gboolean
-terminal_accel_map_connect_idle (gpointer user_data)
-{
- TerminalAccelMap *map = TERMINAL_ACCEL_MAP (user_data);
- GtkAccelMap *gtkmap;
- GParamSpec **specs;
- GParamSpec *spec;
- gchar *signal_name;
- guint nspecs, n;
-
- GDK_THREADS_ENTER ();
-
- specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (map->preferences), &nspecs);
- for (n = 0; n < nspecs; ++n)
- {
- spec = specs[n];
- if (!g_str_has_prefix (spec->name, "accel-"))
- continue;
-
- signal_name = g_strconcat ("notify::", spec->name, NULL);
- g_signal_connect (G_OBJECT (map->preferences), signal_name,
- G_CALLBACK (terminal_accel_map_notify), map);
- g_free (signal_name);
-
- terminal_accel_map_notify (map->preferences, spec, map);
- }
- g_free (specs);
-
- /* monitor the accelmap for changes, so we can store
- * changed accelerators in the preferences */
- gtkmap = gtk_accel_map_get ();
- g_signal_connect (G_OBJECT (gtkmap), "changed",
- G_CALLBACK (terminal_accel_map_changed), map);
-
- GDK_THREADS_LEAVE ();
-
- return FALSE;
-}
-
-
-
-static void
-terminal_accel_map_connect_destroy (gpointer user_data)
-{
- TERMINAL_ACCEL_MAP (user_data)->accels_connect_id = 0;
-}
-
-
-
-static void
-terminal_accel_map_notify (TerminalPreferences *preferences,
- GParamSpec *pspec,
- TerminalAccelMap *map)
-{
- GdkModifierType accelerator_mods;
- gchar *accelerator_path;
- guint accelerator_key;
- gchar *accelerator;
-
- terminal_return_if_fail (g_str_has_prefix (pspec->name, "accel-"));
-
- g_object_get (G_OBJECT (preferences), pspec->name, &accelerator, NULL);
-
- accelerator_path = g_strconcat ("<Actions>/terminal-window/", pspec->name + 6, NULL);
- if (G_UNLIKELY (IS_STRING (accelerator)))
- {
- gtk_accelerator_parse (accelerator, &accelerator_key, &accelerator_mods);
- gtk_accel_map_change_entry (accelerator_path,
- accelerator_key,
- accelerator_mods,
- TRUE);
- }
- else
- {
- gtk_accel_map_change_entry (accelerator_path, 0, 0, TRUE);
- }
- g_free (accelerator_path);
- g_free (accelerator);
-}
-
-
-
-static void
-terminal_accel_map_changed (GtkAccelMap *object,
- gchar *accel_path,
- guint accel_key,
- GdkModifierType accel_mods,
- TerminalAccelMap *map)
-{
- gchar *property, *name;
-
- terminal_return_if_fail (TERMINAL_IS_ACCEL_MAP (map));
- terminal_return_if_fail (GTK_IS_ACCEL_MAP (object));
-
- /* only accept window property names */
- if (!g_str_has_prefix (accel_path, "<Actions>/terminal-window/"))
- return;
-
- /* create the property name */
- property = g_strconcat ("accel-", accel_path + 26, NULL);
- if (g_object_class_find_property (G_OBJECT_GET_CLASS (map->preferences), property) != NULL)
- {
- /* store the new accelerator */
- name = gtk_accelerator_name (accel_key, accel_mods);
- g_object_set (G_OBJECT (map->preferences), property, name, NULL);
- g_free (name);
- }
- g_free (property);
-}
diff --git a/terminal/terminal-accel-map.h b/terminal/terminal-accel-map.h
deleted file mode 100644
index b661cda..0000000
--- a/terminal/terminal-accel-map.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 2004 os-cillation e.K.
- *
- * Written by Benedikt Meurer <benny at xfce.org>.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __TERMINAL_ACCEL_MAP_H__
-#define __TERMINAL_ACCEL_MAP_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define TERMINAL_TYPE_ACCEL_MAP (terminal_accel_map_get_type ())
-#define TERMINAL_ACCEL_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TERMINAL_TYPE_ACCEL_MAP, TerminalAccelMap))
-#define TERMINAL_ACCEL_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TERMINAL_TYPE_ACCEL_MAP, TerminalAccelMapClass))
-#define TERMINAL_IS_ACCEL_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TERMINAL_TYPE_ACCEL_MAP))
-#define TERMINAL_IS_ACCEL_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TERMINAL_TYPE_ACCEL_MAP))
-#define TERMINAL_ACCEL_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TERMINAL_TYPE_ACCEL_MAP, TerminalAccepMapClass))
-
-typedef struct _TerminalAccelMapClass TerminalAccelMapClass;
-typedef struct _TerminalAccelMap TerminalAccelMap;
-
-struct _TerminalAccelMapClass
-{
- GObjectClass __parent__;
-};
-
-GType terminal_accel_map_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif /* !__TERMINAL_ACCEL_MAP_H__ */
diff --git a/terminal/terminal-app.c b/terminal/terminal-app.c
index 03d26d3..448f873 100644
--- a/terminal/terminal-app.c
+++ b/terminal/terminal-app.c
@@ -36,18 +36,20 @@
#include <string.h>
#endif
-#include <terminal/terminal-accel-map.h>
#include <terminal/terminal-app.h>
#include <terminal/terminal-config.h>
#include <terminal/terminal-preferences.h>
#include <terminal/terminal-private.h>
#include <terminal/terminal-window.h>
+#define TERMINALACCELMAP "xfce4/terminal/accels.scm"
+
static void terminal_app_finalize (GObject *object);
static void terminal_app_update_accels (TerminalApp *app);
static void terminal_app_update_mnemonics (TerminalApp *app);
+static gboolean terminal_app_load_accel_map (gpointer user_data);
static GtkWidget *terminal_app_create_window (TerminalApp *app,
gboolean fullscreen,
TerminalVisibility menubar,
@@ -80,10 +82,10 @@ struct _TerminalApp
{
GObject __parent__;
TerminalPreferences *preferences;
- TerminalAccelMap *accel_map;
XfceSMClient *session_client;
gchar *initial_menu_bar_accel;
GSList *windows;
+ guint accelmap_id;
};
@@ -130,9 +132,10 @@ terminal_app_init (TerminalApp *app)
terminal_app_update_accels (app);
terminal_app_update_mnemonics (app);
+ terminal_app_load_accel_map (app);
- /* connect the accel map */
- app->accel_map = g_object_new (TERMINAL_TYPE_ACCEL_MAP, NULL);
+ /* schedule accel map load */
+ app->accelmap_id = g_idle_add_full (G_PRIORITY_LOW, terminal_app_load_accel_map, app, NULL);
}
@@ -142,6 +145,20 @@ terminal_app_finalize (GObject *object)
{
TerminalApp *app = TERMINAL_APP (object);
GSList *lp;
+ gchar *path;
+
+ /* stop loading idle */
+ if (G_UNLIKELY (app->accelmap_id != 0))
+ g_source_remove (app->accelmap_id);
+
+ /* save the current accel map */
+ path = xfce_resource_save_location (XFCE_RESOURCE_CONFIG, TERMINALACCELMAP, TRUE);
+ if (G_LIKELY (path != NULL))
+ {
+ /* save the accel map */
+ gtk_accel_map_save (path);
+ g_free (path);
+ }
for (lp = app->windows; lp != NULL; lp = lp->next)
{
@@ -161,8 +178,6 @@ terminal_app_finalize (GObject *object)
if (app->session_client != NULL)
g_object_unref (G_OBJECT (app->session_client));
- g_object_unref (G_OBJECT (app->accel_map));
-
(*G_OBJECT_CLASS (terminal_app_parent_class)->finalize) (object);
}
@@ -185,7 +200,7 @@ terminal_app_update_accels (TerminalApp *app)
gtk_settings_set_string_property (gtk_settings_get_default (),
"gtk-menu-bar-accel", accel,
- "Terminal");
+ g_get_prgname ());
}
@@ -205,6 +220,27 @@ terminal_app_update_mnemonics (TerminalApp *app)
+static gboolean
+terminal_app_load_accel_map (gpointer user_data)
+{
+ TerminalApp *app = TERMINAL_APP (user_data);
+ gchar *path;
+
+ app->accelmap_id = 0;
+
+ path = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, TERMINALACCELMAP);
+ if (G_LIKELY (path != NULL))
+ {
+ /* load the accel map */
+ gtk_accel_map_load (path);
+ g_free (path);
+ }
+
+ return FALSE;
+}
+
+
+
static GtkWidget*
terminal_app_create_window (TerminalApp *app,
gboolean fullscreen,
diff --git a/terminal/terminal-preferences-dialog.c b/terminal/terminal-preferences-dialog.c
index fdbcf83..321b9cb 100644
--- a/terminal/terminal-preferences-dialog.c
+++ b/terminal/terminal-preferences-dialog.c
@@ -27,7 +27,6 @@
#include <terminal/terminal-dialogs.h>
#include <terminal/terminal-enum-types.h>
#include <terminal/terminal-preferences-dialog.h>
-#include <terminal/terminal-shortcut-editor.h>
#include <terminal/terminal-encoding-action.h>
#include <terminal/terminal-private.h>
@@ -86,7 +85,6 @@ terminal_preferences_dialog_init (TerminalPreferencesDialog *dialog)
GError *error = NULL;
guint i;
GObject *object, *object2;
- GtkWidget *editor;
gchar palette_name[16];
GtkFileFilter *filter;
gchar *file;
@@ -178,13 +176,6 @@ error:
g_signal_connect (G_OBJECT (object), "clicked",
G_CALLBACK (terminal_preferences_dialog_reset_word_chars), dialog);
- /* add shortcuts editor */
- editor = g_object_new (TERMINAL_TYPE_SHORTCUT_EDITOR, NULL);
- object = gtk_builder_get_object (GTK_BUILDER (dialog), "editor-container");
- terminal_return_if_fail (G_IS_OBJECT (object));
- gtk_container_add (GTK_CONTAINER (object), editor);
- gtk_widget_show (editor);
-
/* inverted action between cursor color selections */
object = gtk_builder_get_object (GTK_BUILDER (dialog), "color-selection-use-color");
terminal_return_if_fail (G_IS_OBJECT (object));
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 7809c81..911bac8 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -44,35 +44,6 @@
enum
{
PROP_0,
- PROP_ACCEL_NEW_TAB,
- PROP_ACCEL_NEW_WINDOW,
- PROP_ACCEL_DETACH_TAB,
- PROP_ACCEL_CLOSE_TAB,
- PROP_ACCEL_CLOSE_WINDOW,
- PROP_ACCEL_COPY,
- PROP_ACCEL_PASTE,
- PROP_ACCEL_PASTE_SELECTION,
- PROP_ACCEL_SELECT_ALL,
- PROP_ACCEL_PREFERENCES,
- PROP_ACCEL_SHOW_MENUBAR,
- PROP_ACCEL_SHOW_TOOLBARS,
- PROP_ACCEL_SHOW_BORDERS,
- PROP_ACCEL_FULLSCREEN,
- PROP_ACCEL_SET_TITLE,
- PROP_ACCEL_RESET,
- PROP_ACCEL_RESET_AND_CLEAR,
- PROP_ACCEL_PREV_TAB,
- PROP_ACCEL_NEXT_TAB,
- PROP_ACCEL_SWITCH_TO_TAB1,
- PROP_ACCEL_SWITCH_TO_TAB2,
- PROP_ACCEL_SWITCH_TO_TAB3,
- PROP_ACCEL_SWITCH_TO_TAB4,
- PROP_ACCEL_SWITCH_TO_TAB5,
- PROP_ACCEL_SWITCH_TO_TAB6,
- PROP_ACCEL_SWITCH_TO_TAB7,
- PROP_ACCEL_SWITCH_TO_TAB8,
- PROP_ACCEL_SWITCH_TO_TAB9,
- PROP_ACCEL_CONTENTS,
PROP_BACKGROUND_MODE,
PROP_BACKGROUND_IMAGE_FILE,
PROP_BACKGROUND_IMAGE_STYLE,
@@ -306,296 +277,6 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
g_value_register_transform_func (G_TYPE_STRING, TERMINAL_TYPE_CURSOR_SHAPE, transform_string_to_enum);
/**
- * TerminalPreferences:accel-new-tab:
- **/
- preferences_props[PROP_ACCEL_NEW_TAB] =
- g_param_spec_string ("accel-new-tab",
- "Open Tab",
- "AccelNewTab",
- "<Shift><Control>t",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-new-window:
- **/
- preferences_props[PROP_ACCEL_NEW_WINDOW] =
- g_param_spec_string ("accel-new-window",
- "Open Terminal",
- "AccelNewWindow",
- "<Shift><Control>n",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-detach-tab:
- **/
- preferences_props[PROP_ACCEL_DETACH_TAB] =
- g_param_spec_string ("accel-detach-tab",
- "Detach Tab",
- "AccelDetachTab",
- "<Shift><Control>d",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-close-tab:
- **/
- preferences_props[PROP_ACCEL_CLOSE_TAB] =
- g_param_spec_string ("accel-close-tab",
- "Close Tab",
- "AccelCloseTab",
- "<Shift><Control>w",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-close-window:
- **/
- preferences_props[PROP_ACCEL_CLOSE_WINDOW] =
- g_param_spec_string ("accel-close-window",
- "Close Window",
- "AccelCloseWindow",
- "<Shift><Control>q",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-copy:
- **/
- preferences_props[PROP_ACCEL_COPY] =
- g_param_spec_string ("accel-copy",
- "Copy",
- "AccelCopy",
- "<Shift><Control>c",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-paste:
- **/
- preferences_props[PROP_ACCEL_PASTE] =
- g_param_spec_string ("accel-paste",
- "Paste",
- "AccelPaste",
- "<Shift><Control>v",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-paste-selection:
- **/
- preferences_props[PROP_ACCEL_PASTE_SELECTION] =
- g_param_spec_string ("accel-paste-selection",
- "Paste Selection",
- "AccelPasteSelection",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-select-all:
- **/
- preferences_props[PROP_ACCEL_SELECT_ALL] =
- g_param_spec_string ("accel-select-all",
- "Select All",
- "AccelSelectAll",
- "<Shift><Control>a",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-preferences:
- **/
- preferences_props[PROP_ACCEL_PREFERENCES] =
- g_param_spec_string ("accel-preferences",
- "Preferences",
- "AccelPreferences",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-show-menubar:
- **/
- preferences_props[PROP_ACCEL_SHOW_MENUBAR] =
- g_param_spec_string ("accel-show-menubar",
- "Show menubar",
- "AccelShowMenubar",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-show-toolbars:
- **/
- preferences_props[PROP_ACCEL_SHOW_TOOLBARS] =
- g_param_spec_string ("accel-show-toolbars",
- "Show toolbars",
- "AccelShowToolbars",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-show-borders:
- **/
- preferences_props[PROP_ACCEL_SHOW_BORDERS] =
- g_param_spec_string ("accel-show-borders",
- "Show borders",
- "AccelShowBorders",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-fullscreen:
- **/
- preferences_props[PROP_ACCEL_FULLSCREEN] =
- g_param_spec_string ("accel-fullscreen",
- "Fullscreen",
- "AccelFullscreen",
- "F11",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-set-title:
- **/
- preferences_props[PROP_ACCEL_SET_TITLE] =
- g_param_spec_string ("accel-set-title",
- "Set Title",
- "AccelSetTitle",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-reset:
- **/
- preferences_props[PROP_ACCEL_RESET] =
- g_param_spec_string ("accel-reset",
- "Reset",
- "AccelReset",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-reset-and-clear:
- **/
- preferences_props[PROP_ACCEL_RESET_AND_CLEAR] =
- g_param_spec_string ("accel-reset-and-clear",
- "Reset and Clear",
- "AccelResetAndClear",
- NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-prev-tab:
- **/
- preferences_props[PROP_ACCEL_PREV_TAB] =
- g_param_spec_string ("accel-prev-tab",
- "Previous Tab",
- "AccelPrevTab",
- "<Control>Page_Up",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-next-tab:
- **/
- preferences_props[PROP_ACCEL_NEXT_TAB] =
- g_param_spec_string ("accel-next-tab",
- "Next Tab",
- "AccelNextTab",
- "<Control>Page_Down",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab1:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB1] =
- g_param_spec_string ("accel-switch-to-tab1",
- "Switch to Tab 1",
- "AccelSwitchToTab1",
- "<Alt>1",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab2:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB2] =
- g_param_spec_string ("accel-switch-to-tab2",
- "Switch to Tab 2",
- "AccelSwitchToTab2",
- "<Alt>2",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab3:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB3] =
- g_param_spec_string ("accel-switch-to-tab3",
- "Switch to Tab 3",
- "AccelSwitchToTab3",
- "<Alt>3",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab4:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB4] =
- g_param_spec_string ("accel-switch-to-tab4",
- "Switch to Tab 4",
- "AccelSwitchToTab4",
- "<Alt>4",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab5:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB5] =
- g_param_spec_string ("accel-switch-to-tab5",
- "Switch to Tab 5",
- "AccelSwitchToTab5",
- "<Alt>5",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab6:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB6] =
- g_param_spec_string ("accel-switch-to-tab6",
- "Switch to Tab 6",
- "AccelSwitchToTab6",
- "<Alt>6",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab7:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB7] =
- g_param_spec_string ("accel-switch-to-tab7",
- "Switch to Tab 7",
- "AccelSwitchToTab7",
- "<Alt>7",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab8:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB8] =
- g_param_spec_string ("accel-switch-to-tab8",
- "Switch to Tab 8",
- "AccelSwitchToTab8",
- "<Alt>8",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-switch-to-tab9:
- **/
- preferences_props[PROP_ACCEL_SWITCH_TO_TAB9] =
- g_param_spec_string ("accel-switch-to-tab9",
- "Switch to Tab 9",
- "AccelSwitchToTab9",
- "<Alt>9",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
- * TerminalPreferences:accel-contents:
- **/
- preferences_props[PROP_ACCEL_CONTENTS] =
- g_param_spec_string ("accel-contents",
- "Contents",
- "AccelContents",
- "F1",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- /**
* TerminalPreferences:background-mode:
**/
preferences_props[PROP_BACKGROUND_MODE] =
diff --git a/terminal/terminal-shortcut-editor.c b/terminal/terminal-shortcut-editor.c
deleted file mode 100644
index 6df5aa2..0000000
--- a/terminal/terminal-shortcut-editor.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*-
- * Copyright (c) 2004-2007 os-cillation e.K.
- *
- * Written by Benedikt Meurer <benny at xfce.org>.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * The modifier check was taken from egg/eggcellrendererkeys.c.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gdk/gdkkeysyms.h>
-
-#include <terminal/terminal-preferences.h>
-#include <terminal/terminal-shortcut-editor.h>
-#include <terminal/terminal-private.h>
-
-#if defined(GDK_WINDOWING_WIN32)
-#include <gdk/gdkwin32.h>
-#elif defined(GDK_WINDOWING_X11)
-#include <gdk/gdkx.h>
-#endif
-
-
-
-#define TERMINAL_RESPONSE_CLEAR 1
-
-
-
-enum
-{
- COLUMN_TITLE,
- COLUMN_ACCEL,
- COLUMN_PROPERTY,
- LAST_COLUMN,
-};
-
-
-
-static void terminal_shortcut_editor_finalize (GObject *object);
-static void terminal_shortcut_editor_activate (TerminalShortcutEditor *editor,
- GtkTreePath *path,
- GtkTreeViewColumn *column);
-static gboolean terminal_shortcut_editor_compose (GtkWidget *dialog,
- GdkEventKey *event,
- TerminalShortcutEditor *editor);
-static void terminal_shortcut_editor_notify (TerminalPreferences *preferences,
- GParamSpec *pspec,
- TerminalShortcutEditor *editor);
-
-
-
-typedef struct
-{
- const gchar *title;
- const gchar *accels[32];
-} ToplevelMenu;
-
-
-
-struct _TerminalShortcutEditor
-{
- GtkTreeView __parent__;
- TerminalPreferences *preferences;
-};
-
-
-
-static const ToplevelMenu toplevel_menus[] =
-{
- {
- N_ ("File"),
- {
- "accel-new-tab",
- "accel-new-window",
- "accel-detach-tab",
- "accel-close-tab",
- "accel-close-window",
- NULL,
- },
- },
- {
- N_ ("Edit"),
- {
- "accel-copy",
- "accel-paste",
- "accel-paste-selection",
- "accel-select-all",
- "accel-preferences",
- NULL,
- },
- },
- {
- N_ ("View"),
- {
- "accel-show-menubar",
- "accel-show-toolbars",
- "accel-show-borders",
- "accel-fullscreen",
- NULL,
- },
- },
- {
- N_ ("Terminal"),
- {
- "accel-set-title",
- "accel-reset",
- "accel-reset-and-clear",
- NULL,
- },
- },
- {
- N_ ("Go"),
- {
- "accel-prev-tab",
- "accel-next-tab",
- "accel-switch-to-tab1",
- "accel-switch-to-tab2",
- "accel-switch-to-tab3",
- "accel-switch-to-tab4",
- "accel-switch-to-tab5",
- "accel-switch-to-tab6",
- "accel-switch-to-tab7",
- "accel-switch-to-tab8",
- "accel-switch-to-tab9",
- NULL,
- },
- },
- {
- N_ ("Help"),
- {
- "accel-contents",
- NULL,
- },
- },
-};
-
-
-
-G_DEFINE_TYPE (TerminalShortcutEditor, terminal_shortcut_editor, GTK_TYPE_TREE_VIEW)
-
-
-
-static void
-terminal_shortcut_editor_class_init (TerminalShortcutEditorClass *klass)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = terminal_shortcut_editor_finalize;
-}
-
-
-
-static void
-terminal_shortcut_editor_init (TerminalShortcutEditor *editor)
-{
- const ToplevelMenu *menu;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- GtkTreeStore *store;
- GtkTreeIter parent;
- GtkTreeIter child;
- GParamSpec *pspec;
- gchar *notify_signal;
- gchar *accel;
- gint n;
-
- editor->preferences = terminal_preferences_get ();
-
- store = gtk_tree_store_new (LAST_COLUMN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
-
- for (menu = toplevel_menus; menu < toplevel_menus + G_N_ELEMENTS (toplevel_menus); ++menu)
- {
- gtk_tree_store_append (store, &parent, NULL);
- gtk_tree_store_set (store, &parent,
- COLUMN_TITLE, _(menu->title),
- -1);
-
- for (n = 0; menu->accels[n] != NULL; ++n)
- {
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (editor->preferences), menu->accels[n]);
-
- notify_signal = g_strconcat ("notify::", menu->accels[n], NULL);
- g_signal_connect (G_OBJECT (editor->preferences), notify_signal,
- G_CALLBACK (terminal_shortcut_editor_notify), editor);
- g_free (notify_signal);
-
- g_object_get (G_OBJECT (editor->preferences), pspec->name, &accel, NULL);
-
- gtk_tree_store_append (store, &child, &parent);
- gtk_tree_store_set (store, &child,
- COLUMN_TITLE, g_param_spec_get_nick (pspec),
- COLUMN_ACCEL, IS_STRING (accel) ? accel : _("Disabled"),
- COLUMN_PROPERTY, pspec->name,
- -1);
- g_free (accel);
- }
- }
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (editor), GTK_TREE_MODEL (store));
- gtk_tree_view_expand_all (GTK_TREE_VIEW (editor));
- g_object_unref (G_OBJECT (store));
-
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Action"),
- renderer,
- "text", COLUMN_TITLE,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (editor), column);
-
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Shortcut key"),
- renderer,
- "text", COLUMN_ACCEL,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (editor), column);
-
- g_signal_connect (G_OBJECT (editor), "row-activated",
- G_CALLBACK (terminal_shortcut_editor_activate), NULL);
-}
-
-
-
-static void
-terminal_shortcut_editor_finalize (GObject *object)
-{
- TerminalShortcutEditor *editor = TERMINAL_SHORTCUT_EDITOR (object);
-
- g_signal_handlers_disconnect_by_func (G_OBJECT (editor->preferences),
- G_CALLBACK (terminal_shortcut_editor_notify),
- editor);
- g_object_unref (G_OBJECT (editor->preferences));
-
- (*G_OBJECT_CLASS (terminal_shortcut_editor_parent_class)->finalize) (object);
-}
-
-
-
-static gboolean
-is_modifier (guint keycode)
-{
-#if defined(GDK_WINDOWING_WIN32)
- switch (keycode)
- {
- case VK_ALT:
- case VK_LALT:
- case VK_RALT:
- case VK_CONTROL:
- case VK_LCONTROL:
- case VK_RCONTROL:
- case VK_SHIFT:
- case VK_LSHIFT:
- case VK_RSHIFT:
- return TRUE;
-
- default:
- return FALSE;
- }
-#elif (defined(GDK_WINDOWING_X11) && defined(HAVE_LIBX11))
- XModifierKeymap *keymap;
- gboolean result = FALSE;
- gint n;
-
- keymap = XGetModifierMapping (gdk_display);
- for (n = 0; n < keymap->max_keypermod * 8; ++n)
- if (keycode == keymap->modifiermap[n])
- {
- result = TRUE;
- break;
- }
-
- XFreeModifiermap (keymap);
-
- return result;
-#else
- return FALSE;
-#endif
-}
-
-
-
-static void
-terminal_shortcut_editor_activate (TerminalShortcutEditor *editor,
- GtkTreePath *path,
- GtkTreeViewColumn *column)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
- GtkWidget *toplevel;
- GtkWidget *dialog;
- GtkWidget *hbox;
- GtkWidget *image;
- GtkWidget *label;
- GtkWidget *message;
- gchar *property;
- gchar *title;
- gchar *text;
- gint response;
- GtkWidget *button;
-
- if (gtk_tree_path_get_depth (path) <= 1)
- return;
-
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (editor));
- if (G_UNLIKELY (toplevel == NULL))
- return;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (editor));
- if (!gtk_tree_model_get_iter (model, &iter, path))
- return;
-
- dialog = gtk_dialog_new_with_buttons (_("Compose shortcut"),
- GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT
- | GTK_DIALOG_MODAL, NULL);
-
- button = gtk_button_new_with_mnemonic (_("Clea_r"));
- image = gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON);
- gtk_button_set_image (GTK_BUTTON (button), image);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, TERMINAL_RESPONSE_CLEAR);
- gtk_widget_show (button);
-
- gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
-
- hbox = gtk_hbox_new (FALSE, 10);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
- gtk_widget_show (hbox);
-
- image = gtk_image_new_from_icon_name ("preferences-desktop-keyboard-shortcuts", GTK_ICON_SIZE_DIALOG);
- gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, TRUE, 0);
- gtk_widget_show (image);
-
- gtk_tree_model_get (model, &iter, COLUMN_TITLE, &title, -1);
- text = g_strdup_printf ("<i>%s</i>\n<b>%s</b>",
- _("Compose shortcut for:"),
- title);
- g_free (title);
-
- label = g_object_new (GTK_TYPE_LABEL,
- "justify", GTK_JUSTIFY_CENTER,
- "label", text,
- "use-markup", TRUE,
- NULL);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
- gtk_widget_show (label);
-
- gtk_widget_show_now (dialog);
-
- if (gdk_keyboard_grab (dialog->window, FALSE, GDK_CURRENT_TIME) != GDK_GRAB_SUCCESS)
- {
- message = gtk_message_dialog_new_with_markup (GTK_WINDOW (dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT
- | GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s.",
- _("Failed to acquire keyboard"));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
- _("Another application has already acquired "
- "control over your keyboard."));
- gtk_dialog_run (GTK_DIALOG (message));
- gtk_widget_destroy (message);
- goto done;
- }
-
- gtk_tree_model_get (model, &iter, COLUMN_PROPERTY, &property, -1);
- g_object_set_data_full (G_OBJECT (dialog), I_("property-name"), property, g_free);
-
- g_signal_connect (G_OBJECT (dialog), "key-press-event",
- G_CALLBACK (terminal_shortcut_editor_compose), editor);
-
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response == TERMINAL_RESPONSE_CLEAR)
- g_object_set (G_OBJECT (editor->preferences), property, "", NULL);
-
- gdk_keyboard_ungrab (GDK_CURRENT_TIME);
-
-done:
- gtk_widget_destroy (dialog);
- g_free (text);
-}
-
-
-
-static gboolean
-terminal_shortcut_editor_compose (GtkWidget *dialog,
- GdkEventKey *event,
- TerminalShortcutEditor *editor)
-{
- GdkModifierType consumed_modifiers = 0;
- guint keyval;
- guint modifiers;
- gchar *accelerator;
- gchar *property;
- gint response_id;
-
- if (is_modifier (event->hardware_keycode))
- return TRUE;
-
- gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (),
- event->hardware_keycode,
- event->state,
- event->group,
- NULL, NULL, NULL,
- &consumed_modifiers);
-
- keyval = gdk_keyval_to_lower (event->keyval);
- switch (keyval)
- {
- case GDK_ISO_Left_Tab:
- keyval = GDK_Tab;
- break;
-
- case GDK_ISO_Level3_Latch:
- case GDK_ISO_Level3_Lock:
- case GDK_ISO_Level3_Shift:
- case GDK_Scroll_Lock:
- case GDK_Super_L:
- case GDK_Super_R:
- return TRUE;
- }
-
- if (keyval != event->keyval && (consumed_modifiers & GDK_SHIFT_MASK))
- consumed_modifiers &= ~GDK_SHIFT_MASK;
-
- /* filter out invalid modifiers */
- modifiers = event->state & (~consumed_modifiers | GDK_MODIFIER_MASK);
- modifiers = modifiers & gtk_accelerator_get_default_mod_mask ();
-
- /* check if the accelerator will actually be handed by gtk in the
- * interface, see http://bugzilla.xfce.org/show_bug.cgi?id=3524 */
- if (!gtk_accelerator_valid (keyval, modifiers))
- return TRUE;
-
- accelerator = gtk_accelerator_name (keyval, modifiers);
- if (g_strcmp0 (accelerator, "<Alt>c") == 0)
- {
- response_id = GTK_RESPONSE_CANCEL;
- }
- else if (g_strcmp0 (accelerator, "<Alt>r") == 0)
- {
- response_id = TERMINAL_RESPONSE_CLEAR;
- }
- else
- {
- response_id = GTK_RESPONSE_OK;
- property = g_object_get_data (G_OBJECT (dialog), "property-name");
- g_object_set (G_OBJECT (editor->preferences), property, accelerator, NULL);
- }
- g_free (accelerator);
-
- gtk_dialog_response (GTK_DIALOG (dialog), response_id);
-
- return TRUE;
-}
-
-
-
-static void
-terminal_shortcut_editor_notify (TerminalPreferences *preferences,
- GParamSpec *pspec,
- TerminalShortcutEditor *editor)
-{
- GtkTreeModel *model;
- GtkTreeIter parent;
- GtkTreeIter child;
- gchar *property;
- gchar *accel;
- gboolean found = FALSE;
-
- g_object_get (G_OBJECT (preferences), pspec->name, &accel, NULL);
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (editor));
- if (gtk_tree_model_get_iter_first (model, &parent))
- {
- do
- {
- if (gtk_tree_model_iter_children (model, &child, &parent))
- {
- do
- {
- gtk_tree_model_get (model, &child,
- COLUMN_PROPERTY, &property,
- -1);
- if (g_strcmp0 (property, pspec->name) == 0)
- {
- gtk_tree_store_set (GTK_TREE_STORE (model), &child,
- COLUMN_ACCEL, IS_STRING (accel) ? accel : _("Disabled"), -1);
- found = TRUE;
- }
- g_free (property);
- }
- while (!found && gtk_tree_model_iter_next (model, &child));
- }
- }
- while (!found && gtk_tree_model_iter_next (model, &parent));
- }
-
- g_free (accel);
-}
diff --git a/terminal/terminal-shortcut-editor.h b/terminal/terminal-shortcut-editor.h
deleted file mode 100644
index 06588fc..0000000
--- a/terminal/terminal-shortcut-editor.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * Copyright (c) 2004 os-cillation e.K.
- *
- * Written by Benedikt Meurer <benny at xfce.org>.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __TERMINAL_SHORTCUT_EDITOR_H__
-#define __TERMINAL_SHORTCUT_EDITOR_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define TERMINAL_TYPE_SHORTCUT_EDITOR (terminal_shortcut_editor_get_type ())
-#define TERMINAL_SHORTCUT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TERMINAL_TYPE_SHORTCUT_EDITOR, TerminalShortcutEditor))
-#define TERMINAL_SHORTCUT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TERMINAL_TYPE_SHORTCUT_EDITOR, TerminalShortcutEditorClass))
-#define TERMINAL_IS_SHORTCUT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TERMINAL_TYPE_SHORTCUT_EDITOR))
-#define TERMINAL_IS_SHORTCUT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TERMINAL_TYPE_SHORTCUT_EDITOR))
-#define TERMINAL_SHORTCUT_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TERMINAL_TYPE_SHORTCUT_EDITOR, TerminalShortcutEditorClass))
-
-typedef struct _TerminalShortcutEditorClass TerminalShortcutEditorClass;
-typedef struct _TerminalShortcutEditor TerminalShortcutEditor;
-
-struct _TerminalShortcutEditorClass
-{
- GtkTreeViewClass __parent__;
-};
-
-GType terminal_shortcut_editor_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif /* !__TERMINAL_SHORTCUT_EDITOR_H__ */
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 3da8c13..21de2ab 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -211,16 +211,16 @@ static GQuark gomenu_action_quark = 0;
static const GtkActionEntry action_entries[] =
{
{ "file-menu", NULL, N_ ("_File"), NULL, NULL, NULL, },
- { "new-tab", "tab-new", N_ ("Open _Tab"), NULL, N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), },
- { "new-window", "window-new", N_ ("Open T_erminal"), "<control><shift>N", N_ ("Open a new terminal window"), G_CALLBACK (terminal_window_action_new_window), },
- { "detach-tab", NULL, N_ ("_Detach Tab"), NULL, N_ ("Open a new window for the current terminal tab"), G_CALLBACK (terminal_window_action_detach_tab), },
- { "close-tab", GTK_STOCK_CLOSE, N_ ("C_lose Tab"), NULL, N_ ("Close the current terminal tab"), G_CALLBACK (terminal_window_action_close_tab), },
- { "close-window", GTK_STOCK_QUIT, N_ ("_Close Window"), NULL, N_ ("Close the terminal window"), G_CALLBACK (terminal_window_action_close_window), },
+ { "new-tab", "tab-new", N_ ("Open _Tab"), "<control><shift>t", N_ ("Open a new terminal tab"), G_CALLBACK (terminal_window_action_new_tab), },
+ { "new-window", "window-new", N_ ("Open T_erminal"), "<control><shift>n", N_ ("Open a new terminal window"), G_CALLBACK (terminal_window_action_new_window), },
+ { "detach-tab", NULL, N_ ("_Detach Tab"), "<control><shift>d", N_ ("Open a new window for the current terminal tab"), G_CALLBACK (terminal_window_action_detach_tab), },
+ { "close-tab", GTK_STOCK_CLOSE, N_ ("C_lose Tab"), "<control><shift>w", N_ ("Close the current terminal tab"), G_CALLBACK (terminal_window_action_close_tab), },
+ { "close-window", GTK_STOCK_QUIT, N_ ("_Close Window"), "<control><shift>q", N_ ("Close the terminal window"), G_CALLBACK (terminal_window_action_close_window), },
{ "edit-menu", NULL, N_ ("_Edit"), NULL, NULL, NULL, },
- { "copy", GTK_STOCK_COPY, N_ ("_Copy"), NULL, N_ ("Copy to clipboard"), G_CALLBACK (terminal_window_action_copy), },
- { "paste", GTK_STOCK_PASTE, N_ ("_Paste"), NULL, N_ ("Paste from clipboard"), G_CALLBACK (terminal_window_action_paste), },
+ { "copy", GTK_STOCK_COPY, N_ ("_Copy"), "<control><shift>c", N_ ("Copy to clipboard"), G_CALLBACK (terminal_window_action_copy), },
+ { "paste", GTK_STOCK_PASTE, N_ ("_Paste"), "<control><shift>v", N_ ("Paste from clipboard"), G_CALLBACK (terminal_window_action_paste), },
{ "paste-selection", NULL, N_ ("Paste _Selection"), NULL, N_ ("Paste from primary selection"), G_CALLBACK (terminal_window_action_paste_selection), },
- { "select-all", GTK_STOCK_SELECT_ALL, N_ ("Select _All"), NULL, N_ ("Select all text in the terminal"), G_CALLBACK (terminal_window_action_select_all), },
+ { "select-all", GTK_STOCK_SELECT_ALL, N_ ("Select _All"), "<control><shift>a", N_ ("Select all text in the terminal"), G_CALLBACK (terminal_window_action_select_all), },
{ "preferences", GTK_STOCK_PREFERENCES, N_ ("Pr_eferences..."), NULL, N_ ("Open the Terminal preferences dialog"), G_CALLBACK (terminal_window_action_prefs), },
{ "view-menu", NULL, N_ ("_View"), NULL, NULL, NULL, },
{ "terminal-menu", NULL, N_ ("_Terminal"), NULL, NULL, NULL, },
@@ -228,10 +228,10 @@ static const GtkActionEntry action_entries[] =
{ "reset", GTK_STOCK_REFRESH, N_ ("_Reset"), NULL, N_ ("Reset"), G_CALLBACK (terminal_window_action_reset), },
{ "reset-and-clear", GTK_STOCK_CLEAR, N_ ("Reset and C_lear"), NULL, N_ ("Reset and clear"), G_CALLBACK (terminal_window_action_reset_and_clear), },
{ "go-menu", NULL, N_ ("_Go"), NULL, NULL, NULL, },
- { "prev-tab", GTK_STOCK_GO_BACK, N_ ("_Previous Tab"), NULL, N_ ("Switch to previous tab"), G_CALLBACK (terminal_window_action_prev_tab), },
- { "next-tab", GTK_STOCK_GO_FORWARD, N_ ("_Next Tab"), NULL, N_ ("Switch to next tab"), G_CALLBACK (terminal_window_action_next_tab), },
+ { "prev-tab", GTK_STOCK_GO_BACK, N_ ("_Previous Tab"), "<Control>Page_Up", N_ ("Switch to previous tab"), G_CALLBACK (terminal_window_action_prev_tab), },
+ { "next-tab", GTK_STOCK_GO_FORWARD, N_ ("_Next Tab"), "<Control>Page_Down", N_ ("Switch to next tab"), G_CALLBACK (terminal_window_action_next_tab), },
{ "help-menu", NULL, N_ ("_Help"), NULL, NULL, NULL, },
- { "contents", GTK_STOCK_HELP, N_ ("_Contents"), NULL, N_ ("Display help contents"), G_CALLBACK (terminal_window_action_contents), },
+ { "contents", GTK_STOCK_HELP, N_ ("_Contents"), "F1", N_ ("Display help contents"), G_CALLBACK (terminal_window_action_contents), },
{ "report-bug", NULL, N_ ("_Report a bug"), NULL, N_ ("Report a bug in Terminal"), G_CALLBACK (terminal_window_action_report_bug), },
{ "about", GTK_STOCK_ABOUT, N_ ("_About"), NULL, N_ ("Display information about Terminal"), G_CALLBACK (terminal_window_action_about), },
{ "input-methods", NULL, N_ ("_Input Methods"), NULL, NULL, NULL, },
@@ -242,7 +242,7 @@ static const GtkToggleActionEntry toggle_action_entries[] =
{ "show-menubar", NULL, N_ ("Show _Menubar"), NULL, N_ ("Show/hide the menubar"), G_CALLBACK (terminal_window_action_show_menubar), FALSE, },
{ "show-toolbars", NULL, N_ ("Show _Toolbars"), NULL, N_ ("Show/hide the toolbars"), G_CALLBACK (terminal_window_action_show_toolbars), FALSE, },
{ "show-borders", NULL, N_ ("Show Window _Borders"), NULL, N_ ("Show/hide the window decorations"), G_CALLBACK (terminal_window_action_show_borders), TRUE, },
- { "fullscreen", GTK_STOCK_FULLSCREEN, N_ ("_Fullscreen"), NULL, N_ ("Toggle fullscreen mode"), G_CALLBACK (terminal_window_action_fullscreen), FALSE, },
+ { "fullscreen", GTK_STOCK_FULLSCREEN, N_ ("_Fullscreen"), "F11", N_ ("Toggle fullscreen mode"), G_CALLBACK (terminal_window_action_fullscreen), FALSE, },
};
diff --git a/xfce4-terminal.glade b/xfce4-terminal.glade
index 5bfd672..534fef6 100644
--- a/xfce4-terminal.glade
+++ b/xfce4-terminal.glade
@@ -1762,48 +1762,7 @@
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
- <object class="GtkFrame" id="frame10">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label_xalign">0</property>
- <property name="shadow_type">none</property>
- <child>
- <object class="GtkAlignment" id="alignment13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkScrolledWindow" id="editor-container">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="border_width">6</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <placeholder/>
- </child>
- </object>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Shortcut Keys</property>
- <property name="use_markup">True</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
+ <placeholder/>
</child>
<child>
<object class="GtkFrame" id="frame11">
More information about the Xfce4-commits
mailing list