[keybindings] Remove libglade dependency from keybindings capplet

This commit is contained in:
Felix Riemann 2009-07-10 16:46:41 +02:00
parent 80e3300d27
commit 9fcae9146b
5 changed files with 390 additions and 459 deletions

View file

@ -13,8 +13,8 @@ gnome_keybinding_properties_SOURCES = \
@INTLTOOL_DESKTOP_RULE@
Gladedir = $(pkgdatadir)/glade
Glade_DATA = gnome-keybinding-properties.glade
uidir = $(pkgdatadir)/ui
ui_DATA = gnome-keybinding-properties.ui
desktopdir = $(datadir)/applications
Desktop_in_files = keybinding.desktop.in
@ -33,12 +33,12 @@ INCLUDES = \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-DGNOMECC_GLADE_DIR="\"$(pkgdatadir)/glade\"" \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMECC_KEYBINDINGS_DIR="\"$(pkgdatadir)/keybindings\""
CLEANFILES = \
$(GNOMECC_CAPPLETS_CLEANFILES) \
$(Desktop_in_files) \
$(desktop_DATA) \
$(xml_DATA)
EXTRA_DIST = $(Glade_DATA) $(xml_in_files) gnome-keybindings.pc.in
EXTRA_DIST = $(ui_DATA) $(xml_in_files) gnome-keybindings.pc.in

View file

