vinagre r344 - in trunk: . data src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r344 - in trunk: . data src
- Date: Thu, 29 May 2008 21:08:16 +0000 (UTC)
Author: jwendell
Date: Thu May 29 21:08:16 2008
New Revision: 344
URL: http://svn.gnome.org/viewvc/vinagre?rev=344&view=rev
Log:
2008-05-29 Jonh Wendell <jwendell gnome org>
Added a gconf key to disable menu shortcuts.
Modified:
trunk/ChangeLog
trunk/data/vinagre.schemas.in
trunk/src/vinagre-prefs.c
trunk/src/vinagre-window.c
Modified: trunk/data/vinagre.schemas.in
==============================================================================
--- trunk/data/vinagre.schemas.in (original)
+++ trunk/data/vinagre.schemas.in Thu May 29 21:08:16 2008
@@ -61,5 +61,17 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/vinagre/show_accels</key>
+ <applyto>/apps/vinagre/show_accels</applyto>
+ <owner>vinagre</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Whether we should show the menu accelerators (shortcut keys)</short>
+ <long>Set to "false" to disable menu shortcuts. Set to "true" to enable them. Note that if they are enabled, those keys will be intercepted by the menu and will not be sent to the remote host.</long>
+ </locale>
+ </schema>
+
</schemalist>
</gconfschemafile>
Modified: trunk/src/vinagre-prefs.c
==============================================================================
--- trunk/src/vinagre-prefs.c (original)
+++ trunk/src/vinagre-prefs.c Thu May 29 21:08:16 2008
@@ -28,6 +28,7 @@
#define VM_TOOLBAR_VISIBLE VINAGRE_BASE_KEY "/toolbar_visible"
#define VM_STATUSBAR_VISIBLE VINAGRE_BASE_KEY "/statusbar_visible"
#define VM_SIDE_PANEL_VISIBLE VINAGRE_BASE_KEY "/side_pane_visible"
+#define VM_SHOW_ACCELS VINAGRE_BASE_KEY "/show_accels"
#define VM_WINDOW_STATE VINAGRE_BASE_KEY "/window_state"
#define VM_WINDOW_WIDTH VINAGRE_BASE_KEY "/window_width"
@@ -51,7 +52,8 @@
PROP_WINDOW_STATE,
PROP_WINDOW_WIDTH,
PROP_WINDOW_HEIGHT,
- PROP_SIDE_PANEL_SIZE
+ PROP_SIDE_PANEL_SIZE,
+ PROP_SHOW_ACCELS
};
G_DEFINE_TYPE (VinagrePrefs, vinagre_prefs, G_TYPE_OBJECT);
@@ -145,6 +147,15 @@
}
static void
+vinagre_prefs_show_accels_notify (GConfClient *client,
+ guint cnx_id,
+ GConfEntry *entry,
+ VinagrePrefs *prefs)
+{
+ g_object_notify (G_OBJECT (prefs), "show-accels");
+}
+
+static void
vinagre_prefs_init (VinagrePrefs *prefs)
{
prefs->priv = G_TYPE_INSTANCE_GET_PRIVATE (prefs, VINAGRE_TYPE_PREFS, VinagrePrefsPrivate);
@@ -162,6 +173,10 @@
VM_ALWAYS_SHOW_TABS,
(GConfClientNotifyFunc) vinagre_prefs_always_show_tabs_notify,
prefs, NULL, NULL);
+ gconf_client_notify_add (prefs->priv->gconf_client,
+ VM_SHOW_ACCELS,
+ (GConfClientNotifyFunc) vinagre_prefs_show_accels_notify,
+ prefs, NULL, NULL);
}
@@ -213,6 +228,9 @@
case PROP_SIDE_PANEL_SIZE:
vinagre_prefs_set_int (prefs, VM_SIDE_PANEL_SIZE, g_value_get_int (value));
break;
+ case PROP_SHOW_ACCELS:
+ vinagre_prefs_set_bool (prefs, VM_SHOW_ACCELS, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -253,6 +271,9 @@
case PROP_SIDE_PANEL_SIZE:
g_value_set_int (value, vinagre_prefs_get_int (prefs, VM_SIDE_PANEL_SIZE, 200));
break;
+ case PROP_SHOW_ACCELS:
+ g_value_set_boolean (value, vinagre_prefs_get_bool (prefs, VM_SHOW_ACCELS, TRUE));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -334,6 +355,13 @@
"The width of side panel",
100, G_MAXINT, 200,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_SHOW_ACCELS,
+ g_param_spec_boolean ("show-accels",
+ "Show menu accelerators",
+ "Whether we should show the menu accelerators (keyboard shortcuts)",
+ TRUE,
+ G_PARAM_READWRITE));
}
/* vim: ts=8 */
Modified: trunk/src/vinagre-window.c
==============================================================================
--- trunk/src/vinagre-window.c (original)
+++ trunk/src/vinagre-window.c Thu May 29 21:08:16 2008
@@ -340,6 +340,19 @@
}
static void
+show_hide_accels (VinagreWindow *window)
+{
+ gboolean show_accels;
+
+ g_object_get (vinagre_prefs_get_default (),
+ "show-accels", &show_accels,
+ NULL);
+ g_object_set (gtk_settings_get_default (),
+ "gtk-enable-accels", show_accels,
+ NULL);
+}
+
+static void
create_menu_bar_and_toolbar (VinagreWindow *window,
GtkWidget *main_box)
{
@@ -491,6 +504,12 @@
"changed",
G_CALLBACK (recent_manager_changed),
window);
+
+ g_signal_connect_swapped (vinagre_prefs_get_default (),
+ "notify::show-accels",
+ G_CALLBACK (show_hide_accels),
+ window);
+ show_hide_accels (window);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]