[vinagre/plugin] Added a VinagreConnection parameter to vinagre_plugin_get_connect_widget().



commit ecebc76f9d88c83b182a44d793d087fd75fcc1a3
Author: Jonh Wendell <jwendell gnome org>
Date:   Fri Jul 24 09:08:31 2009 -0300

    Added a VinagreConnection parameter to vinagre_plugin_get_connect_widget().
    
    This might be useful to set initial state of controls in the widget,
    to be implemented in plugins

 vinagre/vinagre-plugin.c |   17 +++++++++++++----
 vinagre/vinagre-plugin.h |    6 ++++--
 2 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/vinagre/vinagre-plugin.c b/vinagre/vinagre-plugin.c
index 460e813..5baa545 100644
--- a/vinagre/vinagre-plugin.c
+++ b/vinagre/vinagre-plugin.c
@@ -112,6 +112,13 @@ is_configurable (VinagrePlugin *plugin)
 		create_configure_dialog);
 }
 
+static GtkWidget *
+default_get_connect_widget (VinagrePlugin     *plugin,
+			    VinagreConnection *initial_settings)
+{
+  return NULL;
+}
+
 static void
 vinagre_plugin_get_property (GObject    *object,
 			   guint       prop_id,
@@ -179,7 +186,7 @@ vinagre_plugin_class_init (VinagrePluginClass *klass)
 	klass->new_connection_from_file = default_new_connection_from_file;
 	klass->get_mdns_service = default_get_protocol;
 	klass->new_tab = default_new_tab;
-	klass->get_connect_widget = create_configure_dialog;
+	klass->get_connect_widget = default_get_connect_widget;
 	
 	klass->create_configure_dialog = create_configure_dialog;
 	klass->is_configurable = is_configurable;
@@ -507,17 +514,19 @@ vinagre_plugin_new_tab (VinagrePlugin     *plugin,
 
 /**
  * vinagre_plugin_get_connect_widget
- * @plugin: a #VinagreTab
+ * @plugin: a #VinagrePlugin
+ * @initial_settings: a #VinagreConnection object, or NULL
  *
  *
  * Returns: a widget to be put inside connect dialog
  */
 GtkWidget *
-vinagre_plugin_get_connect_widget (VinagrePlugin *plugin)
+vinagre_plugin_get_connect_widget (VinagrePlugin     *plugin,
+				   VinagreConnection *initial_settings)
 {
   g_return_val_if_fail (VINAGRE_IS_PLUGIN (plugin), NULL);
 
-  return VINAGRE_PLUGIN_GET_CLASS (plugin)->get_connect_widget (plugin);
+  return VINAGRE_PLUGIN_GET_CLASS (plugin)->get_connect_widget (plugin, initial_settings);
 }
 
 /* vim: set ts=8: */
diff --git a/vinagre/vinagre-plugin.h b/vinagre/vinagre-plugin.h
index 5e78174..8239df4 100644
--- a/vinagre/vinagre-plugin.h
+++ b/vinagre/vinagre-plugin.h
@@ -87,7 +87,8 @@ struct _VinagrePluginClass
 						 VinagreConnection *conn,
 						 VinagreWindow     *window);
 
-  GtkWidget 	*(*get_connect_widget)		(VinagrePlugin     *plugin);
+  GtkWidget 	*(*get_connect_widget)		(VinagrePlugin     *plugin,
+						 VinagreConnection *initial_settings);
 
   /* Plugins should not override this, it's handled automatically by
      the VinagrePluginClass */
@@ -134,7 +135,8 @@ GtkWidget 	*vinagre_plugin_new_tab			(VinagrePlugin     *plugin,
 							 VinagreConnection *conn,
 							 VinagreWindow     *window);
 
-GtkWidget 	*vinagre_plugin_get_connect_widget	(VinagrePlugin     *plugin);
+GtkWidget 	*vinagre_plugin_get_connect_widget	(VinagrePlugin     *plugin,
+							 VinagreConnection *initial_settings);
 
 /**
  * VINAGRE_PLUGIN_REGISTER_TYPE_WITH_CODE(PluginName, plugin_name, CODE):



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