Commit 1fa913fa authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

Update patches

parent b7a842db
From 50a1da3ef2233848dd8ca49de6052f11fc54547a Mon Sep 17 00:00:00 2001
From 40fc9cc405b82e3a807ea3e9f10385727d536bf2 Mon Sep 17 00:00:00 2001
From: Mohammed Sadiq <sadiq@sadiqpk.org>
Date: Fri, 4 Oct 2019 12:04:58 +0530
Subject: [PATCH 2/4] wwan: Add new panel for modem management
Date: Fri, 4 Oct 2019 22:16:23 +0530
Subject: [PATCH] wwan: Add new panel for modem management
The panel supports 2G/3G/4G GSM/LTE modems. CDMA2000 Modems are not supported.
If a supported modem is present, the panel will be shown and the modem will be
handled, else, network-panel shall manage the modem as it did in the past.
If more than one modem with data enabled is present, the user is allowed to set
priority of one SIM over the other (the priority is for SIM, not modem).
Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/132
---
meson.build | 4 +
panels/meson.build | 3 +-
......@@ -37,7 +29,7 @@ Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/132
panels/wwan/cc-wwan-panel.c | 772 +++++++++++
panels/wwan/cc-wwan-panel.h | 36 +
panels/wwan/cc-wwan-panel.ui | 328 +++++
panels/wwan/cc-wwan-sim-lock-dialog.c | 397 ++++++
panels/wwan/cc-wwan-sim-lock-dialog.c | 343 +++++
panels/wwan/cc-wwan-sim-lock-dialog.h | 41 +
panels/wwan/cc-wwan-sim-lock-dialog.ui | 311 +++++
panels/wwan/gnome-wwan-panel.desktop.in.in | 16 +
......@@ -45,7 +37,7 @@ Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/132
panels/wwan/wwan.gresource.xml | 12 +
shell/cc-panel-list.c | 1 +
shell/cc-panel-loader.c | 9 +
33 files changed, 8440 insertions(+), 1 deletion(-)
33 files changed, 8386 insertions(+), 1 deletion(-)
create mode 100644 panels/wwan/cc-wwan-apn-dialog.c
create mode 100644 panels/wwan/cc-wwan-apn-dialog.h
create mode 100644 panels/wwan/cc-wwan-apn-dialog.ui
......@@ -7831,10 +7823,10 @@ index 000000000..6955c0ca5
+</interface>
diff --git a/panels/wwan/cc-wwan-sim-lock-dialog.c b/panels/wwan/cc-wwan-sim-lock-dialog.c
new file mode 100644
index 000000000..663acc91b
index 000000000..93fa5b51c
--- /dev/null
+++ b/panels/wwan/cc-wwan-sim-lock-dialog.c
@@ -0,0 +1,397 @@
@@ -0,0 +1,343 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* cc-wwan-network-dialog.c
+ *
......@@ -7875,8 +7867,8 @@ index 000000000..663acc91b
+ * @short_description: Dialog to manage SIM Locks like PIN
+ */
+
+#define PUK_MINIMUM_LENGTH 8
+#define PIN_MINIMUM_LENGTH 4
+#define PIN_MAXIMUM_LENGTH 8
+
+struct _CcWwanSimLockDialog
+{
......@@ -7939,30 +7931,10 @@ index 000000000..663acc91b
+}
+
+static void
+cc_wwan_sim_unlock (CcWwanSimLockDialog *self)
+{
+ const gchar *pin;
+
+ g_assert (CC_IS_WWAN_SIM_LOCK_DIALOG (self));
+
+ pin = gtk_entry_get_text (self->pin_entry);
+
+ if (self->lock == MM_MODEM_LOCK_SIM_PIN)
+ cc_wwan_device_send_pin (self->device, pin,
+ NULL, NULL, NULL);
+}
+
+static void
+cc_wwan_pin_apply_clicked_cb (CcWwanSimLockDialog *self)
+{
+ g_assert (CC_IS_WWAN_SIM_LOCK_DIALOG (self));
+
+ if (self->lock == MM_MODEM_LOCK_SIM_PIN ||
+ self->lock == MM_MODEM_LOCK_SIM_PIN2 ||
+ self->lock == MM_MODEM_LOCK_SIM_PUK ||
+ self->lock == MM_MODEM_LOCK_SIM_PUK2)
+ cc_wwan_sim_unlock (self);
+
+ gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_APPLY);
+}
+
......@@ -8027,6 +7999,7 @@ index 000000000..663acc91b
+cc_wwan_pin_entered_cb (CcWwanSimLockDialog *self)
+{
+ const gchar *pin;
+ gsize len;
+ gboolean enable_apply;
+
+ g_assert (CC_IS_WWAN_SIM_LOCK_DIALOG (self));
......@@ -8040,11 +8013,8 @@ index 000000000..663acc91b
+ return;
+ }
+
+ if (self->lock == MM_MODEM_LOCK_SIM_PUK ||
+ self->lock == MM_MODEM_LOCK_SIM_PUK2)
+ enable_apply = strlen (pin) == PUK_MINIMUM_LENGTH;
+ else
+ enable_apply = strlen (pin) >= PIN_MINIMUM_LENGTH;
+ len = strlen (pin);
+ enable_apply = len >= PIN_MINIMUM_LENGTH && len <= PIN_MAXIMUM_LENGTH;
+
+ gtk_widget_set_sensitive (GTK_WIDGET (self->apply_button), enable_apply);
+}
......@@ -8069,41 +8039,15 @@ index 000000000..663acc91b
+}
+
+static void
+cc_wwan_sim_lock_dialog_setup_lock_request (CcWwanSimLockDialog *self)
+{
+ g_assert (CC_IS_WWAN_SIM_LOCK_DIALOG (self));
+
+ if (self->lock == MM_MODEM_LOCK_UNKNOWN ||
+ self->lock == MM_MODEM_LOCK_NONE)
+ return;
+
+ gtk_button_set_label (self->apply_button, _("_Unlock"));
+
+ gtk_stack_set_visible_child (self->button_stack,
+ GTK_WIDGET (self->apply_button));
+ gtk_stack_set_visible_child_name (self->pin_settings_stack, "pin-entry");
+}
+
+static void
+cc_wwan_sim_lock_dialog_show (GtkWidget *widget)
+{
+ CcWwanSimLockDialog *self = (CcWwanSimLockDialog *)widget;
+ gboolean lock_enabled;
+
+ self->lock = cc_wwan_device_get_lock (self->device);
+ gtk_entry_set_text (self->pin_entry, "");
+ gtk_widget_set_sensitive (GTK_WIDGET (self->next_button), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (self->apply_button), FALSE);
+
+ if (self->lock != MM_MODEM_LOCK_UNKNOWN &&
+ self->lock != MM_MODEM_LOCK_NONE)
+ {
+ cc_wwan_sim_lock_dialog_setup_lock_request (self);
+
+ GTK_WIDGET_CLASS (cc_wwan_sim_lock_dialog_parent_class)->show (widget);
+ return;
+ }
+
+ lock_enabled = cc_wwan_device_get_sim_lock (self->device);
+ g_object_set (self->lock_row, "active", lock_enabled, NULL);
+ gtk_widget_set_visible (GTK_WIDGET (self->lock_change_grid), lock_enabled);
......@@ -8142,12 +8086,6 @@ index 000000000..663acc91b
+
+ g_assert (CC_IS_WWAN_SIM_LOCK_DIALOG (self));
+
+ if (self->lock == MM_MODEM_LOCK_SIM_PIN ||
+ self->lock == MM_MODEM_LOCK_SIM_PIN2 ||
+ self->lock == MM_MODEM_LOCK_SIM_PUK ||
+ self->lock == MM_MODEM_LOCK_SIM_PUK2)
+ return;
+
+ if (response_id != GTK_RESPONSE_APPLY)
+ return;
+
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment