diff --git a/panels/network/connection-editor/Makefile.am b/panels/network/connection-editor/Makefile.am index fe74aa785..dc7866230 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 644555eab..b8505a5e4 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 036aedcf2..fb85a2585 100644 --- a/panels/network/connection-editor/ce-page-details.h +++ b/panels/network/connection-editor/ce-page-details.h @@ -25,6 +25,7 @@ #include #include +#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/ce-page-reset.c b/panels/network/connection-editor/ce-page-reset.c deleted file mode 100644 index bd8bd67a2..000000000 --- a/panels/network/connection-editor/ce-page-reset.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2012 Red Hat, Inc - * - * Licensed under the GNU General Public License Version 2 - * - * 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. - */ - -#include "config.h" - -#include -#include - -#include "net-connection-editor.h" -#include "ce-page-reset.h" - -G_DEFINE_TYPE (CEPageReset, ce_page_reset, CE_TYPE_PAGE) - - -static void -forget_cb (GtkButton *button, CEPageReset *page) -{ - net_connection_editor_forget (page->editor); -} - -static void -reset_cb (GtkButton *button, CEPageReset *page) -{ - net_connection_editor_reset (page->editor); -} - -static void -connect_reset_page (CEPageReset *page) -{ - GtkWidget *widget; - - widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "button_forget")); - g_signal_connect (widget, "clicked", G_CALLBACK (forget_cb), page); - - widget = GTK_WIDGET (gtk_builder_get_object (CE_PAGE (page)->builder, "button_reset")); - g_signal_connect (widget, "clicked", G_CALLBACK (reset_cb), page); -} - -static void -ce_page_reset_init (CEPageReset *page) -{ -} - -static void -ce_page_reset_class_init (CEPageResetClass *class) -{ -} - -CEPage * -ce_page_reset_new (NMConnection *connection, - NMClient *client, - NetConnectionEditor *editor) -{ - CEPageReset *page; - - page = CE_PAGE_RESET (ce_page_new (CE_TYPE_PAGE_RESET, - connection, - client, - "/org/gnome/control-center/network/reset-page.ui", - _("Reset"))); - page->editor = editor; - - connect_reset_page (page); - - return CE_PAGE (page); -} diff --git a/panels/network/connection-editor/ce-page-reset.h b/panels/network/connection-editor/ce-page-reset.h deleted file mode 100644 index 4915d0a3c..000000000 --- a/panels/network/connection-editor/ce-page-reset.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2012 Red Hat, Inc. - * - * Licensed under the GNU General Public License Version 2 - * - * 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 reset. - * - * 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. - */ - -#ifndef __CE_PAGE_RESET_H -#define __CE_PAGE_RESET_H - -#include - -#include -#include "net-connection-editor.h" -#include "ce-page.h" - -G_BEGIN_DECLS - -#define CE_TYPE_PAGE_RESET (ce_page_reset_get_type ()) -#define CE_PAGE_RESET(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CE_TYPE_PAGE_RESET, CEPageReset)) -#define CE_PAGE_RESET_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CE_TYPE_PAGE_RESET, CEPageResetClass)) -#define CE_IS_PAGE_RESET(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CE_TYPE_PAGE_RESET)) -#define CE_IS_PAGE_RESET_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CE_TYPE_PAGE_RESET)) -#define CE_PAGE_RESET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CE_TYPE_PAGE_RESET, CEPageResetClass)) - -typedef struct _CEPageReset CEPageReset; -typedef struct _CEPageResetClass CEPageResetClass; - -struct _CEPageReset -{ - CEPage parent; - - NetConnectionEditor *editor; -}; - -struct _CEPageResetClass -{ - CEPageClass parent_class; -}; - -GType ce_page_reset_get_type (void); - -CEPage *ce_page_reset_new (NMConnection *connection, - NMClient *client, - NetConnectionEditor *editor); - -G_END_DECLS - -#endif /* __CE_PAGE_RESET_H */ - diff --git a/panels/network/connection-editor/connection-editor.gresource.xml b/panels/network/connection-editor/connection-editor.gresource.xml index e9ad7d9ed..3d06f5a77 100644 --- a/panels/network/connection-editor/connection-editor.gresource.xml +++ b/panels/network/connection-editor/connection-editor.gresource.xml @@ -7,7 +7,6 @@ ethernet-page.ui ip4-page.ui ip6-page.ui - reset-page.ui security-page.ui vpn-page.ui wifi-page.ui diff --git a/panels/network/connection-editor/details-page.ui b/panels/network/connection-editor/details-page.ui index 9afd3a848..ed6e3c536 100644 --- a/panels/network/connection-editor/details-page.ui +++ b/panels/network/connection-editor/details-page.ui @@ -4,7 +4,6 @@ True False - start 24 24 24 @@ -33,6 +32,7 @@ True True + True 0 Weak True @@ -355,5 +355,26 @@ 1 + + + _Forget + True + True + True + True + True + end + end + + + + 0 + 11 + 2 + 1 + + diff --git a/panels/network/connection-editor/net-connection-editor.c b/panels/network/connection-editor/net-connection-editor.c index 203644bdd..44fcc676c 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; diff --git a/panels/network/connection-editor/reset-page.ui b/panels/network/connection-editor/reset-page.ui deleted file mode 100644 index d4fe7dd6b..000000000 --- a/panels/network/connection-editor/reset-page.ui +++ /dev/null @@ -1,82 +0,0 @@ - - - - - True - False - 50 - 50 - 12 - 12 - 20 - 20 - - - _Reset - True - True - True - center - True - - - 0 - 0 - 1 - 1 - - - - - _Forget - True - True - True - center - True - - - 0 - 1 - 1 - 1 - - - - - True - False - True - 0 - Reset the settings for this network, including passwords, but remember it as a preferred network - True - 40 - button_reset - - - 1 - 0 - 1 - 1 - - - - - True - False - True - 0 - Remove all details relating to this network and do not try to automatically connect - True - 30 - button_forget - - - 1 - 1 - 1 - 1 - - - -