[gnome-control-center] network: Drop Reset page
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Drop Reset page
- Date: Wed, 14 Jun 2017 19:41:39 +0000 (UTC)
commit 813703667550229f0618a709a83686113cebafcd
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun May 21 15:00:08 2017 -0300
network: Drop Reset page
Following the latest mockups [1], the "Forget" button
is now available in the Details page, and the Reset page
is gone.
This patch then removes the Reset page, and moves the
functionality to the Details page.
[1]
https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/network/aday2/network-wires.png
https://bugzilla.gnome.org/show_bug.cgi?id=779841
panels/network/connection-editor/Makefile.am | 2 -
panels/network/connection-editor/ce-page-details.c | 21 ++++-
panels/network/connection-editor/ce-page-details.h | 11 ++-
panels/network/connection-editor/ce-page-reset.c | 84 --------------------
panels/network/connection-editor/ce-page-reset.h | 64 ---------------
.../connection-editor.gresource.xml | 1 -
panels/network/connection-editor/details-page.ui | 23 +++++-
.../connection-editor/net-connection-editor.c | 6 +-
panels/network/connection-editor/reset-page.ui | 82 -------------------
9 files changed, 46 insertions(+), 248 deletions(-)
---
diff --git a/panels/network/connection-editor/Makefile.am b/panels/network/connection-editor/Makefile.am
index fe74aa7..dc78662 100644
--- a/panels/network/connection-editor/Makefile.am
+++ b/panels/network/connection-editor/Makefile.am
@@ -20,8 +20,6 @@ libconnection_editor_la_SOURCES = \
ce-page-ip6.c \
ce-page-security.h \
ce-page-security.c \
- ce-page-reset.h \
- ce-page-reset.c \
ce-page-ethernet.h \
ce-page-ethernet.c \
ce-page-8021x-security.h \
diff --git a/panels/network/connection-editor/ce-page-details.c
b/panels/network/connection-editor/ce-page-details.c
index 644555e..b8505a5 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -31,6 +31,12 @@
G_DEFINE_TYPE (CEPageDetails, ce_page_details, CE_TYPE_PAGE)
+static void
+forget_cb (GtkButton *button, CEPageDetails *page)
+{
+ net_connection_editor_forget (page->editor);
+}
+
static gchar *
get_ap_security_string (NMAccessPoint *ap)
{
@@ -231,6 +237,10 @@ connect_details_page (CEPageDetails *page)
g_signal_connect (widget, "toggled",
G_CALLBACK (all_user_changed), page);
g_signal_connect_swapped (widget, "toggled", G_CALLBACK (ce_page_changed), page);
+
+ /* Forget button */
+ widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "button_forget"));
+ g_signal_connect (widget, "clicked", G_CALLBACK (forget_cb), page);
}
static void
@@ -244,10 +254,11 @@ ce_page_details_class_init (CEPageDetailsClass *class)
}
CEPage *
-ce_page_details_new (NMConnection *connection,
- NMClient *client,
- NMDevice *device,
- NMAccessPoint *ap)
+ce_page_details_new (NMConnection *connection,
+ NMClient *client,
+ NMDevice *device,
+ NMAccessPoint *ap,
+ NetConnectionEditor *editor)
{
CEPageDetails *page;
@@ -257,6 +268,7 @@ ce_page_details_new (NMConnection *connection,
"/org/gnome/control-center/network/details-page.ui",
_("Details")));
+ page->editor = editor;
page->device = device;
page->ap = ap;
@@ -264,4 +276,3 @@ ce_page_details_new (NMConnection *connection,
return CE_PAGE (page);
}
-
diff --git a/panels/network/connection-editor/ce-page-details.h
b/panels/network/connection-editor/ce-page-details.h
index 036aedc..fb85a25 100644
--- a/panels/network/connection-editor/ce-page-details.h
+++ b/panels/network/connection-editor/ce-page-details.h
@@ -25,6 +25,7 @@
#include <glib-object.h>
#include <gtk/gtk.h>
+#include "net-connection-editor.h"
#include "ce-page.h"
G_BEGIN_DECLS
@@ -45,6 +46,7 @@ struct _CEPageDetails
NMDevice *device;
NMAccessPoint *ap;
+ NetConnectionEditor *editor;
};
struct _CEPageDetailsClass
@@ -54,10 +56,11 @@ struct _CEPageDetailsClass
GType ce_page_details_get_type (void);
-CEPage *ce_page_details_new (NMConnection *connection,
- NMClient *client,
- NMDevice *device,
- NMAccessPoint *ap);
+CEPage *ce_page_details_new (NMConnection *connection,
+ NMClient *client,
+ NMDevice *device,
+ NMAccessPoint *ap,
+ NetConnectionEditor *editor);
G_END_DECLS
diff --git a/panels/network/connection-editor/connection-editor.gresource.xml
b/panels/network/connection-editor/connection-editor.gresource.xml
index e9ad7d9..3d06f5a 100644
--- a/panels/network/connection-editor/connection-editor.gresource.xml
+++ b/panels/network/connection-editor/connection-editor.gresource.xml
@@ -7,7 +7,6 @@
<file preprocess="xml-stripblanks">ethernet-page.ui</file>
<file preprocess="xml-stripblanks">ip4-page.ui</file>
<file preprocess="xml-stripblanks">ip6-page.ui</file>
- <file preprocess="xml-stripblanks">reset-page.ui</file>
<file preprocess="xml-stripblanks">security-page.ui</file>
<file preprocess="xml-stripblanks">vpn-page.ui</file>
<file preprocess="xml-stripblanks">wifi-page.ui</file>
diff --git a/panels/network/connection-editor/details-page.ui
b/panels/network/connection-editor/details-page.ui
index 9afd3a8..ed6e3c5 100644
--- a/panels/network/connection-editor/details-page.ui
+++ b/panels/network/connection-editor/details-page.ui
@@ -4,7 +4,6 @@
<object class="GtkGrid" id="page">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="valign">start</property>
<property name="margin_start">24</property>
<property name="margin_end">24</property>
<property name="margin_top">24</property>
@@ -33,6 +32,7 @@
<object class="GtkLabel" id="label_strength">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="label">Weak</property>
<property name="selectable">True</property>
@@ -355,5 +355,26 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="button_forget">
+ <property name="label" translatable="yes">_Forget</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="use_underline">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">end</property>
+ <property name="valign">end</property>
+ <style>
+ <class name="destructive-action" />
+ </style>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
</interface>
diff --git a/panels/network/connection-editor/net-connection-editor.c
b/panels/network/connection-editor/net-connection-editor.c
index 203644b..44fcc67 100644
--- a/panels/network/connection-editor/net-connection-editor.c
+++ b/panels/network/connection-editor/net-connection-editor.c
@@ -34,7 +34,6 @@
#include "ce-page-ip4.h"
#include "ce-page-ip6.h"
#include "ce-page-security.h"
-#include "ce-page-reset.h"
#include "ce-page-ethernet.h"
#include "ce-page-8021x-security.h"
#include "ce-page-vpn.h"
@@ -529,7 +528,7 @@ net_connection_editor_set_connection (NetConnectionEditor *editor,
type = nm_setting_connection_get_connection_type (sc);
if (!editor->is_new_connection)
- add_page (editor, ce_page_details_new (editor->connection, editor->client, editor->device,
editor->ap));
+ add_page (editor, ce_page_details_new (editor->connection, editor->client, editor->device,
editor->ap, editor));
if (strcmp (type, NM_SETTING_WIRELESS_SETTING_NAME) == 0)
add_page (editor, ce_page_security_new (editor->connection, editor->client));
@@ -551,9 +550,6 @@ net_connection_editor_set_connection (NetConnectionEditor *editor,
add_page (editor, ce_page_ip4_new (editor->connection, editor->client));
add_page (editor, ce_page_ip6_new (editor->connection, editor->client));
- if (!editor->is_new_connection)
- add_page (editor, ce_page_reset_new (editor->connection, editor->client, editor));
-
pages = g_slist_copy (editor->initializing_pages);
for (l = pages; l; l = l->next) {
CEPage *page = l->data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]