diff options
author | Dan Winship <danw@gnome.org> | 2014-10-31 16:01:27 -0400 |
---|---|---|
committer | Dan Winship <danw@redhat.com> | 2014-11-21 09:01:01 -0500 |
commit | 2afb1acb2d23f695266d1586c1320b59fff58134 (patch) | |
tree | 3c75fe47f54a73c6e04b2c15b12c1b0dc716181f /clients/tui/nmt-page-bridge-port.c | |
parent | 84d875546bb5bb9331114559bfb9fc2df129d8ea (diff) | |
download | NetworkManager-2afb1acb2d23f695266d1586c1320b59fff58134.tar.gz |
tui: rework how editor pages work
Instead of having NmtEditorPage be a widget itself, have it just be an
object that returns a list of NmtEditorSections, where
NmtEditorSection is a subclass of NmtNewtSection.
(This will be important when adding VPN pages, which will be split up
into multiple sections, but with the different sections needing to
cooperate on updating the NMSettingVpn. This reorganization lets us
have an NMPageVpn containing multiple sections, with the NMPageVpn
object handling the coordination between the sections.)
Diffstat (limited to 'clients/tui/nmt-page-bridge-port.c')
-rw-r--r-- | clients/tui/nmt-page-bridge-port.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clients/tui/nmt-page-bridge-port.c b/clients/tui/nmt-page-bridge-port.c index c7ea82fab1..c9ef14ed86 100644 --- a/clients/tui/nmt-page-bridge-port.c +++ b/clients/tui/nmt-page-bridge-port.c @@ -30,12 +30,11 @@ G_DEFINE_TYPE (NmtPageBridgePort, nmt_page_bridge_port, NMT_TYPE_EDITOR_PAGE) -NmtNewtWidget * +NmtEditorPage * nmt_page_bridge_port_new (NMConnection *conn) { return g_object_new (NMT_TYPE_PAGE_BRIDGE_PORT, "connection", conn, - "title", _("BRIDGE PORT"), NULL); } @@ -48,6 +47,7 @@ static void nmt_page_bridge_port_constructed (GObject *object) { NmtPageBridgePort *bridge = NMT_PAGE_BRIDGE_PORT (object); + NmtEditorSection *section; NmtEditorGrid *grid; NMSettingBridgePort *s_port; NmtNewtWidget *widget; @@ -60,7 +60,8 @@ nmt_page_bridge_port_constructed (GObject *object) s_port = nm_connection_get_setting_bridge_port (conn); } - grid = NMT_EDITOR_GRID (bridge); + section = nmt_editor_section_new (_("BRIDGE PORT"), NULL, TRUE); + grid = nmt_editor_section_get_body (section); widget = nmt_newt_entry_numeric_new (10, 0, 63); g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_PRIORITY, @@ -80,6 +81,8 @@ nmt_page_bridge_port_constructed (GObject *object) G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); nmt_editor_grid_append (grid, NULL, widget, NULL); + nmt_editor_page_add_section (NMT_EDITOR_PAGE (bridge), section); + G_OBJECT_CLASS (nmt_page_bridge_port_parent_class)->constructed (object); } |