--- NetworkManager-0.8.996/network-manager-applet-0.8.996/po/POTFILES.in	2011-03-08 17:52:33.000000000 -0500
+++ hacked/network-manager-applet-0.8.996/po/POTFILES.in	2011-03-11 08:51:54.199794536 -0500
@@ -15,6 +15,7 @@
 [type: gettext/glade]src/applet.ui
 src/applet.h
 src/connection-editor/ce-page.c
+[type: gettext/glade]src/connection-editor/ce-create-any.ui
 [type: gettext/glade]src/connection-editor/ce-page-dsl.ui
 [type: gettext/glade]src/connection-editor/ce-page-ip4.ui
 [type: gettext/glade]src/connection-editor/ce-page-ip6.ui
--- NetworkManager-0.8.996/network-manager-applet-0.8.996/src/connection-editor/main.c	2010-09-28 16:01:07.000000000 -0400
+++ hacked/network-manager-applet-0.8.996/src/connection-editor/main.c	2011-03-11 08:51:15.880273598 -0500
@@ -40,6 +40,8 @@
 #include <nm-setting-gsm.h>
 #include <nm-setting-cdma.h>
 #include "nm-connection-list.h"
+#include "nm-connection-editor.h"
+#include "page-wired.h"
 
 static GMainLoop *loop = NULL;
 
@@ -216,6 +218,74 @@
 	return success;
 }
 