@ -4,11 +4,11 @@
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
#include <gdk/gdkx.h>
#include <glade/glade.h>
#include <X11/Xatom.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
@ -82,11 +82,27 @@ static GtkWidget *custom_shortcut_dialog = NULL;
static GtkWidget *custom_shortcut_name_entry = NULL;
static GtkWidget *custom_shortcut_command_entry = NULL;
static GladeXML *
create_dialog (void)
static GtkWidget*
_gtk_builder_get_widget (GtkBuilder *builder, const gchar *name)
{
return glade_xml_new (GNOMECC_GLADE_DIR "/gnome-keybinding-properties.glade",
NULL, NULL);
return GTK_WIDGET (gtk_builder_get_object (builder, name));
}
static GtkBuilder *
create_builder (void)
{
GtkBuilder *builder = gtk_builder_new();
GError *error = NULL;
static const gchar *uifile = GNOMECC_UI_DIR "/gnome-keybinding-properties.ui";
if (gtk_builder_add_from_file (builder, uifile, &error) == 0) {
g_warning ("Could not load UI: %s", error->message);
g_error_free (error);
g_object_unref (builder);
builder = NULL;
}
return builder;
}
static char*
@ -329,12 +345,13 @@ keyentry_sort_func (GtkTreeModel *model,
}
static void
clear_old_model (GladeXML *dialog)
clear_old_model (GtkBuilder *builder)
{
GtkWidget *tree_view;
GtkWidget *actions_swindow;
GtkTreeModel *model;
tree_view = WID ("shortcut_treeview");
tree_view = _gtk_builder_get_widget (builder, "shortcut_treeview");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
if (model == NULL)
@ -393,9 +410,10 @@ clear_old_model (GladeXML *dialog)
g_object_unref (client);
}
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (WID ("actions_swindow")),
actions_swindow = _gtk_builder_get_widget (builder, "actions_swindow");
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (actions_swindow),
GTK_POLICY_NEVER, GTK_POLICY_NEVER);
gtk_widget_set_size_request (WID ("actions_swindow"), -1, -1);
gtk_widget_set_size_request (actions_swindow, -1, -1);
}
typedef struct {
@ -482,15 +500,19 @@ count_rows_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, g
}
static void
ensure_scrollbar (GladeXML *dialog, int i)
ensure_scrollbar (GtkBuilder *builder, int i)
{
if (i == MAX_ELEMENTS_BEFORE_SCROLLING)
{
GtkRequisition rectangle;
gtk_widget_ensure_style (WID ("shortcut_treeview"));
gtk_widget_size_request (WID ("shortcut_treeview"), &rectangle);
gtk_widget_set_size_request (WID ("shortcut_treeview"), -1, rectangle.height);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (WID ("actions_swindow")),
GObject *actions_swindow = gtk_builder_get_object (builder,
"actions_swindow");
GtkWidget *treeview = _gtk_builder_get_widget (builder,
"shortcut_treeview");
gtk_widget_ensure_style (treeview);
gtk_widget_size_request (treeview, &rectangle);
gtk_widget_set_size_request (treeview, -1, rectangle.height);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (actions_swindow),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
}
}
@ -530,7 +552,7 @@ find_section (GtkTreeModel *model,
}
static void
append_keys_to_tree (GladeXML *dialog,
append_keys_to_tree (GtkBuilder *builder,
const gchar *title,
const KeyListEntry *keys_list)
{
@ -541,7 +563,7 @@ append_keys_to_tree (GladeXML *dialog,
gint rows_before;
client = gconf_client_get_default ();
model = gtk_tree_view_get_model (GTK_TREE_VIEW (WID ("shortcut_treeview")));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (gtk_builder_get_object (builder, "shortcut_treeview")));
/* Try to find a section parent iter, if it already exists */
find_section (model, &iter, title);
@ -552,7 +574,7 @@ append_keys_to_tree (GladeXML *dialog,
/* If the header we just added is the MAX_ELEMENTS_BEFORE_SCROLLING th,
* then we need to scroll now */
ensure_scrollbar (dialog, i - 1);
ensure_scrollbar (builder, i - 1);
rows_before = i;
for (j = 0; keys_list[j].name != NULL; j++)
@ -658,7 +680,7 @@ append_keys_to_tree (GladeXML *dialog,
g_free (key_value);
gconf_entry_free (entry);
ensure_scrollbar (dialog, i);
ensure_scrollbar (builder, i);
++i;
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent_iter);
@ -666,7 +688,7 @@ append_keys_to_tree (GladeXML *dialog,
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
KEYENTRY_COLUMN, key_entry,
-1);
gtk_tree_view_expand_all (GTK_TREE_VIEW (WID ("shortcut_treeview")));
gtk_tree_view_expand_all (GTK_TREE_VIEW (gtk_builder_get_object (builder, "shortcut_treeview")));
}
g_object_unref (client);
@ -676,9 +698,9 @@ append_keys_to_tree (GladeXML *dialog,
gtk_tree_store_remove (GTK_TREE_STORE (model), &parent_iter);
if (i == 0)
gtk_widget_hide (WID ("shortcuts_vbox"));
gtk_widget_hide (_gtk_builder_get_widget (builder, "shortcuts_vbox"));
else
gtk_widget_show (WID ("shortcuts_vbox"));
gtk_widget_show (_gtk_builder_get_widget (builder, "shortcuts_vbox"));
}
static void
@ -800,7 +822,7 @@ parse_start_tag (GMarkupParseContext *ctx,
}
static void
append_keys_to_tree_from_file (GladeXML *dialog,
append_keys_to_tree_from_file (GtkBuilder *builder,
const char *filename,
const char *wm_name)
{
@ -871,7 +893,7 @@ append_keys_to_tree_from_file (GladeXML *dialog,
title = _(keylist->name);
}
append_keys_to_tree (dialog, title, keys);
append_keys_to_tree (builder, title, keys);
g_free (keylist->name);
g_free (keylist->package);
@ -881,7 +903,7 @@ append_keys_to_tree_from_file (GladeXML *dialog,
}
static void
append_keys_to_tree_from_gconf (GladeXML *dialog, const gchar *gconf_path)
append_keys_to_tree_from_gconf (GtkBuilder *builder, const gchar *gconf_path)
{
GConfClient *client;
GSList *custom_list, *l;
@ -922,7 +944,7 @@ append_keys_to_tree_from_gconf (GladeXML *dialog, const gchar *gconf_path)
g_array_append_val (entries, key);
keys = (KeyListEntry *) entries->data;
append_keys_to_tree (dialog, _("Custom Shortcuts"), keys);
append_keys_to_tree (builder, _("Custom Shortcuts"), keys);
for (i = 0; i < entries->len; ++i)
{
g_free (keys[i].name);
@ -934,13 +956,13 @@ append_keys_to_tree_from_gconf (GladeXML *dialog, const gchar *gconf_path)
}
static void
reload_key_entries (gpointer wm_name, GladeXML *dialog)
reload_key_entries (gpointer wm_name, GtkBuilder *builder)
{
GDir *dir;
const char *name;
GList *list, *l;
clear_old_model (dialog);
clear_old_model (builder);
dir = g_dir_open (GNOMECC_KEYBINDINGS_DIR, 0, NULL);
if (!dir)
@ -962,7 +984,7 @@ reload_key_entries (gpointer wm_name, GladeXML *dialog)
gchar *path;
path = g_build_filename (GNOMECC_KEYBINDINGS_DIR, l->data, NULL);
append_keys_to_tree_from_file (dialog, path, wm_name);
append_keys_to_tree_from_file (builder, path, wm_name);
g_free (l->data);
g_free (path);
}
@ -973,7 +995,7 @@ reload_key_entries (gpointer wm_name, GladeXML *dialog)
* in a file. Loading the custom shortcuts last makes
* such keys not show up in the custom section.
*/
append_keys_to_tree_from_gconf (dialog, GCONF_BINDING_DIR);
append_keys_to_tree_from_gconf (builder, GCONF_BINDING_DIR);
}
static void
@ -1716,13 +1738,14 @@ maybe_block_accels (GtkWidget *widget,
static void
cb_dialog_response (GtkWidget *widget, gint response_id, gpointer data)
{
GladeXML *dialog = data;
GtkBuilder *builder = data;
GtkTreeView *treeview;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeIter iter;
treeview = GTK_TREE_VIEW (WID ("shortcut_treeview"));
treeview = GTK_TREE_VIEW (gtk_builder_get_object (builder,
"shortcut_treeview"));
model = gtk_tree_view_get_model (treeview);
if (response_id == GTK_RESPONSE_HELP)
@ -1744,7 +1767,7 @@ cb_dialog_response (GtkWidget *widget, gint response_id, gpointer data)
}
else
{
clear_old_model (dialog);
clear_old_model (builder);
gtk_main_quit ();
}
}
@ -1770,21 +1793,24 @@ selection_changed (GtkTreeSelection *selection, gpointer data)
}
static void
setup_dialog (GladeXML *dialog)
setup_dialog (GtkBuilder *builder)
{
GConfClient *client;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkWidget *widget;
GtkTreeView *treeview = GTK_TREE_VIEW (WID ("shortcut_treeview"));
GtkTreeView *treeview;
gchar *wm_name;
GtkTreeSelection *selection;
GSList *allowed_keys;
treeview = GTK_TREE_VIEW (gtk_builder_get_object (builder,
"shortcut_treeview"));
client = gconf_client_get_default ();
g_signal_connect (treeview, "button_press_event",
G_CALLBACK (start_editing_cb), dialog);
G_CALLBACK (start_editing_cb), builder);
g_signal_connect (treeview, "row-activated",
G_CALLBACK (start_editing_kb_cb), NULL);
@ -1828,23 +1854,24 @@ setup_dialog (GladeXML *dialog)
gconf_client_notify_add (client,
"/apps/metacity/general/num_workspaces",
(GConfClientNotifyFunc) key_entry_controlling_key_changed,
dialog, NULL, NULL);
builder, NULL, NULL);
/* set up the dialog */
wm_name = wm_common_get_current_window_manager();
reload_key_entries (wm_name, dialog);
reload_key_entries (wm_name, builder);
g_free (wm_name);
widget = WID ("gnome-keybinding-dialog");
widget = _gtk_builder_get_widget (builder, "gnome-keybinding-dialog");
capplet_set_icon (widget, "preferences-desktop-keyboard-shortcuts");
gtk_widget_show (widget);
g_signal_connect (widget, "key_press_event", G_CALLBACK (maybe_block_accels), NULL);
g_signal_connect (widget, "response", G_CALLBACK (cb_dialog_response), dialog);
g_signal_connect (widget, "response", G_CALLBACK (cb_dialog_response), builder);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
g_signal_connect (selection, "changed",
G_CALLBACK (selection_changed), WID ("remove-button"));
G_CALLBACK (selection_changed),
_gtk_builder_get_widget (builder, "remove-button"));
allowed_keys = gconf_client_get_list (client,
GCONF_BINDING_DIR "/allowed_keys",
@ -1854,15 +1881,19 @@ setup_dialog (GladeXML *dialog)
{
g_slist_foreach (allowed_keys, (GFunc)g_free, NULL);
g_slist_free (allowed_keys);
gtk_widget_set_sensitive (WID ("add-button"), FALSE);
gtk_widget_set_sensitive (_gtk_builder_get_widget (builder, "add-button"),
FALSE);
}
g_object_unref (client);
/* setup the custom shortcut dialog */
custom_shortcut_dialog = WID ("custom-shortcut-dialog");
custom_shortcut_name_entry = WID ("custom-shortcut-name-entry");
custom_shortcut_command_entry = WID ("custom-shortcut-command-entry");
custom_shortcut_dialog = _gtk_builder_get_widget (builder,
"custom-shortcut-dialog");
custom_shortcut_name_entry = _gtk_builder_get_widget (builder,
"custom-shortcut-name-entry");
custom_shortcut_command_entry = _gtk_builder_get_widget (builder,
"custom-shortcut-command-entry");
gtk_dialog_set_default_response (GTK_DIALOG (custom_shortcut_dialog),
GTK_RESPONSE_OK);
gtk_window_set_transient_for (GTK_WINDOW (custom_shortcut_dialog),
@ -1872,7 +1903,7 @@ setup_dialog (GladeXML *dialog)
int
main (int argc, char *argv[])
{
GladeXML *dialog;
GtkBuilder *builder;
g_thread_init (NULL);
gtk_init (&argc, &argv);
@ -1885,13 +1916,17 @@ main (int argc, char *argv[])
activate_settings_daemon ();
dialog = create_dialog ();
wm_common_register_window_manager_change ((GFunc) reload_key_entries, dialog);
setup_dialog (dialog);
builder = create_builder ();
if (!builder) /* Warning was already printed to console */
exit (EXIT_FAILURE);
wm_common_register_window_manager_change ((GFunc) reload_key_entries, builder);
setup_dialog (builder);
gtk_main ();
g_object_unref (dialog);
g_object_unref (builder);
return 0;
}

View file

@ -1,405 +0,0 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkDialog" id="gnome-keybinding-dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Keyboard Shortcuts</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="shortcut_dialog">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="helpbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="add-button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">0</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="remove-button">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">1</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-7</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child>
<widget class="GtkVBox" id="shortcuts_vbox">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkScrolledWindow" id="actions_swindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="shortcut_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
<property name="icon_size">6</property>
<property name="xalign">0.5</property>
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="label" translatable="yes">To edit a shortcut key, click on the corresponding row and type a new key combination, or press backspace to clear.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_FILL</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkDialog" id="custom-shortcut-dialog">
<property name="title" translatable="yes">Custom Shortcut</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="visible">True</property>
<property name="can_default">False</property>
<property name="receives_default">False</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="can_focus">True</property>
<property name="label">gtk-apply</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="label" translatable="yes">_Name:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">custom-shortcut-name-entry</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="label" translatable="yes">C_ommand:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">custom-shortcut-command-entry</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="custom-shortcut-name-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="has_frame">True</property>
<property name="invisible_char">•</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="custom-shortcut-command-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="has_frame">True</property>
<property name="invisible_char">•</property>
<property name="activates_default">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View file

@ -0,0 +1,301 @@
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="gnome-keybinding-dialog">
<property name="border_width">5</property>
<property name="title" translatable="yes">Keyboard Shortcuts</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="shortcut_dialog">
<property name="visible">True</property>
<property name="spacing">2</property>
<child>
<object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">12</property>
<child>
<object class="GtkVBox" id="shortcuts_vbox">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<object class="GtkScrolledWindow" id="actions_swindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="shortcut_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="rules_hint">True</property>
</object>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="border_width">6</property>
<property name="spacing">12</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="yalign">0</property>
<property name="stock">gtk-dialog-info</property>
<property name="icon-size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">To edit a shortcut key, click on the corresponding row and type a new key combination, or press backspace to clear.</property>
<property name="justify">fill</property>
<property name="wrap">True</property>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="helpbutton1">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="add-button">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="remove-button">
<property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button1">
<property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-11">helpbutton1</action-widget>
<action-widget response="0">add-button</action-widget>
<action-widget response="1">remove-button</action-widget>
<action-widget response="-7">button1</action-widget>
</action-widgets>
</object>
<object class="GtkDialog" id="custom-shortcut-dialog">
<property name="title" translatable="yes">Custom Shortcut</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">6</property>
<child>
<object class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Name:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">custom-shortcut-name-entry</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">C_ommand:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">custom-shortcut-command-entry</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkEntry" id="custom-shortcut-name-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkEntry" id="custom-shortcut-command-entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property>
<property name="activates_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</object>
<packing>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="cancelbutton1">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="okbutton1">
<property name="label">gtk-apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<action-widgets>
<action-widget response="-6">cancelbutton1</action-widget>
<action-widget response="-5">okbutton1</action-widget>
</action-widgets>
</object>
</interface>

View file

@ -45,7 +45,7 @@ capplets/keybindings/00-multimedia-key.xml.in
capplets/keybindings/01-desktop-key.xml.in
capplets/keybindings/eggcellrendererkeys.c
capplets/keybindings/gnome-keybinding-properties.c
capplets/keybindings/gnome-keybinding-properties.glade
[type: gettext/glade]capplets/keybindings/gnome-keybinding-properties.ui
capplets/keybindings/keybinding.desktop.in.in
capplets/keyboard/gnome-keyboard-properties.c
capplets/keyboard/gnome-keyboard-properties.glade