For : Michael Terry <mike@mterry.name>
2004-05-09 Jody Goldberg <jody@gnome.org> For : Michael Terry <mike@mterry.name> http://bugzilla.gnome.org/show_bug.cgi?id=99529 * gnome-keybinding-properties.c : remove functions dealing with the keyboard theme * gnome-keybinding-properties.glade : remove keyboard theme option box and keyboard shortcut label
This commit is contained in:
parent
5e25052341
commit
9ed37401fb
4 changed files with 12 additions and 247 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2004-05-09 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
|
For : Michael Terry <mike@mterry.name>
|
||||||
|
http://bugzilla.gnome.org/show_bug.cgi?id=99529
|
||||||
|
* gnome-keybinding-properties.c : remove functions dealing with
|
||||||
|
the keyboard theme
|
||||||
|
* gnome-keybinding-properties.glade : remove keyboard theme option
|
||||||
|
box and keyboard shortcut label
|
||||||
|
|
||||||
2004-04-16 Jody Goldberg <jody@gnome.org>
|
2004-04-16 Jody Goldberg <jody@gnome.org>
|
||||||
|
|
||||||
From paolo borelli :
|
From paolo borelli :
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#define EGG_CELL_RENDERER_TEXT_PATH "egg-cell-renderer-text"
|
#define EGG_CELL_RENDERER_TEXT_PATH "egg-cell-renderer-text"
|
||||||
|
|
||||||
#define TOOLTIP_TEXT _("<New accelerator...>")
|
#define TOOLTIP_TEXT _("New accelerator...")
|
||||||
|
|
||||||
static void egg_cell_renderer_keys_finalize (GObject *object);
|
static void egg_cell_renderer_keys_finalize (GObject *object);
|
||||||
static void egg_cell_renderer_keys_init (EggCellRendererKeys *cell_keys);
|
static void egg_cell_renderer_keys_init (EggCellRendererKeys *cell_keys);
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "activate-settings-daemon.h"
|
#include "activate-settings-daemon.h"
|
||||||
|
|
||||||
#define LABEL_DATA "gnome-keybinding-properties-label"
|
#define LABEL_DATA "gnome-keybinding-properties-label"
|
||||||
#define KEY_THEME_KEY "/desktop/gnome/interface/gtk_key_theme"
|
|
||||||
#define MAX_ELEMENTS_BEFORE_SCROLLING 10
|
#define MAX_ELEMENTS_BEFORE_SCROLLING 10
|
||||||
|
|
||||||
#if defined(__powerpc__) && defined (__linux__)
|
#if defined(__powerpc__) && defined (__linux__)
|
||||||
|
@ -175,48 +174,6 @@ get_real_model (GtkTreeView *tree_view)
|
||||||
return submodel;
|
return submodel;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
menu_item_activate (GtkWidget *menu_item,
|
|
||||||
gpointer unused)
|
|
||||||
{
|
|
||||||
gchar *key_theme;
|
|
||||||
gchar *current_key_theme;
|
|
||||||
GConfClient *client;
|
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
|
||||||
|
|
||||||
key_theme = g_object_get_data (G_OBJECT (menu_item), LABEL_DATA);
|
|
||||||
g_return_if_fail (key_theme != NULL);
|
|
||||||
|
|
||||||
current_key_theme = gconf_client_get_string (client, KEY_THEME_KEY, &error);
|
|
||||||
if (current_key_theme && strcmp (current_key_theme, key_theme))
|
|
||||||
{
|
|
||||||
gconf_client_set_string (client, KEY_THEME_KEY, key_theme, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static GtkWidget *
|
|
||||||
make_key_theme_menu_item (const gchar *key_theme)
|
|
||||||
{
|
|
||||||
GtkWidget *retval;
|
|
||||||
|
|
||||||
if (!strcmp (key_theme, "Default"))
|
|
||||||
{
|
|
||||||
retval = gtk_menu_item_new_with_label (_("GNOME Default"));
|
|
||||||
g_object_set_data_full (G_OBJECT (retval), LABEL_DATA, g_strdup ("Default"), g_free);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
retval = gtk_menu_item_new_with_label (key_theme);
|
|
||||||
g_object_set_data_full (G_OBJECT (retval), LABEL_DATA, g_strdup (key_theme), g_free);
|
|
||||||
}
|
|
||||||
g_signal_connect (G_OBJECT (retval), "activate", G_CALLBACK (menu_item_activate), NULL);
|
|
||||||
gtk_widget_show (retval);
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GladeXML *
|
static GladeXML *
|
||||||
create_dialog (void)
|
create_dialog (void)
|
||||||
{
|
{
|
||||||
|
@ -615,48 +572,6 @@ key_entry_controlling_key_changed (GConfClient *client,
|
||||||
reload_key_entries (wm_common_get_current_window_manager(), user_data);
|
reload_key_entries (wm_common_get_current_window_manager(), user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
key_theme_changed (GConfClient *client,
|
|
||||||
guint cnxn_id,
|
|
||||||
GConfEntry *entry,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GtkWidget *omenu = (GtkWidget *) user_data;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *menu_item;
|
|
||||||
GConfValue *value;
|
|
||||||
const gchar *new_key_theme;
|
|
||||||
GList *list;
|
|
||||||
gint i = 0;
|
|
||||||
|
|
||||||
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (omenu));
|
|
||||||
value = gconf_entry_get_value (entry);
|
|
||||||
|
|
||||||
g_return_if_fail (value != NULL);
|
|
||||||
|
|
||||||
new_key_theme = gconf_value_get_string (value);
|
|
||||||
|
|
||||||
for (list = GTK_MENU_SHELL (menu)->children; list; list = list->next, i++)
|
|
||||||
{
|
|
||||||
gchar *text;
|
|
||||||
|
|
||||||
menu_item = GTK_WIDGET (list->data);
|
|
||||||
text = g_object_get_data (G_OBJECT (menu_item), LABEL_DATA);
|
|
||||||
if (! strcmp (text, new_key_theme))
|
|
||||||
{
|
|
||||||
if (gtk_option_menu_get_history (GTK_OPTION_MENU (omenu)) != i)
|
|
||||||
gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We didn't find our theme. Add it to our list. */
|
|
||||||
menu_item = make_key_theme_menu_item (new_key_theme);
|
|
||||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
|
||||||
gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
cb_check_for_uniqueness (GtkTreeModel *model,
|
cb_check_for_uniqueness (GtkTreeModel *model,
|
||||||
GtkTreePath *path,
|
GtkTreePath *path,
|
||||||
|
@ -833,49 +748,6 @@ accel_cleared_callback (GtkCellRendererText *cell,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
theme_changed_func (gpointer uri,
|
|
||||||
GladeXML *dialog)
|
|
||||||
{
|
|
||||||
GConfClient *client;
|
|
||||||
GtkWidget *omenu;
|
|
||||||
GtkWidget *menu;
|
|
||||||
GtkWidget *menu_item;
|
|
||||||
GConfEntry *entry;
|
|
||||||
GList *key_theme_list;
|
|
||||||
GList *list;
|
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
|
||||||
key_theme_list = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2_KEYBINDING);
|
|
||||||
|
|
||||||
omenu = WID ("key_theme_omenu");
|
|
||||||
menu = gtk_menu_new ();
|
|
||||||
for (list = key_theme_list; list; list = list->next)
|
|
||||||
{
|
|
||||||
GnomeThemeInfo *info = list->data;
|
|
||||||
|
|
||||||
if (! info->has_keybinding)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
menu_item = make_key_theme_menu_item (info->name);
|
|
||||||
if (!strcmp (info->name, "Default"))
|
|
||||||
/* Put default first, always */
|
|
||||||
gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menu_item);
|
|
||||||
else
|
|
||||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_widget_show (menu);
|
|
||||||
gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
|
|
||||||
|
|
||||||
/* Initialize the option menu */
|
|
||||||
entry = gconf_client_get_entry (client,
|
|
||||||
KEY_THEME_KEY,
|
|
||||||
NULL, TRUE, NULL);
|
|
||||||
|
|
||||||
key_theme_changed (client, 0, entry, omenu);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -945,50 +817,12 @@ static void
|
||||||
setup_dialog (GladeXML *dialog)
|
setup_dialog (GladeXML *dialog)
|
||||||
{
|
{
|
||||||
GConfClient *client;
|
GConfClient *client;
|
||||||
GList *key_theme_list;
|
|
||||||
GtkCellRenderer *renderer;
|
GtkCellRenderer *renderer;
|
||||||
GtkTreeViewColumn *column;
|
GtkTreeViewColumn *column;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
gboolean found_keys = FALSE;
|
|
||||||
GList *list;
|
|
||||||
|
|
||||||
client = gconf_client_get_default ();
|
client = gconf_client_get_default ();
|
||||||
|
|
||||||
key_theme_list = gnome_theme_info_find_by_type (GNOME_THEME_GTK_2_KEYBINDING);
|
|
||||||
|
|
||||||
for (list = key_theme_list; list; list = list->next)
|
|
||||||
{
|
|
||||||
GnomeThemeInfo *info = list->data;
|
|
||||||
if (info->has_keybinding)
|
|
||||||
{
|
|
||||||
found_keys = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (! found_keys)
|
|
||||||
{
|
|
||||||
GtkWidget *msg_dialog = gtk_message_dialog_new (NULL, 0,
|
|
||||||
GTK_MESSAGE_ERROR,
|
|
||||||
GTK_BUTTONS_OK,
|
|
||||||
_("Unable to find any keyboard themes. This means your GTK+ "
|
|
||||||
"installation has been incompletely installed."));
|
|
||||||
gtk_dialog_run (GTK_DIALOG (msg_dialog));
|
|
||||||
gtk_widget_destroy (msg_dialog);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
theme_changed_func (NULL, dialog);
|
|
||||||
gnome_theme_info_register_theme_change ((GFunc) theme_changed_func, dialog);
|
|
||||||
gconf_client_add_dir (client, "/desktop/gnome/interface", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
|
||||||
gconf_client_notify_add (client,
|
|
||||||
KEY_THEME_KEY,
|
|
||||||
(GConfClientNotifyFunc) &key_theme_changed,
|
|
||||||
WID ("key_theme_omenu"), NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
g_signal_connect (GTK_TREE_VIEW (WID ("shortcut_treeview")),
|
g_signal_connect (GTK_TREE_VIEW (WID ("shortcut_treeview")),
|
||||||
"button_press_event",
|
"button_press_event",
|
||||||
G_CALLBACK (start_editing_cb), dialog),
|
G_CALLBACK (start_editing_cb), dialog),
|
||||||
|
|
|
@ -64,90 +64,12 @@
|
||||||
<property name="homogeneous">False</property>
|
<property name="homogeneous">False</property>
|
||||||
<property name="spacing">12</property>
|
<property name="spacing">12</property>
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHBox" id="shortcut_hbox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="homogeneous">False</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label8">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">_Text editing shortcuts:</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">key_theme_omenu</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkOptionMenu" id="key_theme_omenu">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="history">-1</property>
|
|
||||||
<accessibility>
|
|
||||||
<atkproperty name="AtkObject::accessible_description" translatable="yes">Click for a list of keyboard navigation schemes.</atkproperty>
|
|
||||||
</accessibility>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkMenu" id="menu1">
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkVBox" id="shortcuts_vbox">
|
<widget class="GtkVBox" id="shortcuts_vbox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="homogeneous">False</property>
|
<property name="homogeneous">False</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label11">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes">_Desktop shortcuts:</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">shortcut_treeview</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkScrolledWindow" id="actions_swindow">
|
<widget class="GtkScrolledWindow" id="actions_swindow">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -162,7 +84,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="headers_visible">True</property>
|
<property name="headers_visible">True</property>
|
||||||
<property name="rules_hint">False</property>
|
<property name="rules_hint">True</property>
|
||||||
<property name="reorderable">False</property>
|
<property name="reorderable">False</property>
|
||||||
<property name="enable_search">True</property>
|
<property name="enable_search">True</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -202,7 +124,7 @@
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="label12">
|
<widget class="GtkLabel" id="label12">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="label" translatable="yes">To edit a shortcut, click on the corresponding row and type a new accelerator, or press backspace to clear.</property>
|
<property name="label" translatable="yes">To edit a shortcut key, click on the corresponding row and type a new accelerator, or press backspace to clear.</property>
|
||||||
<property name="use_underline">False</property>
|
<property name="use_underline">False</property>
|
||||||
<property name="use_markup">False</property>
|
<property name="use_markup">False</property>
|
||||||
<property name="justify">GTK_JUSTIFY_FILL</property>
|
<property name="justify">GTK_JUSTIFY_FILL</property>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue