mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-07 06:20:32 +01:00
tui: rename two classes
Rename NmtPageDevice to NmtEditorPageDevice, and rename NmtPageGrid to NmtEditorGrid. Now all types with names starting with "NmtPage" are instantiable page types, not abstract classes or low-level widgets.
This commit is contained in:
parent
b5ef91775d
commit
277ed5bec0
32 changed files with 347 additions and 347 deletions
|
|
@ -55,8 +55,12 @@ nmtui_SOURCES = \
|
|||
nmt-device-entry.h \
|
||||
nmt-edit-connection-list.c \
|
||||
nmt-edit-connection-list.h \
|
||||
nmt-editor-grid.c \
|
||||
nmt-editor-grid.h \
|
||||
nmt-editor-page.c \
|
||||
nmt-editor-page.h \
|
||||
nmt-editor-page-device.c \
|
||||
nmt-editor-page-device.h \
|
||||
nmt-editor.c \
|
||||
nmt-editor.h \
|
||||
nmt-ip-entry.c \
|
||||
|
|
@ -71,14 +75,10 @@ nmtui_SOURCES = \
|
|||
nmt-page-bridge.h \
|
||||
nmt-page-bridge-port.c \
|
||||
nmt-page-bridge-port.h \
|
||||
nmt-page-device.c \
|
||||
nmt-page-device.h \
|
||||
nmt-page-dsl.c \
|
||||
nmt-page-dsl.h \
|
||||
nmt-page-ethernet.c \
|
||||
nmt-page-ethernet.h \
|
||||
nmt-page-grid.c \
|
||||
nmt-page-grid.h \
|
||||
nmt-page-infiniband.c \
|
||||
nmt-page-infiniband.h \
|
||||
nmt-page-ip4.c \
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
* matching a known #NMDevice, then it will also display the other
|
||||
* property in parentheses.
|
||||
*
|
||||
* FIXME: #NmtDeviceEntry is currently an #NmtPageGrid object, so that
|
||||
* FIXME: #NmtDeviceEntry is currently an #NmtEditorGrid object, so that
|
||||
* we can possibly eventually add a button to its "extra" field, that
|
||||
* would pop up a form for selecting a device. But if we're not going
|
||||
* to implement that then we should make it just an #NmtNewtEntry.
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
#include "nmtui.h"
|
||||
#include "nmt-device-entry.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtDeviceEntry, nmt_device_entry, NMT_TYPE_PAGE_GRID)
|
||||
G_DEFINE_TYPE (NmtDeviceEntry, nmt_device_entry, NMT_TYPE_EDITOR_GRID)
|
||||
|
||||
#define NMT_DEVICE_ENTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryPrivate))
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ nmt_device_entry_constructed (GObject *object)
|
|||
{
|
||||
NmtDeviceEntryPrivate *priv = NMT_DEVICE_ENTRY_GET_PRIVATE (object);
|
||||
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (object), priv->label, NMT_NEWT_WIDGET (priv->entry), NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (object), priv->label, NMT_NEWT_WIDGET (priv->entry), NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_device_entry_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_DEVICE_ENTRY_H
|
||||
#define NMT_DEVICE_ENTRY_H
|
||||
|
||||
#include "nmt-page-grid.h"
|
||||
#include "nmt-editor-grid.h"
|
||||
|
||||
#include <NetworkManager.h>
|
||||
|
||||
|
|
@ -33,12 +33,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_DEVICE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_DEVICE_ENTRY, NmtDeviceEntryClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageGrid parent;
|
||||
NmtEditorGrid parent;
|
||||
|
||||
} NmtDeviceEntry;
|
||||
|
||||
typedef struct {
|
||||
NmtPageGridClass parent;
|
||||
NmtEditorGridClass parent;
|
||||
|
||||
} NmtDeviceEntryClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* SECTION:nmt-page-grid
|
||||
* SECTION:nmt-editor-grid
|
||||
* @short_description: Grid widget for #NmtEditorPages
|
||||
*
|
||||
* #NmtPageGrid is the layout grid used by #NmtEditorPages. It
|
||||
* #NmtEditorGrid is the layout grid used by #NmtEditorPages. It
|
||||
* consists of a number of rows, each containing either a single
|
||||
* widget that spans the entire width of the row, or else containing a
|
||||
* label, a widget, and an optional extra widget.
|
||||
|
|
@ -29,10 +29,10 @@
|
|||
* its main widget is multiple rows high. The label and extra widgets
|
||||
* will be top-aligned if the row is taller than they are.
|
||||
*
|
||||
* The #NmtPageGrids in a form behave as though they are all in a
|
||||
* The #NmtEditorGrids in a form behave as though they are all in a
|
||||
* "size group" together; they will all use the same column widths,
|
||||
* which will be wide enough for the widest labels/widgets in any of
|
||||
* the grids. #NmtPageGrid is also specially aware of #NmtNewtSection,
|
||||
* the grids. #NmtEditorGrid is also specially aware of #NmtNewtSection,
|
||||
* and grids inside sections will automatically take the size of the
|
||||
* section border into account as well.
|
||||
*/
|
||||
|
|
@ -41,65 +41,65 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include "nmt-page-grid.h"
|
||||
#include "nmt-editor-grid.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageGrid, nmt_page_grid, NMT_TYPE_NEWT_CONTAINER)
|
||||
G_DEFINE_TYPE (NmtEditorGrid, nmt_editor_grid, NMT_TYPE_NEWT_CONTAINER)
|
||||
|
||||
#define NMT_PAGE_GRID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_GRID, NmtPageGridPrivate))
|
||||
#define NMT_EDITOR_GRID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_GRID, NmtEditorGridPrivate))
|
||||
|
||||
typedef struct {
|
||||
GArray *rows;
|
||||
int *row_heights;
|
||||
int indent;
|
||||
} NmtPageGridPrivate;
|
||||
} NmtEditorGridPrivate;
|
||||
|
||||
typedef struct {
|
||||
NmtNewtWidget *label;
|
||||
NmtNewtWidget *widget;
|
||||
NmtNewtWidget *extra;
|
||||
NmtPageGridRowFlags flags;
|
||||
} NmtPageGridRow;
|
||||
NmtEditorGridRowFlags flags;
|
||||
} NmtEditorGridRow;
|
||||
|
||||
typedef struct {
|
||||
int col_widths[3];
|
||||
} NmtPageGridFormState;
|
||||
} NmtEditorGridFormState;
|
||||
|
||||
/**
|
||||
* nmt_page_grid_new:
|
||||
* nmt_editor_grid_new:
|
||||
*
|
||||
* Creates a new #NmtPageGrid
|
||||
* Creates a new #NmtEditorGrid
|
||||
*
|
||||
* Returns: a new #NmtPageGrid
|
||||
* Returns: a new #NmtEditorGrid
|
||||
*/
|
||||
NmtNewtWidget *
|
||||
nmt_page_grid_new (void)
|
||||
nmt_editor_grid_new (void)
|
||||
{
|
||||
return g_object_new (NMT_TYPE_PAGE_GRID,
|
||||
return g_object_new (NMT_TYPE_EDITOR_GRID,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_init (NmtPageGrid *grid)
|
||||
nmt_editor_grid_init (NmtEditorGrid *grid)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
|
||||
|
||||
priv->rows = g_array_new (FALSE, TRUE, sizeof (NmtPageGridRow));
|
||||
priv->rows = g_array_new (FALSE, TRUE, sizeof (NmtEditorGridRow));
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_finalize (GObject *object)
|
||||
nmt_editor_grid_finalize (GObject *object)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (object);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (object);
|
||||
|
||||
g_array_unref (priv->rows);
|
||||
g_clear_pointer (&priv->row_heights, g_free);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_grid_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (nmt_editor_grid_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* nmt_page_grid_append:
|
||||
* @grid: the #NmtPageGrid
|
||||
* nmt_editor_grid_append:
|
||||
* @grid: the #NmtEditorGrid
|
||||
* @label: (allow-none): the label text for @widget, or %NULL
|
||||
* @widget: the (main) widget
|
||||
* @extra: (allow-none): optional extra widget
|
||||
|
|
@ -116,18 +116,18 @@ nmt_page_grid_finalize (GObject *object)
|
|||
*
|
||||
* FIXME: That's sort of weird.
|
||||
*
|
||||
* See also nmt_page_grid_set_row_flags().
|
||||
* See also nmt_editor_grid_set_row_flags().
|
||||
*/
|
||||
void
|
||||
nmt_page_grid_append (NmtPageGrid *grid,
|
||||
nmt_editor_grid_append (NmtEditorGrid *grid,
|
||||
const char *label,
|
||||
NmtNewtWidget *widget,
|
||||
NmtNewtWidget *extra)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
|
||||
NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_page_grid_parent_class);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
|
||||
NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_editor_grid_parent_class);
|
||||
NmtNewtContainer *container = NMT_NEWT_CONTAINER (grid);
|
||||
NmtPageGridRow row;
|
||||
NmtEditorGridRow row;
|
||||
|
||||
memset (&row, 0, sizeof (row));
|
||||
|
||||
|
|
@ -153,11 +153,11 @@ nmt_page_grid_append (NmtPageGrid *grid,
|
|||
}
|
||||
|
||||
static int
|
||||
nmt_page_grid_find_widget (NmtPageGrid *grid,
|
||||
nmt_editor_grid_find_widget (NmtEditorGrid *grid,
|
||||
NmtNewtWidget *widget)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < priv->rows->len; i++) {
|
||||
|
|
@ -169,48 +169,48 @@ nmt_page_grid_find_widget (NmtPageGrid *grid,
|
|||
}
|
||||
|
||||
/**
|
||||
* NmtPageGridRowFlags:
|
||||
* @NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT: the row's label should be
|
||||
* NmtEditorGridRowFlags:
|
||||
* @NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT: the row's label should be
|
||||
* aligned left instead of right.
|
||||
* @NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT: the row's extra widget
|
||||
* @NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT: the row's extra widget
|
||||
* should be aligned right instead of left.
|
||||
*
|
||||
* Flags to alter an #NmtPageGrid row's layout.
|
||||
* Flags to alter an #NmtEditorGrid row's layout.
|
||||
*/
|
||||
|
||||
/**
|
||||
* nmt_page_grid_set_row_flags:
|
||||
* @grid: an #NmtPageGrid
|
||||
* nmt_editor_grid_set_row_flags:
|
||||
* @grid: an #NmtEditorGrid
|
||||
* @widget: the widget whose row you want to adjust
|
||||
* @flags: the flags to set
|
||||
*
|
||||
* Sets flags to adjust the layout of @widget's row in @grid.
|
||||
*/
|
||||
void
|
||||
nmt_page_grid_set_row_flags (NmtPageGrid *grid,
|
||||
nmt_editor_grid_set_row_flags (NmtEditorGrid *grid,
|
||||
NmtNewtWidget *widget,
|
||||
NmtPageGridRowFlags flags)
|
||||
NmtEditorGridRowFlags flags)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
int i;
|
||||
|
||||
i = nmt_page_grid_find_widget (grid, widget);
|
||||
i = nmt_editor_grid_find_widget (grid, widget);
|
||||
if (i != -1)
|
||||
rows[i].flags = flags;
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_remove (NmtNewtContainer *container,
|
||||
nmt_editor_grid_remove (NmtNewtContainer *container,
|
||||
NmtNewtWidget *widget)
|
||||
{
|
||||
NmtPageGrid *grid = NMT_PAGE_GRID (container);
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (grid);
|
||||
NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_page_grid_parent_class);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtEditorGrid *grid = NMT_EDITOR_GRID (container);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (grid);
|
||||
NmtNewtContainerClass *parent_class = NMT_NEWT_CONTAINER_CLASS (nmt_editor_grid_parent_class);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
int i;
|
||||
|
||||
i = nmt_page_grid_find_widget (grid, widget);
|
||||
i = nmt_editor_grid_find_widget (grid, widget);
|
||||
if (i != -1) {
|
||||
if (rows[i].label)
|
||||
parent_class->remove (container, rows[i].label);
|
||||
|
|
@ -227,10 +227,10 @@ nmt_page_grid_remove (NmtNewtContainer *container,
|
|||
}
|
||||
|
||||
static newtComponent *
|
||||
nmt_page_grid_get_components (NmtNewtWidget *widget)
|
||||
nmt_editor_grid_get_components (NmtNewtWidget *widget)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
newtComponent *child_cos;
|
||||
GPtrArray *cos;
|
||||
int i, c;
|
||||
|
|
@ -265,31 +265,31 @@ nmt_page_grid_get_components (NmtNewtWidget *widget)
|
|||
return (newtComponent *) g_ptr_array_free (cos, FALSE);
|
||||
}
|
||||
|
||||
static NmtPageGridFormState *
|
||||
static NmtEditorGridFormState *
|
||||
get_form_state (NmtNewtWidget *widget)
|
||||
{
|
||||
NmtNewtForm *form = nmt_newt_widget_get_form (widget);
|
||||
NmtPageGridFormState *state;
|
||||
NmtEditorGridFormState *state;
|
||||
|
||||
if (!form)
|
||||
return NULL;
|
||||
|
||||
state = g_object_get_data (G_OBJECT (form), "NmtPageGridFormState");
|
||||
state = g_object_get_data (G_OBJECT (form), "NmtEditorGridFormState");
|
||||
if (state)
|
||||
return state;
|
||||
|
||||
state = g_new0 (NmtPageGridFormState, 1);
|
||||
g_object_set_data_full (G_OBJECT (form), "NmtPageGridFormState", state, g_free);
|
||||
state = g_new0 (NmtEditorGridFormState, 1);
|
||||
g_object_set_data_full (G_OBJECT (form), "NmtEditorGridFormState", state, g_free);
|
||||
return state;
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_realize (NmtNewtWidget *widget)
|
||||
nmt_editor_grid_realize (NmtNewtWidget *widget)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
|
||||
NmtNewtWidget *parent;
|
||||
|
||||
NMT_NEWT_WIDGET_CLASS (nmt_page_grid_parent_class)->realize (widget);
|
||||
NMT_NEWT_WIDGET_CLASS (nmt_editor_grid_parent_class)->realize (widget);
|
||||
|
||||
/* This is a hack, but it's the simplest way to make it work... */
|
||||
priv->indent = 0;
|
||||
|
|
@ -305,24 +305,24 @@ nmt_page_grid_realize (NmtNewtWidget *widget)
|
|||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_unrealize (NmtNewtWidget *widget)
|
||||
nmt_editor_grid_unrealize (NmtNewtWidget *widget)
|
||||
{
|
||||
NmtPageGridFormState *state = get_form_state (widget);
|
||||
NmtEditorGridFormState *state = get_form_state (widget);
|
||||
|
||||
if (state)
|
||||
memset (state->col_widths, 0, sizeof (state->col_widths));
|
||||
|
||||
NMT_NEWT_WIDGET_CLASS (nmt_page_grid_parent_class)->unrealize (widget);
|
||||
NMT_NEWT_WIDGET_CLASS (nmt_editor_grid_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_size_request (NmtNewtWidget *widget,
|
||||
nmt_editor_grid_size_request (NmtNewtWidget *widget,
|
||||
int *width,
|
||||
int *height)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtPageGridFormState *state = get_form_state (widget);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
NmtEditorGridFormState *state = get_form_state (widget);
|
||||
gboolean add_padding = FALSE;
|
||||
int i;
|
||||
|
||||
|
|
@ -367,15 +367,15 @@ nmt_page_grid_size_request (NmtNewtWidget *widget,
|
|||
|
||||
|
||||
static void
|
||||
nmt_page_grid_size_allocate (NmtNewtWidget *widget,
|
||||
nmt_editor_grid_size_allocate (NmtNewtWidget *widget,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
NmtPageGridPrivate *priv = NMT_PAGE_GRID_GET_PRIVATE (widget);
|
||||
NmtPageGridRow *rows = (NmtPageGridRow *) priv->rows->data;
|
||||
NmtPageGridFormState *state = get_form_state (widget);
|
||||
NmtEditorGridPrivate *priv = NMT_EDITOR_GRID_GET_PRIVATE (widget);
|
||||
NmtEditorGridRow *rows = (NmtEditorGridRow *) priv->rows->data;
|
||||
NmtEditorGridFormState *state = get_form_state (widget);
|
||||
int col0_width, col1_width, col2_width;
|
||||
int i, row;
|
||||
|
||||
|
|
@ -390,7 +390,7 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
|
|||
if (rows[i].label) {
|
||||
int lwidth, lheight, lx;
|
||||
|
||||
if (rows[i].flags & NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT)
|
||||
if (rows[i].flags & NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT)
|
||||
lx = x;
|
||||
else {
|
||||
nmt_newt_widget_size_request (rows[i].label, &lwidth, &lheight);
|
||||
|
|
@ -411,7 +411,7 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
|
|||
if (rows[i].extra) {
|
||||
int wwidth, wheight, ex;
|
||||
|
||||
if (rows[i].flags & NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT)
|
||||
if (rows[i].flags & NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT)
|
||||
ex = x + col0_width + col1_width + 2;
|
||||
else {
|
||||
nmt_newt_widget_size_request (rows[i].widget, &wwidth, &wheight);
|
||||
|
|
@ -437,22 +437,22 @@ nmt_page_grid_size_allocate (NmtNewtWidget *widget,
|
|||
}
|
||||
|
||||
static void
|
||||
nmt_page_grid_class_init (NmtPageGridClass *grid_class)
|
||||
nmt_editor_grid_class_init (NmtEditorGridClass *grid_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (grid_class);
|
||||
NmtNewtWidgetClass *widget_class = NMT_NEWT_WIDGET_CLASS (grid_class);
|
||||
NmtNewtContainerClass *container_class = NMT_NEWT_CONTAINER_CLASS (grid_class);
|
||||
|
||||
g_type_class_add_private (grid_class, sizeof (NmtPageGridPrivate));
|
||||
g_type_class_add_private (grid_class, sizeof (NmtEditorGridPrivate));
|
||||
|
||||
/* virtual methods */
|
||||
object_class->finalize = nmt_page_grid_finalize;
|
||||
object_class->finalize = nmt_editor_grid_finalize;
|
||||
|
||||
widget_class->realize = nmt_page_grid_realize;
|
||||
widget_class->unrealize = nmt_page_grid_unrealize;
|
||||
widget_class->get_components = nmt_page_grid_get_components;
|
||||
widget_class->size_request = nmt_page_grid_size_request;
|
||||
widget_class->size_allocate = nmt_page_grid_size_allocate;
|
||||
widget_class->realize = nmt_editor_grid_realize;
|
||||
widget_class->unrealize = nmt_editor_grid_unrealize;
|
||||
widget_class->get_components = nmt_editor_grid_get_components;
|
||||
widget_class->size_request = nmt_editor_grid_size_request;
|
||||
widget_class->size_allocate = nmt_editor_grid_size_allocate;
|
||||
|
||||
container_class->remove = nmt_page_grid_remove;
|
||||
container_class->remove = nmt_editor_grid_remove;
|
||||
}
|
||||
|
|
@ -16,47 +16,47 @@
|
|||
* Copyright 2013 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NMT_PAGE_GRID_H
|
||||
#define NMT_PAGE_GRID_H
|
||||
#ifndef NMT_EDITOR_GRID_H
|
||||
#define NMT_EDITOR_GRID_H
|
||||
|
||||
#include "nmt-newt.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NMT_TYPE_PAGE_GRID (nmt_page_grid_get_type ())
|
||||
#define NMT_PAGE_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_GRID, NmtPageGrid))
|
||||
#define NMT_PAGE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_GRID, NmtPageGridClass))
|
||||
#define NMT_IS_PAGE_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_PAGE_GRID))
|
||||
#define NMT_IS_PAGE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_PAGE_GRID))
|
||||
#define NMT_PAGE_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_GRID, NmtPageGridClass))
|
||||
#define NMT_TYPE_EDITOR_GRID (nmt_editor_grid_get_type ())
|
||||
#define NMT_EDITOR_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_GRID, NmtEditorGrid))
|
||||
#define NMT_EDITOR_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_GRID, NmtEditorGridClass))
|
||||
#define NMT_IS_EDITOR_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_EDITOR_GRID))
|
||||
#define NMT_IS_EDITOR_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_EDITOR_GRID))
|
||||
#define NMT_EDITOR_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_GRID, NmtEditorGridClass))
|
||||
|
||||
typedef struct {
|
||||
NmtNewtContainer parent;
|
||||
|
||||
} NmtPageGrid;
|
||||
} NmtEditorGrid;
|
||||
|
||||
typedef struct {
|
||||
NmtNewtContainerClass parent;
|
||||
|
||||
} NmtPageGridClass;
|
||||
} NmtEditorGridClass;
|
||||
|
||||
GType nmt_page_grid_get_type (void);
|
||||
GType nmt_editor_grid_get_type (void);
|
||||
|
||||
typedef enum {
|
||||
NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT = (1 << 0),
|
||||
NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT = (1 << 1)
|
||||
} NmtPageGridRowFlags;
|
||||
NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT = (1 << 0),
|
||||
NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT = (1 << 1)
|
||||
} NmtEditorGridRowFlags;
|
||||
|
||||
NmtNewtWidget *nmt_page_grid_new (void);
|
||||
NmtNewtWidget *nmt_editor_grid_new (void);
|
||||
|
||||
void nmt_page_grid_append (NmtPageGrid *grid,
|
||||
void nmt_editor_grid_append (NmtEditorGrid *grid,
|
||||
const char *label,
|
||||
NmtNewtWidget *widget,
|
||||
NmtNewtWidget *extra);
|
||||
void nmt_page_grid_set_row_flags (NmtPageGrid *grid,
|
||||
void nmt_editor_grid_set_row_flags (NmtEditorGrid *grid,
|
||||
NmtNewtWidget *widget,
|
||||
NmtPageGridRowFlags flags);
|
||||
NmtEditorGridRowFlags flags);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NMT_PAGE_GRID_H */
|
||||
#endif /* NMT_EDITOR_GRID_H */
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* SECTION:nmt-page-device
|
||||
* SECTION:nmt-editor-page-device
|
||||
* @short_description: Abstract base class for "device" editor pages
|
||||
*
|
||||
* #NmtPageDevice is the base class for #NmtEditorPage subclasses
|
||||
* #NmtEditorPageDevice is the base class for #NmtEditorPage subclasses
|
||||
* representing device-type-specific data. (Eg, #NmtPageEthernet,
|
||||
* #NmtPageVlan, etc).
|
||||
*
|
||||
|
|
@ -30,16 +30,16 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageDevice, nmt_page_device, NMT_TYPE_EDITOR_PAGE)
|
||||
G_DEFINE_TYPE (NmtEditorPageDevice, nmt_editor_page_device, NMT_TYPE_EDITOR_PAGE)
|
||||
|
||||
#define NMT_PAGE_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_DEVICE, NmtPageDevicePrivate))
|
||||
#define NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDevicePrivate))
|
||||
|
||||
typedef struct {
|
||||
NmtDeviceEntry *device_entry;
|
||||
gboolean show_by_default;
|
||||
} NmtPageDevicePrivate;
|
||||
} NmtEditorPageDevicePrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
|
|
@ -51,43 +51,43 @@ enum {
|
|||
};
|
||||
|
||||
static void
|
||||
nmt_page_device_init (NmtPageDevice *device)
|
||||
nmt_editor_page_device_init (NmtEditorPageDevice *device)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_device_finalize (GObject *object)
|
||||
nmt_editor_page_device_finalize (GObject *object)
|
||||
{
|
||||
NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
|
||||
g_clear_object (&priv->device_entry);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_device_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (nmt_editor_page_device_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
NmtDeviceEntry *
|
||||
nmt_page_device_get_device_entry (NmtPageDevice *page)
|
||||
nmt_editor_page_device_get_device_entry (NmtEditorPageDevice *page)
|
||||
{
|
||||
NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (page);
|
||||
NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (page);
|
||||
|
||||
return priv->device_entry;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nmt_page_device_show_by_default (NmtEditorPage *page)
|
||||
nmt_editor_page_device_show_by_default (NmtEditorPage *page)
|
||||
{
|
||||
NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (page);
|
||||
NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (page);
|
||||
|
||||
return priv->show_by_default;
|
||||
}
|
||||
|
||||
static void
|
||||
nmt_page_device_set_property (GObject *object,
|
||||
nmt_editor_page_device_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_DEVICE_ENTRY:
|
||||
|
|
@ -103,12 +103,12 @@ nmt_page_device_set_property (GObject *object,
|
|||
}
|
||||
|
||||
static void
|
||||
nmt_page_device_get_property (GObject *object,
|
||||
nmt_editor_page_device_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NmtPageDevicePrivate *priv = NMT_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
NmtEditorPageDevicePrivate *priv = NMT_EDITOR_PAGE_DEVICE_GET_PRIVATE (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_DEVICE_ENTRY:
|
||||
|
|
@ -124,19 +124,19 @@ nmt_page_device_get_property (GObject *object,
|
|||
}
|
||||
|
||||
static void
|
||||
nmt_page_device_class_init (NmtPageDeviceClass *page_device_class)
|
||||
nmt_editor_page_device_class_init (NmtEditorPageDeviceClass *page_device_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (page_device_class);
|
||||
NmtEditorPageClass *page_class = NMT_EDITOR_PAGE_CLASS (page_device_class);
|
||||
|
||||
g_type_class_add_private (page_device_class, sizeof (NmtPageDevicePrivate));
|
||||
g_type_class_add_private (page_device_class, sizeof (NmtEditorPageDevicePrivate));
|
||||
|
||||
/* virtual methods */
|
||||
object_class->set_property = nmt_page_device_set_property;
|
||||
object_class->get_property = nmt_page_device_get_property;
|
||||
object_class->finalize = nmt_page_device_finalize;
|
||||
object_class->set_property = nmt_editor_page_device_set_property;
|
||||
object_class->get_property = nmt_editor_page_device_get_property;
|
||||
object_class->finalize = nmt_editor_page_device_finalize;
|
||||
|
||||
page_class->show_by_default = nmt_page_device_show_by_default;
|
||||
page_class->show_by_default = nmt_editor_page_device_show_by_default;
|
||||
|
||||
/* properties */
|
||||
g_object_class_install_property
|
||||
50
clients/tui/nmt-editor-page-device.h
Normal file
50
clients/tui/nmt-editor-page-device.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NMT_EDITOR_PAGE_DEVICE_H
|
||||
#define NMT_EDITOR_PAGE_DEVICE_H
|
||||
|
||||
#include "nmt-editor-page.h"
|
||||
#include "nmt-device-entry.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NMT_TYPE_EDITOR_PAGE_DEVICE (nmt_editor_page_device_get_type ())
|
||||
#define NMT_EDITOR_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDevice))
|
||||
#define NMT_EDITOR_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDeviceClass))
|
||||
#define NMT_IS_EDITOR_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE))
|
||||
#define NMT_IS_EDITOR_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_EDITOR_PAGE_DEVICE))
|
||||
#define NMT_EDITOR_PAGE_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_PAGE_DEVICE, NmtEditorPageDeviceClass))
|
||||
|
||||
typedef struct {
|
||||
NmtEditorPage parent;
|
||||
|
||||
} NmtEditorPageDevice;
|
||||
|
||||
typedef struct {
|
||||
NmtEditorPageClass parent;
|
||||
|
||||
} NmtEditorPageDeviceClass;
|
||||
|
||||
GType nmt_editor_page_device_get_type (void);
|
||||
|
||||
NmtDeviceEntry *nmt_editor_page_device_get_device_entry (NmtEditorPageDevice *page);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NMT_EDITOR_PAGE_DEVICE_H */
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include "nmt-editor-page.h"
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (NmtEditorPage, nmt_editor_page, NMT_TYPE_PAGE_GRID)
|
||||
G_DEFINE_ABSTRACT_TYPE (NmtEditorPage, nmt_editor_page, NMT_TYPE_EDITOR_GRID)
|
||||
|
||||
#define NMT_EDITOR_PAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_EDITOR_PAGE, NmtEditorPagePrivate))
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <NetworkManager.h>
|
||||
|
||||
#include "nmt-page-grid.h"
|
||||
#include "nmt-editor-grid.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -33,12 +33,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_EDITOR_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_EDITOR_PAGE, NmtEditorPageClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageGrid parent;
|
||||
NmtEditorGrid parent;
|
||||
|
||||
} NmtEditorPage;
|
||||
|
||||
typedef struct {
|
||||
NmtPageGridClass parent;
|
||||
NmtEditorGridClass parent;
|
||||
|
||||
gboolean (*show_by_default) (NmtEditorPage *);
|
||||
} NmtEditorPageClass;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
#include "nmt-address-list.h"
|
||||
#include "nmt-slave-list.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageBond, nmt_page_bond, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageBond, nmt_page_bond, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
#define NMT_PAGE_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_BOND, NmtPageBondPrivate))
|
||||
|
||||
|
|
@ -338,7 +338,7 @@ nmt_page_bond_constructed (GObject *object)
|
|||
{
|
||||
NmtPageBond *bond = NMT_PAGE_BOND (object);
|
||||
NmtPageBondPrivate *priv = NMT_PAGE_BOND_GET_PRIVATE (bond);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingBond *s_bond;
|
||||
NmtNewtWidget *widget, *label;
|
||||
NMConnection *conn;
|
||||
|
|
@ -351,68 +351,68 @@ nmt_page_bond_constructed (GObject *object)
|
|||
}
|
||||
priv->s_bond = s_bond;
|
||||
|
||||
grid = NMT_PAGE_GRID (bond);
|
||||
grid = NMT_EDITOR_GRID (bond);
|
||||
|
||||
widget = nmt_newt_separator_new ();
|
||||
nmt_page_grid_append (grid, _("Slaves"), widget, NULL);
|
||||
nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT);
|
||||
nmt_editor_grid_append (grid, _("Slaves"), widget, NULL);
|
||||
nmt_editor_grid_set_row_flags (grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT);
|
||||
|
||||
widget = nmt_slave_list_new (conn, bond_connection_type_filter, bond);
|
||||
g_signal_connect (widget, "notify::connections",
|
||||
G_CALLBACK (slaves_changed), bond);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
priv->slaves = NMT_SLAVE_LIST (widget);
|
||||
|
||||
widget = nmt_newt_popup_new (bond_mode);
|
||||
g_signal_connect (widget, "notify::active-id",
|
||||
G_CALLBACK (mode_widget_changed), bond);
|
||||
nmt_page_grid_append (grid, _("Mode"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Mode"), widget, NULL);
|
||||
priv->mode = NMT_NEWT_POPUP (widget);
|
||||
|
||||
widget = nmt_newt_entry_new (40, 0);
|
||||
g_signal_connect (widget, "notify::text",
|
||||
G_CALLBACK (primary_widget_changed), bond);
|
||||
nmt_page_grid_append (grid, _("Primary"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Primary"), widget, NULL);
|
||||
priv->primary = NMT_NEWT_ENTRY (widget);
|
||||
|
||||
widget = nmt_newt_popup_new (bond_monitoring);
|
||||
g_signal_connect (widget, "notify::active",
|
||||
G_CALLBACK (monitoring_widget_changed), bond);
|
||||
nmt_page_grid_append (grid, _("Link monitoring"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Link monitoring"), widget, NULL);
|
||||
priv->monitoring = NMT_NEWT_POPUP (widget);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
|
||||
g_signal_connect (widget, "notify::text",
|
||||
G_CALLBACK (miimon_widget_changed), bond);
|
||||
label = nmt_newt_label_new (C_("milliseconds", "ms"));
|
||||
nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Monitoring frequency"), widget, label);
|
||||
priv->miimon = NMT_NEWT_ENTRY (widget);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
|
||||
g_signal_connect (widget, "notify::text",
|
||||
G_CALLBACK (updelay_widget_changed), bond);
|
||||
label = nmt_newt_label_new (C_("milliseconds", "ms"));
|
||||
nmt_page_grid_append (grid, _("Link up delay"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Link up delay"), widget, label);
|
||||
priv->updelay = NMT_NEWT_ENTRY (widget);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
|
||||
g_signal_connect (widget, "notify::text",
|
||||
G_CALLBACK (downdelay_widget_changed), bond);
|
||||
label = nmt_newt_label_new (C_("milliseconds", "ms"));
|
||||
nmt_page_grid_append (grid, _("Link down delay"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Link down delay"), widget, label);
|
||||
priv->downdelay = NMT_NEWT_ENTRY (widget);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
|
||||
g_signal_connect (widget, "notify::text",
|
||||
G_CALLBACK (arp_interval_widget_changed), bond);
|
||||
label = nmt_newt_label_new (C_("milliseconds", "ms"));
|
||||
nmt_page_grid_append (grid, _("Monitoring frequency"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Monitoring frequency"), widget, label);
|
||||
priv->arp_interval = NMT_NEWT_ENTRY (widget);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4);
|
||||
g_signal_connect (widget, "notify::strings",
|
||||
G_CALLBACK (arp_ip_target_widget_changed), bond);
|
||||
nmt_page_grid_append (grid, _("ARP targets"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("ARP targets"), widget, NULL);
|
||||
priv->arp_ip_target = NMT_ADDRESS_LIST (widget);
|
||||
|
||||
g_signal_connect (s_bond, "notify::" NM_SETTING_BOND_OPTIONS,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_BOND_H
|
||||
#define NMT_PAGE_BOND_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_BOND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_BOND, NmtPageBondClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageBond;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageBondClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static void
|
|||
nmt_page_bridge_port_constructed (GObject *object)
|
||||
{
|
||||
NmtPageBridgePort *bridge = NMT_PAGE_BRIDGE_PORT (object);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingBridgePort *s_port;
|
||||
NmtNewtWidget *widget;
|
||||
NMConnection *conn;
|
||||
|
|
@ -60,25 +60,25 @@ nmt_page_bridge_port_constructed (GObject *object)
|
|||
s_port = nm_connection_get_setting_bridge_port (conn);
|
||||
}
|
||||
|
||||
grid = NMT_PAGE_GRID (bridge);
|
||||
grid = NMT_EDITOR_GRID (bridge);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, 63);
|
||||
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_PRIORITY,
|
||||
widget, "text",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Priority"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Priority"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 1, 65535);
|
||||
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_PATH_COST,
|
||||
widget, "text",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Path cost"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Path cost"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Hairpin mode"));
|
||||
g_object_bind_property (s_port, NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE,
|
||||
widget, "active",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_bridge_port_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include "nmt-address-list.h"
|
||||
#include "nmt-slave-list.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageBridge, nmt_page_bridge, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageBridge, nmt_page_bridge, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
NmtNewtWidget *
|
||||
nmt_page_bridge_new (NMConnection *conn,
|
||||
|
|
@ -62,7 +62,7 @@ static void
|
|||
nmt_page_bridge_constructed (GObject *object)
|
||||
{
|
||||
NmtPageBridge *bridge = NMT_PAGE_BRIDGE (object);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingBridge *s_bridge;
|
||||
NmtNewtWidget *widget, *label, *stp;
|
||||
NMConnection *conn;
|
||||
|
|
@ -74,27 +74,27 @@ nmt_page_bridge_constructed (GObject *object)
|
|||
s_bridge = nm_connection_get_setting_bridge (conn);
|
||||
}
|
||||
|
||||
grid = NMT_PAGE_GRID (bridge);
|
||||
grid = NMT_EDITOR_GRID (bridge);
|
||||
|
||||
widget = nmt_newt_separator_new ();
|
||||
nmt_page_grid_append (grid, _("Slaves"), widget, NULL);
|
||||
nmt_page_grid_set_row_flags (grid, widget, NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT);
|
||||
nmt_editor_grid_append (grid, _("Slaves"), widget, NULL);
|
||||
nmt_editor_grid_set_row_flags (grid, widget, NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT);
|
||||
|
||||
widget = nmt_slave_list_new (conn, bridge_connection_type_filter, bridge);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, 1000000);
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_AGEING_TIME,
|
||||
widget, "text",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
label = nmt_newt_label_new (_("seconds"));
|
||||
nmt_page_grid_append (grid, _("Aging time"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Aging time"), widget, label);
|
||||
|
||||
widget = stp = nmt_newt_checkbox_new (_("Enable STP (Spanning Tree Protocol)"));
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP,
|
||||
widget, "active",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 0, G_MAXINT);
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_PRIORITY,
|
||||
|
|
@ -103,7 +103,7 @@ nmt_page_bridge_constructed (GObject *object)
|
|||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP,
|
||||
widget, "sensitive",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Priority"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Priority"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 2, 30);
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_FORWARD_DELAY,
|
||||
|
|
@ -113,7 +113,7 @@ nmt_page_bridge_constructed (GObject *object)
|
|||
widget, "sensitive",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
label = nmt_newt_label_new (_("seconds"));
|
||||
nmt_page_grid_append (grid, _("Forward delay"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Forward delay"), widget, label);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 1, 10);
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_HELLO_TIME,
|
||||
|
|
@ -123,7 +123,7 @@ nmt_page_bridge_constructed (GObject *object)
|
|||
widget, "sensitive",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
label = nmt_newt_label_new (_("seconds"));
|
||||
nmt_page_grid_append (grid, _("Hello time"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Hello time"), widget, label);
|
||||
|
||||
widget = nmt_newt_entry_numeric_new (10, 6, 40);
|
||||
g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_MAX_AGE,
|
||||
|
|
@ -133,7 +133,7 @@ nmt_page_bridge_constructed (GObject *object)
|
|||
widget, "sensitive",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
label = nmt_newt_label_new (_("seconds"));
|
||||
nmt_page_grid_append (grid, _("Max age"), widget, label);
|
||||
nmt_editor_grid_append (grid, _("Max age"), widget, label);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_bridge_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_BRIDGE_H
|
||||
#define NMT_PAGE_BRIDGE_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_BRIDGE, NmtPageBridgeClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageBridge;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageBridgeClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef NMT_PAGE_DEVICE_H
|
||||
#define NMT_PAGE_DEVICE_H
|
||||
|
||||
#include "nmt-editor-page.h"
|
||||
#include "nmt-device-entry.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NMT_TYPE_PAGE_DEVICE (nmt_page_device_get_type ())
|
||||
#define NMT_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NMT_TYPE_PAGE_DEVICE, NmtPageDevice))
|
||||
#define NMT_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NMT_TYPE_PAGE_DEVICE, NmtPageDeviceClass))
|
||||
#define NMT_IS_PAGE_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NMT_TYPE_PAGE_DEVICE))
|
||||
#define NMT_IS_PAGE_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NMT_TYPE_PAGE_DEVICE))
|
||||
#define NMT_PAGE_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_DEVICE, NmtPageDeviceClass))
|
||||
|
||||
typedef struct {
|
||||
NmtEditorPage parent;
|
||||
|
||||
} NmtPageDevice;
|
||||
|
||||
typedef struct {
|
||||
NmtEditorPageClass parent;
|
||||
|
||||
} NmtPageDeviceClass;
|
||||
|
||||
GType nmt_page_device_get_type (void);
|
||||
|
||||
NmtDeviceEntry *nmt_page_device_get_device_entry (NmtPageDevice *page);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* NMT_PAGE_DEVICE_H */
|
||||
|
|
@ -49,7 +49,7 @@ static void
|
|||
nmt_page_dsl_constructed (GObject *object)
|
||||
{
|
||||
NmtPageDsl *dsl = NMT_PAGE_DSL (object);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingPppoe *s_pppoe;
|
||||
NmtNewtWidget *widget;
|
||||
NMConnection *conn;
|
||||
|
|
@ -61,10 +61,10 @@ nmt_page_dsl_constructed (GObject *object)
|
|||
s_pppoe = nm_connection_get_setting_pppoe (conn);
|
||||
}
|
||||
|
||||
grid = NMT_PAGE_GRID (dsl);
|
||||
grid = NMT_EDITOR_GRID (dsl);
|
||||
|
||||
widget = nmt_newt_entry_new (40, 0);
|
||||
nmt_page_grid_append (grid, _("Username"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Username"), widget, NULL);
|
||||
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_USERNAME,
|
||||
widget, "text",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
|
|
@ -73,10 +73,10 @@ nmt_page_dsl_constructed (GObject *object)
|
|||
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_PASSWORD,
|
||||
widget, "password",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
nmt_page_grid_append (grid, _("Password"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Password"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_entry_new (40, 0);
|
||||
nmt_page_grid_append (grid, _("Service"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Service"), widget, NULL);
|
||||
g_object_bind_property (s_pppoe, NM_SETTING_PPPOE_SERVICE,
|
||||
widget, "text",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include "nmt-mac-entry.h"
|
||||
#include "nmt-mtu-entry.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageEthernet, nmt_page_ethernet, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageEthernet, nmt_page_ethernet, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
NmtNewtWidget *
|
||||
nmt_page_ethernet_new (NMConnection *conn,
|
||||
|
|
@ -54,7 +54,7 @@ nmt_page_ethernet_constructed (GObject *object)
|
|||
{
|
||||
NmtPageEthernet *ethernet = NMT_PAGE_ETHERNET (object);
|
||||
NmtDeviceEntry *deventry;
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingWired *s_wired;
|
||||
NmtNewtWidget *widget;
|
||||
NMConnection *conn;
|
||||
|
|
@ -66,24 +66,24 @@ nmt_page_ethernet_constructed (GObject *object)
|
|||
s_wired = nm_connection_get_setting_wired (conn);
|
||||
}
|
||||
|
||||
deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
|
||||
deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
|
||||
g_object_bind_property (s_wired, NM_SETTING_WIRED_MAC_ADDRESS,
|
||||
deventry, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
grid = NMT_PAGE_GRID (ethernet);
|
||||
grid = NMT_EDITOR_GRID (ethernet);
|
||||
|
||||
widget = nmt_mac_entry_new (40, ETH_ALEN);
|
||||
g_object_bind_property (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
|
||||
widget, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
|
||||
widget = nmt_mtu_entry_new ();
|
||||
g_object_bind_property (s_wired, NM_SETTING_WIRED_MTU,
|
||||
widget, "mtu",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("MTU"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_ethernet_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_ETHERNET_H
|
||||
#define NMT_PAGE_ETHERNET_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_ETHERNET, NmtPageEthernetClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageEthernet;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageEthernetClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "nmt-page-infiniband.h"
|
||||
#include "nmt-mtu-entry.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageInfiniband, nmt_page_infiniband, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageInfiniband, nmt_page_infiniband, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
NmtNewtWidget *
|
||||
nmt_page_infiniband_new (NMConnection *conn,
|
||||
|
|
@ -58,7 +58,7 @@ nmt_page_infiniband_constructed (GObject *object)
|
|||
{
|
||||
NmtPageInfiniband *infiniband = NMT_PAGE_INFINIBAND (object);
|
||||
NmtDeviceEntry *deventry;
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingInfiniband *s_ib;
|
||||
NmtNewtWidget *widget;
|
||||
NMConnection *conn;
|
||||
|
|
@ -76,24 +76,24 @@ nmt_page_infiniband_constructed (GObject *object)
|
|||
NULL);
|
||||
}
|
||||
|
||||
deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
|
||||
deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
|
||||
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_MAC_ADDRESS,
|
||||
deventry, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
grid = NMT_PAGE_GRID (infiniband);
|
||||
grid = NMT_EDITOR_GRID (infiniband);
|
||||
|
||||
widget = nmt_newt_popup_new (transport_mode);
|
||||
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_TRANSPORT_MODE,
|
||||
widget, "active-id",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Transport mode"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Transport mode"), widget, NULL);
|
||||
|
||||
widget = nmt_mtu_entry_new ();
|
||||
g_object_bind_property (s_ib, NM_SETTING_INFINIBAND_MTU,
|
||||
widget, "mtu",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("MTU"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_infiniband_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_INFINIBAND_H
|
||||
#define NMT_PAGE_INFINIBAND_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_INFINIBAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_INFINIBAND, NmtPageInfinibandClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageInfiniband;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageInfinibandClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static void
|
|||
nmt_page_ip4_constructed (GObject *object)
|
||||
{
|
||||
NmtPageIP4 *ip4 = NMT_PAGE_IP4 (object);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingIPConfig *s_ip4;
|
||||
NmtNewtWidget *widget, *button;
|
||||
NMConnection *conn;
|
||||
|
|
@ -135,36 +135,36 @@ nmt_page_ip4_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_editor_page_set_header_widget (NMT_EDITOR_PAGE (ip4), widget);
|
||||
|
||||
grid = NMT_PAGE_GRID (ip4);
|
||||
grid = NMT_EDITOR_GRID (ip4);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4_WITH_PREFIX);
|
||||
nm_editor_bind_ip_addresses_with_prefix_to_strv (AF_INET,
|
||||
s_ip4, NM_SETTING_IP_CONFIG_ADDRESSES,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Addresses"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Addresses"), widget, NULL);
|
||||
|
||||
widget = nmt_ip_entry_new (25, AF_INET, FALSE, TRUE);
|
||||
nm_editor_bind_ip_gateway_to_string (AF_INET,
|
||||
s_ip4,
|
||||
widget, "text", "sensitive",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Gateway"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Gateway"), widget, NULL);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP4);
|
||||
nm_editor_bind_ip_addresses_to_strv (AF_INET,
|
||||
s_ip4, NM_SETTING_IP_CONFIG_DNS,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("DNS servers"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("DNS servers"), widget, NULL);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_HOSTNAME);
|
||||
g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Search domains"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Search domains"), widget, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = g_object_new (NMT_TYPE_NEWT_LABEL,
|
||||
"text", "",
|
||||
|
|
@ -177,22 +177,22 @@ nmt_page_ip4_constructed (GObject *object)
|
|||
NULL, NULL, NULL);
|
||||
button = nmt_newt_button_new (_("Edit..."));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (edit_routes), s_ip4);
|
||||
nmt_page_grid_append (grid, _("Routing"), widget, button);
|
||||
nmt_editor_grid_append (grid, _("Routing"), widget, button);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Never use this network for default route"));
|
||||
g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_NEVER_DEFAULT,
|
||||
widget, "active",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Require IPv4 addressing for this connection"));
|
||||
g_object_bind_property (s_ip4, NM_SETTING_IP_CONFIG_MAY_FAIL,
|
||||
widget, "active",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL |
|
||||
G_BINDING_INVERT_BOOLEAN);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_ip4_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static void
|
|||
nmt_page_ip6_constructed (GObject *object)
|
||||
{
|
||||
NmtPageIP6 *ip6 = NMT_PAGE_IP6 (object);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingIPConfig *s_ip6;
|
||||
NmtNewtWidget *widget, *button;
|
||||
NMConnection *conn;
|
||||
|
|
@ -135,34 +135,34 @@ nmt_page_ip6_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_editor_page_set_header_widget (NMT_EDITOR_PAGE (ip6), widget);
|
||||
|
||||
grid = NMT_PAGE_GRID (ip6);
|
||||
grid = NMT_EDITOR_GRID (ip6);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP6_WITH_PREFIX);
|
||||
nm_editor_bind_ip_addresses_with_prefix_to_strv (AF_INET6,
|
||||
s_ip6, NM_SETTING_IP_CONFIG_ADDRESSES,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Addresses"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Addresses"), widget, NULL);
|
||||
|
||||
widget = nmt_ip_entry_new (25, AF_INET6, FALSE, TRUE);
|
||||
nm_editor_bind_ip_gateway_to_string (AF_INET6,
|
||||
s_ip6,
|
||||
widget, "text", "sensitive",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Gateway"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Gateway"), widget, NULL);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_IP6);
|
||||
nm_editor_bind_ip_addresses_to_strv (AF_INET6,
|
||||
s_ip6, NM_SETTING_IP_CONFIG_DNS,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("DNS servers"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("DNS servers"), widget, NULL);
|
||||
|
||||
widget = nmt_address_list_new (NMT_ADDRESS_LIST_HOSTNAME);
|
||||
g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_DNS_SEARCH,
|
||||
widget, "strings",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Search domains"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Search domains"), widget, NULL);
|
||||
|
||||
widget = g_object_new (NMT_TYPE_NEWT_LABEL,
|
||||
"text", "",
|
||||
|
|
@ -175,22 +175,22 @@ nmt_page_ip6_constructed (GObject *object)
|
|||
NULL, NULL, NULL);
|
||||
button = nmt_newt_button_new (_("Edit..."));
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (edit_routes), s_ip6);
|
||||
nmt_page_grid_append (grid, _("Routing"), widget, button);
|
||||
nmt_editor_grid_append (grid, _("Routing"), widget, button);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Never use this network for default route"));
|
||||
g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_NEVER_DEFAULT,
|
||||
widget, "active",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Require IPv6 addressing for this connection"));
|
||||
g_object_bind_property (s_ip6, NM_SETTING_IP_CONFIG_MAY_FAIL,
|
||||
widget, "active",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL |
|
||||
G_BINDING_INVERT_BOOLEAN);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_ip6_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ permissions_transform_from_allusers (GBinding *binding,
|
|||
}
|
||||
|
||||
static NmtNewtWidget *
|
||||
add_section_for_page (NmtPageGrid *grid, NmtNewtWidget *widget)
|
||||
add_section_for_page (NmtEditorGrid *grid, NmtNewtWidget *widget)
|
||||
{
|
||||
NmtEditorPage *page;
|
||||
NmtNewtWidget *section, *header, *toggle;
|
||||
|
|
@ -138,15 +138,15 @@ add_section_for_page (NmtPageGrid *grid, NmtNewtWidget *widget)
|
|||
|
||||
toggle = nmt_newt_toggle_button_new (_("Hide"), _("Show"));
|
||||
|
||||
header = nmt_page_grid_new ();
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (header),
|
||||
header = nmt_editor_grid_new ();
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (header),
|
||||
nmt_editor_page_get_title (page),
|
||||
nmt_editor_page_get_header_widget (page),
|
||||
toggle);
|
||||
nmt_page_grid_set_row_flags (NMT_PAGE_GRID (header),
|
||||
nmt_editor_grid_set_row_flags (NMT_EDITOR_GRID (header),
|
||||
nmt_editor_page_get_header_widget (page),
|
||||
NMT_PAGE_GRID_ROW_LABEL_ALIGN_LEFT |
|
||||
NMT_PAGE_GRID_ROW_EXTRA_ALIGN_RIGHT);
|
||||
NMT_EDITOR_GRID_ROW_LABEL_ALIGN_LEFT |
|
||||
NMT_EDITOR_GRID_ROW_EXTRA_ALIGN_RIGHT);
|
||||
nmt_newt_section_set_header (NMT_NEWT_SECTION (section), header);
|
||||
|
||||
nmt_newt_section_set_body (NMT_NEWT_SECTION (section), widget);
|
||||
|
|
@ -158,7 +158,7 @@ add_section_for_page (NmtPageGrid *grid, NmtNewtWidget *widget)
|
|||
if (nmt_editor_page_show_by_default (page) || !nmt_newt_widget_get_valid (section))
|
||||
nmt_newt_toggle_button_set_active (NMT_NEWT_TOGGLE_BUTTON (toggle), TRUE);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, section, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, section, NULL);
|
||||
return section;
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ nmt_page_main_constructed (GObject *object)
|
|||
{
|
||||
NmtPageMain *page_main = NMT_PAGE_MAIN (object);
|
||||
NmtPageMainPrivate *priv = NMT_PAGE_MAIN_GET_PRIVATE (page_main);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMConnection *conn;
|
||||
NMSettingConnection *s_con;
|
||||
NmtNewtWidget *widget, *section, *separator;
|
||||
|
|
@ -179,13 +179,13 @@ nmt_page_main_constructed (GObject *object)
|
|||
conn = nmt_editor_page_get_connection (NMT_EDITOR_PAGE (page_main));
|
||||
s_con = nm_connection_get_setting_connection (conn);
|
||||
|
||||
grid = NMT_PAGE_GRID (page_main);
|
||||
grid = NMT_EDITOR_GRID (page_main);
|
||||
|
||||
widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
|
||||
g_object_bind_property (s_con, NM_SETTING_CONNECTION_ID,
|
||||
widget, "text",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Profile name"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Profile name"), widget, NULL);
|
||||
|
||||
if (priv->type_data->virtual)
|
||||
hardware_type = G_TYPE_NONE;
|
||||
|
|
@ -201,13 +201,13 @@ nmt_page_main_constructed (GObject *object)
|
|||
deventry_label = _("Device");
|
||||
|
||||
widget = nmt_device_entry_new (deventry_label, 40, hardware_type);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
deventry = NMT_DEVICE_ENTRY (widget);
|
||||
g_object_bind_property (s_con, NM_SETTING_CONNECTION_INTERFACE_NAME,
|
||||
deventry, "interface-name",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
if (nm_connection_is_type (conn, NM_SETTING_BOND_SETTING_NAME))
|
||||
add_section_for_page (grid, nmt_page_bond_new (conn, deventry));
|
||||
|
|
@ -228,7 +228,7 @@ nmt_page_main_constructed (GObject *object)
|
|||
else if (nm_connection_is_type (conn, NM_SETTING_WIRELESS_SETTING_NAME))
|
||||
add_section_for_page (grid, nmt_page_wifi_new (conn, deventry));
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
slave_type = nm_setting_connection_get_slave_type (s_con);
|
||||
if (slave_type) {
|
||||
|
|
@ -242,18 +242,18 @@ nmt_page_main_constructed (GObject *object)
|
|||
/* Add a separator between ip4 and ip6 that's only visible if ip4 is open */
|
||||
separator = nmt_newt_separator_new ();
|
||||
g_object_bind_property (section, "open", separator, "visible", G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, separator, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, separator, NULL);
|
||||
|
||||
add_section_for_page (grid, nmt_page_ip6_new (conn));
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
}
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Automatically connect"));
|
||||
g_object_bind_property (s_con, NM_SETTING_CONNECTION_AUTOCONNECT,
|
||||
widget, "active",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Available to all users"));
|
||||
g_object_bind_property_full (s_con, NM_SETTING_CONNECTION_PERMISSIONS,
|
||||
|
|
@ -262,7 +262,7 @@ nmt_page_main_constructed (GObject *object)
|
|||
permissions_transform_to_allusers,
|
||||
permissions_transform_from_allusers,
|
||||
NULL, NULL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_main_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
{
|
||||
NmtPagePpp *ppp = NMT_PAGE_PPP (object);
|
||||
NmtPagePppPrivate *priv = NMT_PAGE_PPP_GET_PRIVATE (ppp);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingPpp *s_ppp;
|
||||
NmtNewtWidget *widget, *use_mppe;
|
||||
NmtNewtGrid *auth_grid, *mppe_grid;
|
||||
|
|
@ -131,13 +131,13 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
priv->lcp_echo_failure = 5;
|
||||
}
|
||||
|
||||
grid = NMT_PAGE_GRID (ppp);
|
||||
grid = NMT_EDITOR_GRID (ppp);
|
||||
|
||||
/* Auth methods */
|
||||
widget = nmt_newt_section_new (FALSE);
|
||||
section = NMT_NEWT_SECTION (widget);
|
||||
g_object_set (section, "open", TRUE, NULL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_label_new (_("Allowed authentication methods:"));
|
||||
nmt_newt_section_set_header (section, widget);
|
||||
|
|
@ -186,13 +186,13 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
G_BINDING_SYNC_CREATE);
|
||||
nmt_newt_grid_add (auth_grid, widget, 0, 4);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
/* MPPE */
|
||||
widget = nmt_newt_section_new (FALSE);
|
||||
section = NMT_NEWT_SECTION (widget);
|
||||
g_object_set (section, "open", TRUE, NULL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Use point-to-point encryption (MPPE)"));
|
||||
g_object_bind_property (s_ppp, NM_SETTING_PPP_REQUIRE_MPPE,
|
||||
|
|
@ -226,7 +226,7 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
G_BINDING_SYNC_CREATE);
|
||||
nmt_newt_grid_add (mppe_grid, widget, 0, 1);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Allow BSD data compression"));
|
||||
g_object_bind_property (s_ppp, NM_SETTING_PPP_NOBSDCOMP,
|
||||
|
|
@ -234,7 +234,7 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL |
|
||||
G_BINDING_INVERT_BOOLEAN |
|
||||
G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Allow Deflate data compression"));
|
||||
g_object_bind_property (s_ppp, NM_SETTING_PPP_NODEFLATE,
|
||||
|
|
@ -242,7 +242,7 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL |
|
||||
G_BINDING_INVERT_BOOLEAN |
|
||||
G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Use TCP header compression"));
|
||||
g_object_bind_property (s_ppp, NM_SETTING_PPP_NO_VJ_COMP,
|
||||
|
|
@ -250,9 +250,9 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL |
|
||||
G_BINDING_INVERT_BOOLEAN |
|
||||
G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_newt_checkbox_new (_("Send PPP echo packets"));
|
||||
g_object_bind_property_full (s_ppp, NM_SETTING_PPP_LCP_ECHO_INTERVAL,
|
||||
|
|
@ -269,7 +269,7 @@ nmt_page_ppp_constructed (GObject *object)
|
|||
transform_lcp_echo_properties_to_checkbox,
|
||||
transform_checkbox_to_lcp_echo_failure,
|
||||
ppp, NULL);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_ppp_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ nmt_page_team_port_constructed (GObject *object)
|
|||
priv->s_port = s_port;
|
||||
|
||||
widget = nmt_newt_grid_new ();
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (team), NULL, widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (team), NULL, widget, NULL);
|
||||
|
||||
grid = NMT_NEWT_GRID (widget);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_TEAM_PORT_H
|
||||
#define NMT_PAGE_TEAM_PORT_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "nmt-slave-list.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageTeam, nmt_page_team, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageTeam, nmt_page_team, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
#define NMT_PAGE_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_TEAM, NmtPageTeamPrivate))
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ nmt_page_team_constructed (GObject *object)
|
|||
priv->s_team = s_team;
|
||||
|
||||
widget = nmt_newt_grid_new ();
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (team), NULL, widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (team), NULL, widget, NULL);
|
||||
|
||||
grid = NMT_NEWT_GRID (widget);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_TEAM_H
|
||||
#define NMT_PAGE_TEAM_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_TEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_TEAM, NmtPageTeamClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageTeam;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageTeamClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
#include "nmt-mac-entry.h"
|
||||
#include "nmt-mtu-entry.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageVlan, nmt_page_vlan, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageVlan, nmt_page_vlan, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
#define NMT_PAGE_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_VLAN, NmtPageVlanPrivate))
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ nmt_page_vlan_constructed (GObject *object)
|
|||
{
|
||||
NmtPageVlan *vlan = NMT_PAGE_VLAN (object);
|
||||
NmtPageVlanPrivate *priv = NMT_PAGE_VLAN_GET_PRIVATE (vlan);
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingWired *s_wired;
|
||||
NMSettingVlan *s_vlan;
|
||||
NmtNewtWidget *widget, *parent, *id_entry;
|
||||
|
|
@ -94,7 +94,7 @@ nmt_page_vlan_constructed (GObject *object)
|
|||
}
|
||||
priv->s_wired = g_object_ref_sink (s_wired);
|
||||
|
||||
grid = NMT_PAGE_GRID (vlan);
|
||||
grid = NMT_EDITOR_GRID (vlan);
|
||||
|
||||
nm_editor_bind_vlan_name (s_vlan, nm_connection_get_setting_connection (conn));
|
||||
|
||||
|
|
@ -107,27 +107,27 @@ nmt_page_vlan_constructed (GObject *object)
|
|||
g_object_bind_property (s_wired, NM_SETTING_WIRED_MAC_ADDRESS,
|
||||
widget, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, NULL, widget, NULL);
|
||||
nmt_editor_grid_append (grid, NULL, widget, NULL);
|
||||
|
||||
widget = id_entry = nmt_newt_entry_numeric_new (8, 0, 4095);
|
||||
g_object_bind_property (s_vlan, NM_SETTING_VLAN_ID,
|
||||
widget, "text",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("VLAN id"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("VLAN id"), widget, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_mac_entry_new (40, ETH_ALEN);
|
||||
g_object_bind_property (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS,
|
||||
widget, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
|
||||
widget = nmt_mtu_entry_new ();
|
||||
g_object_bind_property (s_wired, NM_SETTING_WIRED_MTU,
|
||||
widget, "mtu",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("MTU"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_vlan_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_VLAN_H
|
||||
#define NMT_PAGE_VLAN_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_VLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_VLAN, NmtPageVlanClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageVlan;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageVlanClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "nm-editor-bindings.h"
|
||||
|
||||
G_DEFINE_TYPE (NmtPageWifi, nmt_page_wifi, NMT_TYPE_PAGE_DEVICE)
|
||||
G_DEFINE_TYPE (NmtPageWifi, nmt_page_wifi, NMT_TYPE_EDITOR_PAGE_DEVICE)
|
||||
|
||||
#define NMT_PAGE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_WIFI, NmtPageWifiPrivate))
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
NmtPageWifiPrivate *priv = NMT_PAGE_WIFI_GET_PRIVATE (object);
|
||||
NmtPageWifi *wifi = NMT_PAGE_WIFI (object);
|
||||
NmtDeviceEntry *deventry;
|
||||
NmtPageGrid *grid;
|
||||
NmtEditorGrid *grid;
|
||||
NMSettingWireless *s_wireless;
|
||||
NMSettingWirelessSecurity *s_wsec;
|
||||
NmtNewtWidget *widget, *hbox, *subgrid;
|
||||
|
|
@ -209,12 +209,12 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
}
|
||||
priv->s_wsec = g_object_ref_sink (s_wsec);
|
||||
|
||||
deventry = nmt_page_device_get_device_entry (NMT_PAGE_DEVICE (object));
|
||||
deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object));
|
||||
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MAC_ADDRESS,
|
||||
deventry, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
grid = NMT_PAGE_GRID (wifi);
|
||||
grid = NMT_EDITOR_GRID (wifi);
|
||||
|
||||
widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
|
||||
g_object_bind_property_full (s_wireless, NM_SETTING_WIRELESS_SSID,
|
||||
|
|
@ -223,13 +223,13 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
ssid_transform_to_entry,
|
||||
ssid_transform_from_entry,
|
||||
s_wireless, NULL);
|
||||
nmt_page_grid_append (grid, _("SSID"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("SSID"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_popup_new (wifi_mode);
|
||||
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MODE,
|
||||
widget, "active-id",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Mode"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Mode"), widget, NULL);
|
||||
mode = widget;
|
||||
|
||||
hbox = nmt_newt_grid_new ();
|
||||
|
|
@ -255,28 +255,28 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
G_BINDING_SYNC_CREATE,
|
||||
mode_transform_to_band_visibility,
|
||||
NULL, NULL, NULL);
|
||||
nmt_page_grid_append (grid, _("Channel"), hbox, NULL);
|
||||
nmt_editor_grid_append (grid, _("Channel"), hbox, NULL);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_newt_popup_new (wifi_security);
|
||||
nmt_page_grid_append (grid, _("Security"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Security"), widget, NULL);
|
||||
security = widget;
|
||||
|
||||
widget = nmt_newt_stack_new ();
|
||||
stack = NMT_NEWT_STACK (widget);
|
||||
|
||||
/* none */
|
||||
subgrid = nmt_page_grid_new ();
|
||||
subgrid = nmt_editor_grid_new ();
|
||||
nmt_newt_stack_add (stack, "none", subgrid);
|
||||
|
||||
/* wpa-personal */
|
||||
subgrid = nmt_page_grid_new ();
|
||||
subgrid = nmt_editor_grid_new ();
|
||||
widget = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
|
||||
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_PSK,
|
||||
widget, "password",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
|
||||
nmt_newt_stack_add (stack, "wpa-personal", subgrid);
|
||||
|
||||
/* "wpa-enterprise" */
|
||||
|
|
@ -285,13 +285,13 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
nmt_newt_stack_add (stack, "wpa-enterprise", widget);
|
||||
|
||||
/* wep-key */
|
||||
subgrid = nmt_page_grid_new ();
|
||||
subgrid = nmt_editor_grid_new ();
|
||||
|
||||
widget = entry = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Key"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Key"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_popup_new (wep_index);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("WEP index"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("WEP index"), widget, NULL);
|
||||
|
||||
nm_editor_bind_wireless_security_wep_key (s_wsec,
|
||||
entry, "password",
|
||||
|
|
@ -299,18 +299,18 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
widget = nmt_newt_popup_new (wep_auth);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Authentication"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Authentication"), widget, NULL);
|
||||
|
||||
nmt_newt_stack_add (stack, "wep-key", subgrid);
|
||||
|
||||
/* wep-passphrase */
|
||||
subgrid = nmt_page_grid_new ();
|
||||
subgrid = nmt_editor_grid_new ();
|
||||
|
||||
widget = entry = nmt_password_fields_new (40, NMT_PASSWORD_FIELDS_SHOW_PASSWORD);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
|
||||
|
||||
widget = nmt_newt_popup_new (wep_index);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("WEP index"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("WEP index"), widget, NULL);
|
||||
|
||||
nm_editor_bind_wireless_security_wep_key (s_wsec,
|
||||
entry, "password",
|
||||
|
|
@ -318,7 +318,7 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
widget = nmt_newt_popup_new (wep_auth);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Authentication"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Authentication"), widget, NULL);
|
||||
|
||||
nmt_newt_stack_add (stack, "wep-passphrase", subgrid);
|
||||
|
||||
|
|
@ -328,10 +328,10 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
nmt_newt_stack_add (stack, "dynamic-wep", widget);
|
||||
|
||||
/* leap */
|
||||
subgrid = nmt_page_grid_new ();
|
||||
subgrid = nmt_editor_grid_new ();
|
||||
|
||||
widget = nmt_newt_entry_new (40, NMT_NEWT_ENTRY_NONEMPTY);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Username"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Username"), widget, NULL);
|
||||
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME,
|
||||
widget, "text",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
|
|
@ -340,36 +340,36 @@ nmt_page_wifi_constructed (GObject *object)
|
|||
g_object_bind_property (s_wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD,
|
||||
widget, "password",
|
||||
G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
|
||||
nmt_page_grid_append (NMT_PAGE_GRID (subgrid), _("Password"), widget, NULL);
|
||||
nmt_editor_grid_append (NMT_EDITOR_GRID (subgrid), _("Password"), widget, NULL);
|
||||
|
||||
nmt_newt_stack_add (stack, "leap", subgrid);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, NMT_NEWT_WIDGET (stack), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, NMT_NEWT_WIDGET (stack), NULL);
|
||||
g_object_bind_property (security, "active-id",
|
||||
stack, "active-id",
|
||||
G_BINDING_SYNC_CREATE);
|
||||
nm_editor_bind_wireless_security_method (conn, s_wsec, security, "active-id",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
|
||||
nmt_page_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
nmt_editor_grid_append (grid, NULL, nmt_newt_separator_new (), NULL);
|
||||
|
||||
widget = nmt_mac_entry_new (40, ETH_ALEN);
|
||||
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_BSSID,
|
||||
widget, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("BSSID"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("BSSID"), widget, NULL);
|
||||
|
||||
widget = nmt_mac_entry_new (40, ETH_ALEN);
|
||||
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS,
|
||||
widget, "mac-address",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("Cloned MAC address"), widget, NULL);
|
||||
|
||||
widget = nmt_mtu_entry_new ();
|
||||
g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MTU,
|
||||
widget, "mtu",
|
||||
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
nmt_page_grid_append (grid, _("MTU"), widget, NULL);
|
||||
nmt_editor_grid_append (grid, _("MTU"), widget, NULL);
|
||||
|
||||
G_OBJECT_CLASS (nmt_page_wifi_parent_class)->constructed (object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
#ifndef NMT_PAGE_WIFI_H
|
||||
#define NMT_PAGE_WIFI_H
|
||||
|
||||
#include "nmt-page-device.h"
|
||||
#include "nmt-editor-page-device.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ G_BEGIN_DECLS
|
|||
#define NMT_PAGE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NMT_TYPE_PAGE_WIFI, NmtPageWifiClass))
|
||||
|
||||
typedef struct {
|
||||
NmtPageDevice parent;
|
||||
NmtEditorPageDevice parent;
|
||||
|
||||
} NmtPageWifi;
|
||||
|
||||
typedef struct {
|
||||
NmtPageDeviceClass parent;
|
||||
NmtEditorPageDeviceClass parent;
|
||||
|
||||
} NmtPageWifiClass;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue