[vinagre/new-gtk-vnc] Added a scaled mode command line option. Closes 591340.



commit 72ef7c5a947c2507606efb3e8bebedae79799730
Author: Jonh Wendell <jwendell gnome org>
Date:   Mon Aug 10 17:41:36 2009 -0300

    Added a scaled mode command line option. Closes 591340.

 plugins/vnc/vinagre-vnc-connection.c |    5 ++++-
 plugins/vnc/vinagre-vnc-connection.h |    2 ++
 plugins/vnc/vinagre-vnc-plugin.c     |   31 +++++++++++++++++++++++++++++--
 3 files changed, 35 insertions(+), 3 deletions(-)
---
diff --git a/plugins/vnc/vinagre-vnc-connection.c b/plugins/vnc/vinagre-vnc-connection.c
index bdb2fcc..d8f17d4 100644
--- a/plugins/vnc/vinagre-vnc-connection.c
+++ b/plugins/vnc/vinagre-vnc-connection.c
@@ -162,7 +162,10 @@ vnc_parse_item (VinagreConnection *conn, xmlNode *root)
       if (!xmlStrcmp(curr->name, (const xmlChar *)"view_only"))
 	vinagre_vnc_connection_set_view_only (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
       else if (!xmlStrcmp(curr->name, (const xmlChar *)"scaling"))
-	vinagre_vnc_connection_set_scaling (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
+	{
+	  if (!scaling_command_line)
+	    vinagre_vnc_connection_set_scaling (vnc_conn, vinagre_utils_parse_boolean ((const gchar *)s_value));
+	}
 
       xmlFree (s_value);
     }
diff --git a/plugins/vnc/vinagre-vnc-connection.h b/plugins/vnc/vinagre-vnc-connection.h
index 347abe5..5d82786 100644
--- a/plugins/vnc/vinagre-vnc-connection.h
+++ b/plugins/vnc/vinagre-vnc-connection.h
@@ -26,6 +26,8 @@
 
 G_BEGIN_DECLS
 
+gboolean scaling_command_line;
+
 #define VINAGRE_TYPE_VNC_CONNECTION             (vinagre_vnc_connection_get_type ())
 #define VINAGRE_VNC_CONNECTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), VINAGRE_TYPE_VNC_CONNECTION, VinagreVncConnection))
 #define VINAGRE_VNC_CONNECTION_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), VINAGRE_TYPE_VNC_CONNECTION, VinagreVncConnectionClass))
diff --git a/plugins/vnc/vinagre-vnc-plugin.c b/plugins/vnc/vinagre-vnc-plugin.c
index 939eb05..b6b111c 100644
--- a/plugins/vnc/vinagre-vnc-plugin.c
+++ b/plugins/vnc/vinagre-vnc-plugin.c
@@ -59,12 +59,33 @@ impl_update_ui (VinagrePlugin *plugin,
   vinagre_debug_message (DEBUG_PLUGINS, "VinagreVncPlugin Update UI");
 }
 
+static const GOptionEntry vinagre_vnc_args[] =
+{
+  { "vnc-scale", 0, 0, G_OPTION_ARG_NONE, &scaling_command_line,
+  /* Translators: this is a command line option (run vinagre --help) */
+  N_("Enable scaled mode"), 0 },
+  { NULL }
+};
+
 static GOptionGroup *
 impl_get_context_group (VinagrePlugin *plugin)
 {
+  GOptionGroup *group;
+
   vinagre_debug_message (DEBUG_PLUGINS, "VinagreVncPlugin Get Context Group");
 
-  return vnc_display_get_option_group ();
+  scaling_command_line = FALSE;
+  group = g_option_group_new ("vnc",
+			      /* Translators: this is a command line option (run vinagre --help) */
+			      _("VNC Options:"),
+			      /* Translators: this is a command line option (run vinagre --help) */
+			      _("Show VNC Options"),
+			      NULL,
+			      NULL);
+  g_option_group_add_entries (group, vinagre_vnc_args);
+  g_option_group_add_entries (group, vnc_display_get_option_entries ());
+
+  return group;
 }
 
 static const gchar *
@@ -94,7 +115,13 @@ impl_get_mdns_service (VinagrePlugin *plugin)
 static VinagreConnection *
 impl_new_connection (VinagrePlugin *plugin)
 {
-  return vinagre_vnc_connection_new ();
+  VinagreConnection *conn;
+
+  conn = vinagre_vnc_connection_new ();
+  vinagre_vnc_connection_set_scaling (VINAGRE_VNC_CONNECTION (conn),
+				      scaling_command_line);
+
+  return conn;
 }
 
 static VinagreConnection *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]