+static void
+cancel_cb (GtkWidget *button, NMConnectionList *list)
+{
+        GtkWidget *toplevel;
+
+        toplevel = gtk_widget_get_toplevel (button);
+
+        gtk_widget_destroy (toplevel);
+
+        g_signal_emit_by_name (list, "editing-done", 0, 0);
+}
+
+static void
+create_cb (GtkWidget *button, NMConnectionList *list)
+{
+        GtkWidget *toplevel;
+        GType ctype = 0;
+        GtkBuilder *builder;
+        GtkWidget *combo;
+        GtkTreeIter iter;
+        GtkTreeModel *model;
+        gchar *type;
+
+        toplevel = gtk_widget_get_toplevel (button);
+
+        builder = (GtkBuilder*)g_object_get_data (G_OBJECT (toplevel), "builder");
+
+        combo = (GtkWidget*) gtk_builder_get_object (builder, "combobox1");
+        gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
+        model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
+        gtk_tree_model_get (model, &iter, 0, &type);
+
+        ctype = nm_connection_lookup_setting_type (type);
+
+        g_free (type);
+        gtk_widget_destroy (toplevel);
+
+        nm_connection_list_create (list, ctype);
+}
+
+static void
+create_any_type (NMConnectionList *list)
+{
+        GtkWidget *window;
+        GtkWidget *create_button;
+        GtkWidget *cancel_button;
+        GtkBuilder *builder;
+        GError *error;
+
+        builder = gtk_builder_new ();
+
+        error = NULL;
+        if (!gtk_builder_add_from_file (builder, UIDIR "/ce-create-any.ui", &error)) {
+                g_print ("Failed to load ce-create-any.ui: %s\n", error->message);
+                g_error_free (error);
+        }
+
+        window = (GtkWidget*)gtk_builder_get_object (builder, "window1");
+        g_object_set_data (G_OBJECT (window), "builder", builder);
+
+        cancel_button = (GtkWidget*)gtk_builder_get_object (builder, "cancel_button");
+        create_button = (GtkWidget*)gtk_builder_get_object (builder, "create_button");
+
+        g_signal_connect (cancel_button, "clicked", G_CALLBACK (cancel_cb), list);
+        g_signal_connect (create_button, "clicked", G_CALLBACK (create_cb), list);
+        gtk_window_present (GTK_WINDOW (window));
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -224,12 +294,17 @@
 	NMConnectionList *list;
 	DBusGConnection *bus;
 	char *type = NULL;
+        gboolean create = FALSE;
+        gboolean create_any = FALSE;
+        char *uuid = NULL;
 	GType ctype;
 	NMCEService *service = NULL;
 	DBusGProxy *proxy = NULL;
 
 	GOptionEntry entries[] = {
 		{ ARG_TYPE, 0, 0, G_OPTION_ARG_STRING, &type, "Type of connection to show at launch", NM_SETTING_WIRED_SETTING_NAME },
+		{ "create", 0, 0, G_OPTION_ARG_NONE, &create, "Create a new connection", NULL },
+		{ "edit", 0, 0, G_OPTION_ARG_STRING, &uuid, "Edit an existing connection", "UUID" },
 		{ NULL }
 	};
 
@@ -253,6 +328,9 @@
 
 	g_option_context_free (opt_ctx);
 
+        if (create && !type)
+                create_any = TRUE;
+
 	/* Inits the dbus-glib type system too */
 	bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
 	if (bus) {
@@ -285,8 +363,21 @@
 	if (proxy)
 		service = nm_ce_service_new (bus, proxy, list);
 
-	g_signal_connect_swapped (G_OBJECT (list), "done", G_CALLBACK (g_main_loop_quit), loop);
-	nm_connection_list_run (list);
+        if (create_any) {
+                g_signal_connect_swapped (G_OBJECT (list), "editing-done", G_CALLBACK (g_main_loop_quit), loop);
+                create_any_type (list);
+        } else if (create) {
+                g_signal_connect_swapped (G_OBJECT (list), "editing-done", G_CALLBACK (g_main_loop_quit), loop);
+                nm_connection_list_create (list, ctype);
+        }
+        else if (uuid) {
+                g_signal_connect_swapped (G_OBJECT (list), "editing-done", G_CALLBACK (g_main_loop_quit), loop);
+                nm_connection_list_edit (list, uuid);
+        }
+        else {
+        	g_signal_connect_swapped (G_OBJECT (list), "done", G_CALLBACK (g_main_loop_quit), loop);
+        	nm_connection_list_run (list);
+        }
 
 	setup_signals ();
 	g_main_loop_run (loop);
--- NetworkManager-0.8.996/network-manager-applet-0.8.996/src/connection-editor/nm-connection-list.h	2011-03-08 17:52:34.000000000 -0500
+++ hacked/network-manager-applet-0.8.996/src/connection-editor/nm-connection-list.h	2011-03-11 03:46:12.976074643 -0500
@@ -40,6 +40,8 @@
 	GHashTable *editors;
 	GSList *treeviews;
 
+        GHashTable *actions;
+
 	NMClient *nm_client;
 	NMRemoteSettings *settings;
 
@@ -59,6 +61,7 @@
 
 	/* Signals */
 	void (*done)  (NMConnectionList *list, gint result);
+	void (*editing_done)  (NMConnectionList *list, gint result);
 } NMConnectionListClass;
 
 GType             nm_connection_list_get_type (void);
@@ -69,5 +72,7 @@
 void              nm_connection_list_set_type (NMConnectionList *list, GType ctype);
 
 void              nm_connection_list_present (NMConnectionList *list);
+void              nm_connection_list_create (NMConnectionList *list, GType ctype);
+void              nm_connection_list_edit (NMConnectionList *list, const gchar *uuid);
 
 #endif
--- NetworkManager-0.8.996/network-manager-applet-0.8.996/src/connection-editor/nm-connection-list.c	2011-03-08 17:52:34.000000000 -0500
+++ hacked/network-manager-applet-0.8.996/src/connection-editor/nm-connection-list.c	2011-03-11 04:02:12.719076204 -0500
@@ -33,6 +33,7 @@
 #include <nm-setting-connection.h>
 #include <nm-connection.h>
 #include <nm-setting.h>
+#include <nm-setting-connection.h>
 #include <nm-setting-wired.h>
 #include <nm-setting-wireless.h>
 #include <nm-setting-vpn.h>
@@ -60,6 +61,7 @@
 
 enum {
 	LIST_DONE,
+        EDITING_DONE,
 	LIST_LAST_SIGNAL
 };
 
@@ -128,6 +130,27 @@
 	return connection;
 }
 
+static NMConnection *
+get_connection (NMRemoteSettings *settings, const gchar *id)
+{
+        const gchar *uuid;
+	NMConnection *connection = NULL;
+        GSList *list, *l;
+
+        list = nm_remote_settings_list_connections (settings);
+        for (l = list; l; l = l->next) {
+                connection = l->data;
+            uuid = nm_connection_get_uuid (connection);
+            if (g_strcmp0 (uuid, id) == 0) {
+                g_slist_free (list);
+                return connection;
+              }
+        }
+
+        g_slist_free (list);
+        return NULL;
+}
+
 #define TV_TYPE_TAG "ctype"
 
 static GtkTreeView *
@@ -528,8 +551,10 @@
 	}
 
 	g_hash_table_remove (info->list->editors, nm_connection_editor_get_connection (editor));
+        g_signal_emit (info->list, list_signals[EDITING_DONE], 0, 0);
 }
 
+
 static void
 really_add_connection (NMConnection *connection,
                        gboolean canceled,
@@ -666,6 +691,7 @@
 			                       info);
 			g_error_free (edit_error);
 		}
+                g_signal_emit (info->list, list_signals[EDITING_DONE], 0, 0);
 		break;
 	case GTK_RESPONSE_NONE:
 		/* Show an error dialog if the editor initialization failed */
@@ -676,21 +702,20 @@
 	case GTK_RESPONSE_CANCEL:
 	default:
 		g_hash_table_remove (info->list->editors, connection);
+                g_signal_emit (info->list, list_signals[EDITING_DONE], 0, 0);
 		g_free (info);
 		break;
 	}
 }
 
 static void
-do_edit (ActionInfo *info)
+edit_connection (ActionInfo *info, NMConnection *connection)
 {
-	NMRemoteConnection *connection;
 	NMConnectionEditor *editor;
 	EditInfo *edit_info;
 	GError *error = NULL;
 	const char *message = _("The connection editor dialog could not be initialized due to an unknown error.");
 
-	connection = get_active_connection (info->treeview);
 	g_return_if_fail (connection != NULL);
 
 	/* Don't allow two editors for the same connection */
@@ -720,6 +745,12 @@
 }
 
 static void
+do_edit (ActionInfo *info)
+{
+        edit_connection (info, NM_CONNECTION (get_active_connection (info->treeview)));
+}
+
+static void
 delete_result_cb (NMConnectionList *list,
                   GError *error,
                   gpointer user_data)
@@ -972,6 +1003,9 @@
 	if (list->editors)
 		g_hash_table_destroy (list->editors);
 
+        if (list->actions)
+                g_hash_table_destroy (list->actions);
+
 	if (list->wired_icon)
 		g_object_unref (list->wired_icon);
 	if (list->wireless_icon)
@@ -1013,6 +1047,14 @@
 					  NULL, NULL,
 					  g_cclosure_marshal_VOID__INT,
 					  G_TYPE_NONE, 1, G_TYPE_INT);
+        list_signals[EDITING_DONE] =
+                g_signal_new ("editing-done",
+                                          G_OBJECT_CLASS_TYPE (object_class),
+                                          G_SIGNAL_RUN_FIRST,
+                                          G_STRUCT_OFFSET (NMConnectionListClass, done),
+                                          NULL, NULL,
+                                          g_cclosure_marshal_VOID__INT,
+                                          G_TYPE_NONE, 1, G_TYPE_INT);
 }
 
 static GtkTreeView *
@@ -1072,6 +1114,7 @@
 
 static ActionInfo *
 action_info_new (NMConnectionList *list,
+                 gchar *name,
                  GtkTreeView *treeview,
                  GtkWindow *list_window,
                  GtkWidget *button)
@@ -1079,7 +1122,7 @@
 	ActionInfo *info;
 
 	info = g_malloc0 (sizeof (ActionInfo));
-	g_object_weak_ref (G_OBJECT (list), (GWeakNotify) action_info_free, info);
+        g_hash_table_insert (list->actions, g_strdup (name), info);
 
 	info->list = list;
 	info->treeview = treeview;
@@ -1137,7 +1180,9 @@
 	name = g_strdup_printf ("%s_add", prefix);
 	button = GTK_WIDGET (gtk_builder_get_object (self->gui, name));
 	g_free (name);
-	info = action_info_new (self, treeview, GTK_WINDOW (self->dialog), NULL);
+        name = g_strdup_printf ("%s_add", g_type_name (ctype));
+	info = action_info_new (self, name, treeview, GTK_WINDOW (self->dialog), NULL);
+        g_free (name);
 	g_signal_connect (button, "clicked", G_CALLBACK (add_clicked), info);
 	if (ctype == NM_TYPE_SETTING_VPN) {
 		GHashTable *plugins;
@@ -1158,7 +1203,9 @@
 	g_free (name);
 
 	/* Edit */
-	info = action_info_new (self, treeview, GTK_WINDOW (self->dialog), NULL);
+        name = g_strdup_printf ("%s_edit", g_type_name (ctype));
+	info = action_info_new (self, name, treeview, GTK_WINDOW (self->dialog), NULL);
+        g_free (name);
 	button = ce_polkit_button_new (_("_Edit"),
 	                               _("Edit the selected connection"),
 	                               _("_Edit..."),
@@ -1176,7 +1223,9 @@
 	pk_button_selection_changed_cb (selection, info);
 
 	/* Delete */
-	info = action_info_new (self, treeview, GTK_WINDOW (self->dialog), NULL);
+        name = g_strdup_printf ("%s_delete", g_type_name (ctype));
+	info = action_info_new (self, name, treeview, GTK_WINDOW (self->dialog), NULL);
+        g_free (name);
 	button = ce_polkit_button_new (_("_Delete"),
 	                               _("Delete the selected connection"),
 	                               _("_Delete..."),
@@ -1200,7 +1249,9 @@
 		gboolean import_supported = FALSE;
 		GHashTable *plugins;
 
-		info = action_info_new (self, treeview, GTK_WINDOW (self->dialog), button);
+                name = g_strdup_printf ("%s_import", g_type_name (ctype));
+		info = action_info_new (self, name, treeview, GTK_WINDOW (self->dialog), button);
+                g_free (name);
 		g_signal_connect (button, "clicked", G_CALLBACK (import_vpn_cb), info);
 
 		plugins = vpn_get_plugins (NULL);
@@ -1214,7 +1265,9 @@
 	button = GTK_WIDGET (gtk_builder_get_object (self->gui, name));
 	g_free (name);
 	if (button) {
-		info = action_info_new (self, treeview, GTK_WINDOW (self->dialog), button);
+                name = g_strdup_printf ("%s_export", g_type_name (ctype));
+		info = action_info_new (self, name, treeview, GTK_WINDOW (self->dialog), button);
+                g_free (name);
 		g_signal_connect (button, "clicked", G_CALLBACK (export_vpn_cb), info);
 		g_signal_connect (selection, "changed", G_CALLBACK (vpn_list_selection_changed_cb), info);
 		gtk_widget_set_sensitive (button, FALSE);
@@ -1402,10 +1455,12 @@
 	                  G_CALLBACK (connection_added),
 	                  list);
 
-	add_connection_tabs (list, def_type);
-
 	list->editors = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
 
+        list->actions = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)action_info_free);
+
+	add_connection_tabs (list, def_type);
+
 	list->dialog = GTK_WIDGET (gtk_builder_get_object (list->gui, "NMConnectionList"));
 	if (!list->dialog)
 		goto error;
@@ -1459,6 +1514,91 @@
 	nm_connection_list_present (self);
 }
 
