diff --git a/configure.ac b/configure.ac
index 321b8f3..1b2122a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,7 @@ src/gconf-helpers/Makefile
 src/wireless-security/Makefile
 src/connection-editor/Makefile
 src/gnome-bluetooth/Makefile
+src/modem-sim-helper/Makefile
 icons/Makefile
 icons/16/Makefile
 icons/22/Makefile
diff --git a/nm-applet.schemas.in b/nm-applet.schemas.in
index 75930e1..501d35c 100644
--- a/nm-applet.schemas.in
+++ b/nm-applet.schemas.in
@@ -6,7 +6,7 @@
       <applyto>/apps/nm-applet/disable-connected-notifications</applyto>
       <owner>nm-applet</owner>
       <type>bool</type>
-      <default>TRUE</default>
+      <default>FALSE</default>
       <locale name="C">
         <short>Disable connected notifications</short>
         <long>
@@ -20,7 +20,7 @@
       <applyto>/apps/nm-applet/disable-disconnected-notifications</applyto>
       <owner>nm-applet</owner>
       <type>bool</type>
-      <default>TRUE</default>
+      <default>FALSE</default>
       <locale name="C">
         <short>Disable disconnected notifications</short>
         <long>
@@ -34,7 +34,7 @@
       <applyto>/apps/nm-applet/suppress-wireless-networks-available</applyto>
       <owner>nm-applet</owner>
       <type>bool</type>
-      <default>TRUE</default>
+      <default>FALSE</default>
       <locale name="C">
         <short>Suppress networks available notifications</short>
         <long>
diff --git a/src/Makefile.am b/src/Makefile.am
index 6bd7b04..1f2223e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = marshallers utils gconf-helpers wireless-security connection-editor gnome-bluetooth
+SUBDIRS = marshallers utils gconf-helpers wireless-security connection-editor gnome-bluetooth modem-sim-helper
 
 bin_PROGRAMS = nm-applet
 
@@ -10,6 +10,7 @@ nm_applet_CPPFLAGS = \
 	-DBINDIR=\""$(bindir)"\"								\
 	-DSYSCONFDIR=\""$(sysconfdir)"\"						\
 	-DLIBEXECDIR=\""$(libexecdir)"\" \
+	-DPKGLIBDIR=\""$(pkglibdir)"\" \
 	-DAUTOSTARTDIR=\""$(sysconfdir)/xdg/autostart"\"			\
 	-DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\"	\
 	-DNMALOCALEDIR=\"$(datadir)/locale\"					\
diff --git a/src/applet.c b/src/applet.c
index 542145e..227008a 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -272,22 +272,36 @@ is_system_connection (NMConnection *connection)
 	return (nm_connection_get_scope (connection) == NM_CONNECTION_SCOPE_SYSTEM) ? TRUE : FALSE;
 }
 
+typedef struct {
+	NMApplet *applet;
+	NMDevice *device;
+	char *specific_object;
+	gpointer dclass_data;
+} AppletItemActivateInfo;
+
 static void
 activate_connection_cb (gpointer user_data, const char *path, GError *error)
 {
-	if (error)
+	AppletItemActivateInfo *info = user_data;
+
+	if (error) {
 		nm_warning ("Connection activation failed: %s", error->message);
 
+		/* FIXME: if there are more cases where we want post error handling
+		 * we might want to refactor this in a device class function. */
+		if (strstr(error->message, "SIM PUK")) {
+		        const char *argv[] = { PKGLIBDIR "/nm-mm-unlock",
+			                       "--type", "PUK",
+			                       "--path",
+			                       nm_object_get_path (NM_OBJECT (info->device)),
+			                       NULL};
+			g_spawn_async (NULL, (gchar **) argv, NULL, 0, NULL, NULL, NULL, NULL);
+		}
+	}
+
 	applet_schedule_update_icon (NM_APPLET (user_data));
 }
 
-typedef struct {
-	NMApplet *applet;
-	NMDevice *device;
-	char *specific_object;
-	gpointer dclass_data;
-} AppletItemActivateInfo;
-
 static void
 applet_item_activate_info_destroy (AppletItemActivateInfo *info)
 {
@@ -354,7 +368,7 @@ applet_menu_item_activate_helper_part2 (NMConnection *connection,
 	                               info->device,
 	                               info->specific_object,
 	                               activate_connection_cb,
-	                               info->applet);
+	                               info);
 	applet_item_activate_info_destroy (info);
 }
 
diff --git a/src/modem-sim-helper/Makefile.am b/src/modem-sim-helper/Makefile.am
new file mode 100644
index 0000000..ac032ad
--- /dev/null
+++ b/src/modem-sim-helper/Makefile.am
@@ -0,0 +1,19 @@
+pkglib_PROGRAMS = modem-sim-helper
+
+modem_sim_helper_CPPFLAGS = \
+	$(NMA_CFLAGS) \
+	-DBINDIR=\""$(bindir)"\" \
+	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DLIBDIR=\""$(libdir)"\" \
+	-DPKGLIBDIR=\""$(pkglibdir)"\" \
+	-DDATADIR=\""$(datadir)"\" \
+	-DNMALOCALEDIR=\"$(datadir)/locale\" \
+	$(DBUS_CFLAGS) \
+	$(DISABLE_DEPRECATED)
+
+modem_sim_helper_SOURCES = \
+	main.c
+
+modem_sim_helper_LDADD = \
+	$(NMA_LIBS)
+
diff --git a/src/modem-sim-helper/main.c b/src/modem-sim-helper/main.c
new file mode 100644
index 0000000..13d1114
--- /dev/null
+++ b/src/modem-sim-helper/main.c
@@ -0,0 +1,222 @@
+/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Alexander Sack <asac@ubuntu.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * (C) Copyright 2009 Canonical, Ltd.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <dbus/dbus.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#define ARG_TYPE "type"
+#define ARG_PATH "path"
+
+static gboolean
+check_puk_form (gpointer user_data)
+{
+	gpointer* data = user_data;
+	GtkWidget *pukfield = GTK_WIDGET (data[0]);
+	GtkWidget *pinfield = GTK_WIDGET (data[1]);
+	const gchar *pin, *puk;
+
+	g_return_val_if_fail (pukfield, FALSE);
+	g_return_val_if_fail (pinfield, FALSE);
+
+	puk = gtk_entry_get_text (GTK_ENTRY (pukfield));
+	pin = gtk_entry_get_text (GTK_ENTRY (pinfield));
+
+	if (puk && pin &&
+            strlen (puk) >= 4 && strlen (puk) <=8 &&
+	    strlen (pin) >= 4 && strlen (pin) <=8)
+		return TRUE;
+	else
+		return FALSE;
+}
+
+static void
+do_form_check (GObject    *gobject,
+               GParamSpec *pspec,
+               gpointer    user_data)
+{
+	gpointer* data = user_data;
+	GtkWidget *bok = GTK_WIDGET (data[2]);
+
+	if (check_puk_form (user_data))
+		gtk_widget_set_sensitive (bok, TRUE);
+	else
+		gtk_widget_set_sensitive (bok, FALSE);
+}
+
+static void
+do_set_puk (gpointer self, gpointer user_data)
+{
+	GError *error = NULL;
+	DBusGConnection* sysbus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
+	DBusGProxy *proxy = NULL;
+	gpointer* data = user_data;
+	GtkWidget *pukfield = GTK_WIDGET (data[0]);
+	GtkWidget *pinfield = GTK_WIDGET (data[1]);
+	const gchar *pin, *puk;
+
+	if (error)
+		g_error ("Error getting system bus: %s", error->message);
+
+	g_return_if_fail (check_puk_form (user_data));
+	g_return_if_fail (pukfield);
+	g_return_if_fail (pinfield);
+
+	puk = gtk_entry_get_text (GTK_ENTRY (pukfield));
+	pin = gtk_entry_get_text (GTK_ENTRY (pinfield));
+
+	proxy = dbus_g_proxy_new_for_name (sysbus,
+	                                   "org.freedesktop.ModemManager",
+	                                   data [3],
+	                                   "org.freedesktop.ModemManager.Modem.Gsm.Card");
+
+	if (!proxy)
+		g_error ("could not get proxy for modem_path: %s", (char*) data[3]);
+
+	if (!dbus_g_proxy_call (proxy, "SendPuk", &error, G_TYPE_INVALID, 
+	                        DBUS_TYPE_STRING_AS_STRING, puk,
+	                        DBUS_TYPE_STRING_AS_STRING, pin,
+	                        G_TYPE_INVALID)) {
+		if (error)
+			g_error ("error sending puk: %s", error->message);
+		else
+			g_error ("unknown error sending puk");
+	}
+
+	g_message ("send PUK");
+
+}
+
+static void
+show_dialog (const gchar* modem_path)
+{
+	gpointer *data = g_new0 (gpointer, 5);
+	gchar *tmp;
+
+	/* all the widgets .. */
+	GtkWidget *dialog = gtk_dialog_new ();
+	GtkWidget *formtable = gtk_table_new (3, 2, FALSE);
+	GtkWidget *titlealign = gtk_alignment_new (0.5, 0.5, 0.9, 0.8);
+	GtkWidget *title = gtk_label_new ("Your Modem is locked, please enter your PUK and set a new PIN");
+	GtkWidget *puktext = gtk_label_new ("PUK:");
+	GtkWidget *pukfield = gtk_entry_new ();
+	GtkWidget *pintext = gtk_label_new ("PIN:");
+	GtkWidget *pinfield = gtk_entry_new ();
+	GtkWidget *bcancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+	GtkWidget *bok = gtk_button_new_from_stock (GTK_STOCK_OK);
+
+	/* pack the dialog */
+	gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), formtable);
+	g_object_set (G_OBJECT (dialog), "has-separator", FALSE, NULL);
+
+	/* pack the formbox */
+	gtk_table_attach_defaults (GTK_TABLE (formtable), titlealign, 0, 2, 0, 1);
+	gtk_table_attach_defaults (GTK_TABLE (formtable), puktext, 0, 1, 1, 2);
+	gtk_table_attach_defaults (GTK_TABLE (formtable), pukfield, 1, 2, 1, 2);
+	gtk_table_attach_defaults (GTK_TABLE (formtable), pintext, 0, 1, 2, 3);
+	gtk_table_attach_defaults (GTK_TABLE (formtable), pinfield, 1, 2, 2, 3);
+
+	/* tune the input fields */
+	gtk_entry_set_max_length (GTK_ENTRY (pukfield), 8);
+	gtk_entry_set_max_length (GTK_ENTRY (pinfield), 8);
+	gtk_entry_set_width_chars (GTK_ENTRY (pukfield), 10);
+	gtk_entry_set_width_chars (GTK_ENTRY (pinfield), 10);
+
+	/* pack the titlebox */
+	gtk_container_add (GTK_CONTAINER (titlealign), title);
+	gtk_alignment_set_padding (GTK_ALIGNMENT (titlealign), 5, 12, 5, 5);
+
+	/* setup title */
+	g_object_set (G_OBJECT (title), "wrap", TRUE,  "single-line-mode", FALSE, "width-chars", 40, "max-width-chars", 30, "justify", GTK_JUSTIFY_CENTER, NULL);
+
+	/* setup puk markup */
+	tmp = g_strdup_printf ("<b>%s</b>", gtk_label_get_text (GTK_LABEL (puktext)));
+	gtk_label_set_markup (GTK_LABEL (puktext), tmp);
+	g_free (tmp);
+
+	/* pack the buttonrow */
+	gtk_dialog_add_action_widget (GTK_DIALOG (dialog), bcancel, 0);
+	gtk_dialog_add_action_widget (GTK_DIALOG (dialog), bok, 1);
+	gtk_dialog_set_default_response (GTK_DIALOG (dialog), 0);
+
+	/* setup user_data for callback */
+	data[0] = pukfield;
+	data[1] = pinfield;
+	data[2] = bok;
+	data[3] = g_strdup (modem_path); /* for private data down the callback road */
+
+	/* register callbacks */
+	g_signal_connect (G_OBJECT (pinfield), "notify::text", (GCallback) do_form_check, data);
+	g_signal_connect (G_OBJECT (pukfield), "notify::text", (GCallback) do_form_check, data);
+	g_signal_connect (G_OBJECT (bok), "clicked", (GCallback) do_set_puk, data);
+
+	/* let there be light */
+	gtk_widget_show_all (GTK_WIDGET (dialog));
+}
+
+int
+main (int argc, char *argv[])
+{
+	GOptionContext *opt_ctx;
+	GError *error = NULL;
+	char *type, *path;
+
+	GOptionEntry entries[] = {
+		{ ARG_TYPE, 0, 0, G_OPTION_ARG_STRING, &type, "Type of sim operation", "PUK,PIN" },
+		{ ARG_PATH, 0, 0, G_OPTION_ARG_STRING, &path, "Modem device path to NM object", NULL },
+		{ NULL }
+	};
+
+	bindtextdomain (GETTEXT_PACKAGE, NMALOCALEDIR);
+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+	gtk_init (&argc, &argv);
+	textdomain (GETTEXT_PACKAGE);
+
+	/* parse arguments: an idea is to use gconf://$setting_name / system://$setting_name to
+	   allow this program to work with both GConf and system-wide settings */
+
+	opt_ctx = g_option_context_new (NULL);
+	g_option_context_set_summary (opt_ctx, "Allows users to view and edit network connection settings");
+	g_option_context_add_main_entries (opt_ctx, entries, NULL);
+
+	if (!g_option_context_parse (opt_ctx, &argc, &argv, &error)) {
+		g_warning ("%s\n", error->message);
+		g_error_free (error);
+		return 1;
+	}
+
+	g_option_context_free (opt_ctx);
+
+	show_dialog (path);
+
+	gtk_main ();
+
+	return 0;
+}
