vinagre r292 - in trunk: . data src
- From: jwendell svn gnome org
- To: svn-commits-list gnome org
- Subject: vinagre r292 - in trunk: . data src
- Date: Thu, 17 Apr 2008 00:44:30 +0100 (BST)
Author: jwendell
Date: Thu Apr 17 00:44:30 2008
New Revision: 292
URL: http://svn.gnome.org/viewvc/vinagre?rev=292&view=rev
Log:
2008-04-16 Jonh Wendell <jwendell gnome org>
Provide a 'read only' mode. Closes #509945.
Modified:
trunk/ChangeLog
trunk/data/vinagre-ui.xml
trunk/src/vinagre-commands.c
trunk/src/vinagre-commands.h
trunk/src/vinagre-tab.c
trunk/src/vinagre-tab.h
trunk/src/vinagre-ui.h
trunk/src/vinagre-window-private.h
trunk/src/vinagre-window.c
Modified: trunk/data/vinagre-ui.xml
==============================================================================
--- trunk/data/vinagre-ui.xml (original)
+++ trunk/data/vinagre-ui.xml Thu Apr 17 00:44:30 2008
@@ -42,6 +42,7 @@
<separator/>
<menuitem name="ViewFullScreenMenu" action="ViewFullScreen"/>
<menuitem name="ViewScalingMenu" action="ViewScaling"/>
+ <menuitem name="ViewReadOnlyMenu" action="ViewReadOnly"/>
</menu>
<menu name="BookmarksMenu" action="Bookmarks">
Modified: trunk/src/vinagre-commands.c
==============================================================================
--- trunk/src/vinagre-commands.c (original)
+++ trunk/src/vinagre-commands.c Thu Apr 17 00:44:30 2008
@@ -231,6 +231,21 @@
}
}
+void
+vinagre_cmd_view_readonly (GtkAction *action,
+ VinagreWindow *window)
+{
+ gboolean active;
+ VinagreTab *tab;
+
+ tab = vinagre_window_get_active_tab (window);
+ if (!tab)
+ return;
+
+ active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
+ vinagre_tab_set_readonly (tab, active);
+}
+
/* Bookmarks Menu */
void
vinagre_cmd_open_bookmark (VinagreWindow *window,
Modified: trunk/src/vinagre-commands.h
==============================================================================
--- trunk/src/vinagre-commands.h (original)
+++ trunk/src/vinagre-commands.h Thu Apr 17 00:44:30 2008
@@ -52,6 +52,8 @@
VinagreWindow *window);
void vinagre_cmd_view_fullscreen (GtkAction *action,
VinagreWindow *window);
+void vinagre_cmd_view_readonly (GtkAction *action,
+ VinagreWindow *window);
void vinagre_cmd_open_bookmark (VinagreWindow *window,
VinagreConnection *conn);
Modified: trunk/src/vinagre-tab.c
==============================================================================
--- trunk/src/vinagre-tab.c (original)
+++ trunk/src/vinagre-tab.c Thu Apr 17 00:44:30 2008
@@ -814,6 +814,20 @@
return vnc_display_get_scaling (VNC_DISPLAY (tab->priv->vnc));
}
+void
+vinagre_tab_set_readonly (VinagreTab *tab, gboolean active) {
+ g_return_if_fail (VINAGRE_IS_TAB (tab));
+
+ vnc_display_set_read_only (VNC_DISPLAY (tab->priv->vnc), active);
+}
+
+gboolean
+vinagre_tab_get_readonly (VinagreTab *tab) {
+ g_return_if_fail (VINAGRE_IS_TAB (tab));
+
+ return vnc_display_get_read_only (VNC_DISPLAY (tab->priv->vnc));
+}
+
VinagreTabState
vinagre_tab_get_state (VinagreTab *tab)
{
Modified: trunk/src/vinagre-tab.h
==============================================================================
--- trunk/src/vinagre-tab.h (original)
+++ trunk/src/vinagre-tab.h Thu Apr 17 00:44:30 2008
@@ -89,6 +89,8 @@
gboolean vinagre_tab_set_scaling (VinagreTab *tab, gboolean active);
gboolean vinagre_tab_get_scaling (VinagreTab *tab);
+void vinagre_tab_set_readonly (VinagreTab *tab, gboolean active);
+gboolean vinagre_tab_get_readonly (VinagreTab *tab);
VinagreTabState vinagre_tab_get_state (VinagreTab *tab);
Modified: trunk/src/vinagre-ui.h
==============================================================================
--- trunk/src/vinagre-ui.h (original)
+++ trunk/src/vinagre-ui.h Thu Apr 17 00:44:30 2008
@@ -88,7 +88,10 @@
{
{ "ViewScaling", NULL, N_("S_caling"), NULL,
N_("Fit the remote screen into the current window size"),
- G_CALLBACK (vinagre_cmd_view_scaling), FALSE }
+ G_CALLBACK (vinagre_cmd_view_scaling), FALSE },
+ { "ViewReadOnly", NULL, N_("_Read only"), NULL,
+ N_("Disable mouse and keyboard activities"),
+ G_CALLBACK (vinagre_cmd_view_readonly), FALSE }
};
static const GtkToggleActionEntry vinagre_always_sensitive_toggle_menu_entries[] =
Modified: trunk/src/vinagre-window-private.h
==============================================================================
--- trunk/src/vinagre-window-private.h (original)
+++ trunk/src/vinagre-window-private.h Thu Apr 17 00:44:30 2008
@@ -46,7 +46,6 @@
GtkActionGroup *bookmarks_list_action_group;
GtkActionGroup *recent_action_group;
GtkAction *recent_action;
- GtkAction *scaling_action;
guint bookmarks_list_menu_ui_id;
guint recents_menu_ui_id;
Modified: trunk/src/vinagre-window.c
==============================================================================
--- trunk/src/vinagre-window.c (original)
+++ trunk/src/vinagre-window.c Thu Apr 17 00:44:30 2008
@@ -391,7 +391,6 @@
gtk_ui_manager_insert_action_group (manager, action_group, 0);
g_object_unref (action_group);
window->priv->machine_connected_action_group = action_group;
- window->priv->scaling_action = gtk_action_group_get_action (action_group, "ViewScaling");
action = gtk_action_group_get_action (action_group, "ViewFullScreen");
g_object_set (action, "is_important", TRUE, NULL);
@@ -822,17 +821,31 @@
}
static void
-update_toggle_machine_items (VinagreWindow *window) {
+update_toggle_machine_items (VinagreWindow *window)
+{
+ GtkAction *action;
+
g_return_if_fail (VINAGRE_IS_WINDOW (window));
if (window->priv->active_tab == NULL)
{
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->priv->scaling_action), FALSE);
+ action = gtk_action_group_get_action (window->priv->machine_connected_action_group, "ViewScaling");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
+
+ action = gtk_action_group_get_action (window->priv->machine_connected_action_group, "ViewReadOnly");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), FALSE);
+
return;
}
- gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (window->priv->scaling_action),
+ action = gtk_action_group_get_action (window->priv->machine_connected_action_group, "ViewScaling");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
vinagre_tab_get_scaling (VINAGRE_TAB (window->priv->active_tab)));
+
+ action = gtk_action_group_get_action (window->priv->machine_connected_action_group, "ViewReadOnly");
+ gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
+ vinagre_tab_get_readonly (VINAGRE_TAB (window->priv->active_tab)));
+
}
static void
@@ -841,9 +854,14 @@
guint page_num,
VinagreWindow *window)
{
+ GtkNotebook *nb;
+
g_return_if_fail (VINAGRE_IS_WINDOW (window));
- window->priv->active_tab = gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->priv->notebook), gtk_notebook_get_current_page (GTK_NOTEBOOK (window->priv->notebook)));
+ nb = GTK_NOTEBOOK (window->priv->notebook);
+
+ window->priv->active_tab = gtk_notebook_get_nth_page (nb,
+ gtk_notebook_get_current_page (nb));
if (!window->priv->active_tab && window->priv->fullscreen)
vinagre_window_toggle_fullscreen (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]