+void
+nm_connection_list_create (NMConnectionList *self, GType ctype)
+{
+        gchar *name = NULL;
+        ActionInfo *info;
+
+        g_return_if_fail (NM_IS_CONNECTION_LIST (self));
+
+        name = g_strdup_printf ("%s_add", g_type_name (ctype));
+        info = g_hash_table_lookup (self->actions, name);
+        g_free (name);
+        if (info == NULL)
+                error_dialog (NULL,
+                              _("Error creating connection"),
+                              _("Don't know how to create '%s' connections"), g_type_name (ctype));
+        else
+              (*(info->new_func)) (GTK_WINDOW (info->list->dialog),
+                                   really_add_connection,
+                                   page_get_connections,
+                                   info);
+}
+
+typedef struct {
+        NMConnectionList *self;
+        const gchar *uuid;
+        gboolean wait;
+} EditData;
+
+static void
+connections_read (NMRemoteSettings *settings, EditData *data)
+{
+        const gchar *type;
+        gchar *name = NULL;
+        GType ctype;
+        ActionInfo *info;
+        NMConnection *connection;
+
+        connection = get_connection (data->self->settings, data->uuid);
+        if (connection) {
+                type = nm_setting_connection_get_connection_type (NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION)));
+                ctype = nm_connection_lookup_setting_type (type);
+                name = g_strdup_printf ("%s_edit", g_type_name (ctype));
+                info = g_hash_table_lookup (data->self->actions, name);
+                g_free (name);
+                if (info == NULL) {
+                        error_dialog (NULL,
+                                      _("Error editing connection"),
+                                      _("Don't know how to edit '%s' connections"), type);
+                        return;
+                }
+
+                edit_connection (info, connection);
+                g_object_unref (connection);
+        }
+        else if (data->wait) {
+                data->wait = FALSE;
+                g_signal_connect (data->self->settings, "connections-read",
+                                  G_CALLBACK (connections_read), data);
+                return;
+        }
+        else {
+                error_dialog (NULL,
+                              _("Error editing connection"),
+                              _("Did not find a connection with UUID '%s'"), data->uuid);
+        }
+
+        g_free (data);
+}
+
+void
+nm_connection_list_edit (NMConnectionList *self, const gchar *uuid)
+{
+        EditData *data;
+
+        g_return_if_fail (NM_IS_CONNECTION_LIST (self));
+
+        data =  g_new0 (EditData, 1);
+
+        data->self = self;
+        data->uuid = uuid;
+        data->wait = TRUE;
+
+        connections_read (self->settings, data);
+}
+
 static void
 list_response_cb (GtkDialog *dialog, gint response, gpointer user_data)
 {
--- NetworkManager-0.8.996/network-manager-applet-0.8.996/src/connection-editor/Makefile.am	2011-03-11 08:52:11.916573049 -0500
+++ hacked/network-manager-applet-0.8.996/src/connection-editor/Makefile.am	2011-03-11 08:49:53.278306263 -0500
@@ -84,7 +84,8 @@
 	ce-page-dsl.ui \
 	ce-page-mobile.ui \
 	ce-page-ppp.ui \
-	ce-vpn-wizard.ui
+	ce-vpn-wizard.ui \
+	ce-create-any.ui
 
 BUILT_SOURCES = nm-connection-editor-service-glue.h
 
--- NetworkManager-0.8.996/network-manager-applet-0.8.996/src/connection-editor/ce-create-any.ui	2011-03-11 08:52:44.510165572 -0500
+++ hacked/network-manager-applet-0.8.996/src/connection-editor/ce-create-any.ui	2011-03-11 08:48:33.281306364 -0500
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkListStore" id="liststore1">
+    <columns>
+      <!-- column-name type -->
+      <column type="gchararray"/>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0">802-3-ethernet</col>
+        <col id="1" translatable="yes">Wired</col>
+      </row>
+      <row>
+        <col id="0">802-11-wireless</col>
+        <col id="1" translatable="yes">Wireless</col>
+      </row>
+      <row>
+        <col id="0">gsm</col>
+        <col id="1" translatable="yes">Mobile Broadband</col>
+      </row>
+      <row>
+        <col id="0">vpn</col>
+        <col id="1" translatable="yes">VPN</col>
+      </row>
+      <row>
+        <col id="0">pppoe</col>
+        <col id="1" translatable="yes">DSL</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="title"></property>
+    <property name="resizable">False</property>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_left">12</property>
+        <property name="margin_right">12</property>
+        <property name="margin_top">12</property>
+        <property name="margin_bottom">12</property>
+        <child>
+          <object class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Choose what kind of connection to create:</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkComboBox" id="combobox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="halign">start</property>
+            <property name="valign">start</property>
+            <property name="margin_top">12</property>
+            <property name="margin_bottom">12</property>
+            <property name="model">liststore1</property>
+            <property name="active">0</property>
+            <child>
+              <object class="GtkCellRendererText" id="renderer1"/>
+              <attributes>
+                <attribute name="text">1</attribute>
+              </attributes>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHButtonBox" id="hbuttonbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancel_button">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="create_button">
+                <property name="label" translatable="yes">Create...</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
