[network-manager-applet/aleksander/mm1-applet: 3/13] applet: launch PUK unlock directly when too many PIN failures
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/aleksander/mm1-applet: 3/13] applet: launch PUK unlock directly when too many PIN failures
- Date: Sat, 12 Jan 2013 17:29:03 +0000 (UTC)
commit fd878893f9c31714300b113576867cff68657e1c
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue Dec 18 13:57:05 2012 +0100
applet: launch PUK unlock directly when too many PIN failures
When PIN code entry is failed too many times, the modem will request PUK code.
In that case, relaunch the dialog asking for PUK code.
src/applet-device-gsm.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index f522b67..d3ecc23 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -98,6 +98,7 @@ typedef struct {
gpointer keyring_id;
} GsmDeviceInfo;
+static void unlock_dialog_new (NMDevice *device, GsmDeviceInfo *info);
static void unlock_dialog_destroy (GsmDeviceInfo *info);
static void check_start_polling (GsmDeviceInfo *info);
@@ -769,7 +770,7 @@ unlock_pin_reply (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
{
GsmDeviceInfo *info = user_data;
GError *error = NULL;
- const char *dbus_error, *msg = NULL, *code1;
+ const char *dbus_error, *code1;
if (dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID)) {
if (applet_mobile_pin_dialog_get_auto_unlock (info->dialog)) {
@@ -782,12 +783,23 @@ unlock_pin_reply (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
}
dbus_error = dbus_g_error_get_name (error);
- if (dbus_error && !strcmp (dbus_error, "org.freedesktop.ModemManager.Modem.Gsm.IncorrectPassword"))
- msg = _("Wrong PIN code; please contact your provider.");
- else
- msg = error ? error->message : NULL;
- applet_mobile_pin_dialog_stop_spinner (info->dialog, msg);
+ if (dbus_error && !strcmp (dbus_error, "org.freedesktop.ModemManager.Modem.Gsm.SimPukRequired")) {
+ unlock_dialog_destroy (info);
+ g_free (info->unlock_required);
+ info->unlock_required = g_strdup ("sim-puk");
+ unlock_dialog_new (info->device, info);
+ } else {
+ const char *msg;
+
+ if (dbus_error && !strcmp (dbus_error, "org.freedesktop.ModemManager.Modem.Gsm.IncorrectPassword"))
+ msg = _("Wrong PIN code; please contact your provider.");
+ else
+ msg = error ? error->message : NULL;
+
+ applet_mobile_pin_dialog_stop_spinner (info->dialog, msg);
+ }
+
g_warning ("%s: error unlocking with PIN: %s", __func__, error->message);
g_clear_error (&error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]