network-manager-applet r485 - in trunk: . po src/connection-editor
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: network-manager-applet r485 - in trunk: . po src/connection-editor
- Date: Mon, 28 Jan 2008 16:24:04 +0000 (GMT)
Author: dcbw
Date: Mon Jan 28 16:24:04 2008
New Revision: 485
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=485&view=rev
Log:
2008-01-28 Dan Williams <dcbw redhat com>
* po/POTFILES.in
- Add new translatables
* src/connection-editor/Makefile.am
- Add new pae sources and glade files
* src/connection-editor/page-wired.c
src/connection-editor/page-wired.h
src/connection-editor/ce-page-wired.glade
- Split wired bits out
* src/connection-editor/page-wireless.c
src/connection-editor/page-wireless.h
src/connection-editor/ce-page-wireless.glade
- Split wireless bits out
* src/connection-editor/page-wireless-security.c
src/connection-editor/page-wireless-security.h
- Split wireless security bits out
* src/connection-editor/page-ip4-address.c
src/connection-editor/page-ip4-address.h
src/connection-editor/ce-page-ip4-address.glade
- Split IPv4 address bits out
* src/connection-editor/page-ip4.c
src/connection-editor/page-ip4.h
src/connection-editor/ce-page-ip4.glade
- Split IPv4 DNS & search domain bits out
* src/connection-editor/nm-connection-editor.c
src/connection-editor/nm-connection-editor.h
src/connection-editor/nm-connection-editor.glade
- Move all the settings pages to their own sources and glade files
Added:
trunk/src/connection-editor/ce-page-ip4-address.glade
trunk/src/connection-editor/ce-page-ip4.glade
trunk/src/connection-editor/ce-page-wired.glade
trunk/src/connection-editor/ce-page-wireless-security.glade
trunk/src/connection-editor/ce-page-wireless.glade
trunk/src/connection-editor/page-ip4-address.c
trunk/src/connection-editor/page-ip4-address.h
trunk/src/connection-editor/page-ip4.c
trunk/src/connection-editor/page-ip4.h
trunk/src/connection-editor/page-wired.c
trunk/src/connection-editor/page-wired.h
trunk/src/connection-editor/page-wireless-security.c
trunk/src/connection-editor/page-wireless-security.h
trunk/src/connection-editor/page-wireless.c
trunk/src/connection-editor/page-wireless.h
Modified:
trunk/ChangeLog
trunk/po/POTFILES.in
trunk/src/connection-editor/Makefile.am
trunk/src/connection-editor/nm-connection-editor.c
trunk/src/connection-editor/nm-connection-editor.glade
trunk/src/connection-editor/nm-connection-editor.h
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Mon Jan 28 16:24:04 2008
@@ -11,6 +11,16 @@
src/applet.c
src/applet.glade
src/applet.h
+src/connection-editor/ce-page-ip4-address.glade
+src/connection-editor/ce-page-ip4.glade
+src/connection-editor/ce-page-wired.glade
+src/connection-editor/ce-page-wireless.glade
+src/connection-editor/ce-page-wireless-security.glade
+src/connection-editor/page-ip4-address.c
+src/connection-editor/page-ip4.c
+src/connection-editor/page-wired.c
+src/connection-editor/page-wireless.c
+src/connection-editor/page-wireless-security.c
src/connection-editor/nm-connection-editor.c
src/connection-editor/nm-connection-editor.glade
src/connection-editor/nm-connection-list.c
Modified: trunk/src/connection-editor/Makefile.am
==============================================================================
--- trunk/src/connection-editor/Makefile.am (original)
+++ trunk/src/connection-editor/Makefile.am Mon Jan 28 16:24:04 2008
@@ -16,14 +16,24 @@
-I${top_srcdir}/src/wireless-security \
$(NULL)
-nm_connection_editor_SOURCES = \
- byte-array-editor.c \
- byte-array-editor.h \
- nm-connection-editor.c \
- nm-connection-editor.h \
- nm-connection-list.c \
- nm-connection-list.h \
- main.c
+nm_connection_editor_SOURCES = \
+ byte-array-editor.c \
+ byte-array-editor.h \
+ nm-connection-editor.c \
+ nm-connection-editor.h \
+ nm-connection-list.c \
+ nm-connection-list.h \
+ main.c \
+ page-wired.h \
+ page-wired.c \
+ page-wireless.h \
+ page-wireless.c \
+ page-wireless-security.h \
+ page-wireless-security.c \
+ page-ip4.h \
+ page-ip4.c \
+ page-ip4-address.h \
+ page-ip4-address.c
nm_connection_editor_LDADD = \
$(top_builddir)/src/gconf-helpers/libgconf-helpers.la \
@@ -32,7 +42,13 @@
$(NMA_LIBS)
gladedir = $(datadir)/nm-applet
-glade_DATA = nm-connection-editor.glade
+glade_DATA = \
+ nm-connection-editor.glade \
+ ce-page-wired.glade \
+ ce-page-wireless.glade \
+ ce-page-wireless-security.glade \
+ ce-page-ip4.glade \
+ ce-page-ip4-address.glade
CLEANFILES = *.bak *.gladep
Added: trunk/src/connection-editor/ce-page-ip4-address.glade
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/ce-page-ip4-address.glade Mon Jan 28 16:24:04 2008
@@ -0,0 +1,124 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="ip4_address_page_widget">
+ <property name="title" translatable="yes">window4</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkTable" id="IP4AddressPage">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+
+ <child>
+ <widget class="GtkEntry" id="ip4_address_new_address">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="ip4_address_addresses">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVButtonBox" id="vbuttonbox4">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkButton" id="ip4_address_add_ip_address">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="ip4_address_delete_ip_address">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: trunk/src/connection-editor/ce-page-ip4.glade
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/ce-page-ip4.glade Mon Jan 28 16:24:04 2008
@@ -0,0 +1,366 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="ip4_page_widget">
+ <property name="title" translatable="yes">window3</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkVBox" id="IP4Page">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">18</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="ip4_manual">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Manual configuration</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="ip4_dns_servers_box">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="label37">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>DNS Servers</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkTable" id="table7">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+
+ <child>
+ <widget class="GtkEntry" id="ip4_new_dns_server">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="ip4_dns_servers">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVButtonBox" id="vbuttonbox2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkButton" id="ip4_add_dns_server">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="ip4_delete_dns_server">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkLabel" id="ip4_search_domains_box">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"><b>Search Domains</b></property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkTable" id="table8">
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+
+ <child>
+ <widget class="GtkEntry" id="ip4_new_search_domain">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="ip4_search_domains">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">True</property>
+ <property name="fixed_height_mode">False</property>
+ <property name="hover_selection">False</property>
+ <property name="hover_expand">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVButtonBox" id="vbuttonbox3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkButton" id="ip4_add_search_domain">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-add</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="ip4_delete_search_domain">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-delete</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: trunk/src/connection-editor/ce-page-wired.glade
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/ce-page-wired.glade Mon Jan 28 16:24:04 2008
@@ -0,0 +1,273 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="wired_page_widget">
+ <property name="title" translatable="yes">window1</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkTable" id="WiredPage">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="n_rows">6</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Port:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wired_port</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="wired_port">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">default
+Twisted Pair (TP)
+Attachment Unit Interface (AUI)
+BNC
+Media Independent Interface (MII)</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Speed:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wired_speed</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="wired_speed">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">default
+10 Mb/s
+100 Mb/s
+1 Gb/s
+10 Gb/s</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="wired_duplex">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Full duple_x</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="wired_autonegotiate">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Aut_onegotiate</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label26">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_MAC address:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wired_mac_address</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">MT_U:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wired_mtu</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="wired_mtu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="Custom" id="wired_mac_address">
+ <property name="visible">True</property>
+ <property name="creation_function">create_byte_array_editor</property>
+ <property name="int1">0</property>
+ <property name="int2">0</property>
+ <property name="last_modification_time">Wed, 29 Aug 2007 12:24:08 GMT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">expand|shrink|fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: trunk/src/connection-editor/ce-page-wireless-security.glade
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/ce-page-wireless-security.glade Mon Jan 28 16:24:04 2008
@@ -0,0 +1,97 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="wireless_security_page_widget">
+ <property name="title" translatable="yes">window2</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkTable" id="WirelessSecurityPage">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="wireless_security_combo_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Security:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="wireless_security_combo">
+ <property name="visible">True</property>
+ <property name="items">Foo</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="wireless_security_vbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: trunk/src/connection-editor/ce-page-wireless.glade
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/ce-page-wireless.glade Mon Jan 28 16:24:04 2008
@@ -0,0 +1,470 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="wireless_page_widget">
+ <property name="title" translatable="yes">window2</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+
+ <child>
+ <widget class="GtkTable" id="WirelessPage">
+ <property name="border_width">12</property>
+ <property name="visible">True</property>
+ <property name="n_rows">9</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+
+ <child>
+ <widget class="GtkLabel" id="label28">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_SSID:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_ssid</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label29">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">M_ode:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_mode</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="wireless_mode">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Infrastructure
+Adhoc</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label30">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Ban_d:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_band</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="wireless_band">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">default
+A (5 GHz)
+B/G (2.4 GHz)</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label31">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">C_hannel:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_channel</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="wireless_channel">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 196 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label32">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_BSSID:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_bssid</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label33">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Rate:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_rate</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label34">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Transmission po_wer:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_tx_power</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="wireless_rate">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="wireless_tx_power">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label35">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_MAC address:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_mac_address</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label36">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">MT_U:</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="mnemonic_widget">wireless_mtu</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="wireless_mtu">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</property>
+ <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+ <property name="snap_to_ticks">False</property>
+ <property name="wrap">False</property>
+ <property name="adjustment">0 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="Custom" id="wireless_bssid">
+ <property name="visible">True</property>
+ <property name="creation_function">create_byte_array_editor</property>
+ <property name="int1">0</property>
+ <property name="int2">0</property>
+ <property name="last_modification_time">Wed, 29 Aug 2007 12:26:46 GMT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="Custom" id="wireless_mac_address">
+ <property name="visible">True</property>
+ <property name="creation_function">create_byte_array_editor</property>
+ <property name="int1">0</property>
+ <property name="int2">0</property>
+ <property name="last_modification_time">Wed, 29 Aug 2007 12:29:27 GMT</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wireless_ssid">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">True</property>
+ <property name="visibility">True</property>
+ <property name="max_length">0</property>
+ <property name="text" translatable="yes"></property>
+ <property name="has_frame">True</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Modified: trunk/src/connection-editor/nm-connection-editor.c
==============================================================================
--- trunk/src/connection-editor/nm-connection-editor.c (original)
+++ trunk/src/connection-editor/nm-connection-editor.c Mon Jan 28 16:24:04 2008
@@ -21,8 +21,8 @@
*/
#include <string.h>
-#include <math.h>
+#include <gtk/gtk.h>
#include <gtk/gtkcombobox.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkentry.h>
@@ -30,6 +30,7 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtknotebook.h>
#include <gtk/gtklabel.h>
+#include <gtk/gtkmessagedialog.h>
#include <glib/gi18n.h>
#include <nm-setting-connection.h>
@@ -42,10 +43,12 @@
#include "nm-connection-editor.h"
#include "utils.h"
-#include "wireless-security.h"
-#define S_NAME_COLUMN 0
-#define S_SEC_COLUMN 1
+#include "page-wired.h"
+#include "page-wireless.h"
+#include "page-wireless-security.h"
+#include "page-ip4.h"
+#include "page-ip4-address.h"
G_DEFINE_TYPE (NMConnectionEditor, nm_connection_editor, G_TYPE_OBJECT)
@@ -55,8 +58,8 @@
gtk_widget_hide (GTK_WIDGET (dialog));
}
-static int
-get_property_default (NMSetting *setting, const char *property_name)
+int
+ce_get_property_default (NMSetting *setting, const char *property_name)
{
GParamSpec *spec;
GValue value = { 0, };
@@ -87,85 +90,17 @@
return 0;
}
-#define WIRED_PAGE "WiredPage"
-#define WIRED_PREFIX "wired_"
-
-#define WIRELESS_PAGE "WirelessPage"
-#define WIRELESS_PREFIX "wireless_"
-
-#define WIRELESS_SECURITY_PAGE "WirelessSecurityPage"
-#define WIRELESS_SECURITY_PREFIX "wireless_security_"
-
-#define IP4_PAGE "IP4Page"
-#define IP4_PREFIX "ip4_"
-
-#define IP4_ADDRESS_PAGE "IP4AddressPage"
-#define IP4_ADDRESS_PREFIX "ip4_address_"
-
-static inline gboolean
-match_domain (const char *prefix, const char *page, const char *name)
-{
- if (!strncmp (name, prefix, strlen (prefix)))
- return TRUE;
- if (!strcmp (name, page))
- return TRUE;
- return FALSE;
-}
-
-static inline GtkWidget *
-get_widget (NMConnectionEditor *editor, const char *name)
-{
- GtkWidget *widget;
- GladeXML *xml;
- char *domain = "NMConnectionEditor";
-
- g_return_val_if_fail (editor != NULL, NULL);
-
- /* This is all to ensure that the glade_xml_new() never uses the
- * NULL domain, and therefore loads & caches the NMConnectionList
- * widget, because if that happens when the GladeXML is destroyed
- * the cached NMConnectionList widget is destroyed prematurely.
- */
-
- if (match_domain (WIRED_PREFIX, WIRED_PAGE, name))
- domain = WIRED_PAGE;
- else if (match_domain (WIRELESS_SECURITY_PREFIX, WIRELESS_SECURITY_PAGE, name))
- domain = WIRELESS_SECURITY_PAGE;
- else if (match_domain (WIRELESS_PREFIX, WIRELESS_PAGE, name))
- domain = WIRELESS_PAGE;
- else if (match_domain (IP4_PREFIX, IP4_PAGE, name))
- domain = IP4_PAGE;
- else if (match_domain (IP4_ADDRESS_PREFIX, IP4_ADDRESS_PAGE, name))
- domain = IP4_ADDRESS_PAGE;
-
- xml = g_hash_table_lookup (editor->pages, domain);
- if (!xml) {
- xml = glade_xml_new (GLADEDIR "/nm-connection-editor.glade", domain, NULL);
- g_assert (xml);
- g_hash_table_insert (editor->pages, g_strdup (domain), xml);
- }
-
- widget = glade_xml_get_widget (xml, name);
- g_return_val_if_fail (widget != NULL, NULL);
- return widget;
-}
-
static void
add_page (NMConnectionEditor *editor,
- const char *page_name,
- const char *label_text)
+ GtkWidget *page,
+ const char *title)
{
GtkWidget *notebook;
- GtkWidget *page;
GtkWidget *label;
- notebook = get_widget (editor, "notebook");
- page = get_widget (editor, page_name);
- g_object_ref (G_OBJECT (page));
- gtk_widget_unparent (page);
- label = gtk_label_new (label_text);
+ notebook = glade_xml_get_widget (editor->xml, "notebook");
+ label = gtk_label_new (title);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), page, label);
- g_object_unref (G_OBJECT (page));
}
static void
@@ -198,178 +133,13 @@
nm_connection_editor_update_title (editor);
}
-#if 0
-static void
-connection_autoconnect_changed (GtkToggleButton *button, gpointer user_data)
-{
- NMSettingConnection *s_connection;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_connection = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
- if (s_connection)
- s_connection->autoconnect = gtk_toggle_button_get_active (button);
-}
-
-static void
-ethernet_port_changed (GtkComboBox *combo, gpointer user_data)
-{
- NMSettingWired *s_wired;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- if (s_wired) {
- if (s_wired->port)
- g_free (s_wired->port);
-
- switch (gtk_combo_box_get_active (combo)) {
- case 0 : s_wired->port = g_strdup ("tp"); break;
- case 1 : s_wired->port = g_strdup ("aui"); break;
- case 2 : s_wired->port = g_strdup ("bnc"); break;
- case 3 : s_wired->port = g_strdup ("mii"); break;
- }
- }
-}
-
-static void
-ethernet_speed_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWired *s_wired;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- if (s_wired)
- s_wired->speed = gtk_spin_button_get_value_as_int (button);
-}
-
-static void
-ethernet_duplex_changed (GtkToggleButton *button, gpointer user_data)
-{
- NMSettingWired *s_wired;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- if (s_wired) {
- if (s_wired->duplex)
- g_free (s_wired->duplex);
-
- if (gtk_toggle_button_get_active (button))
- s_wired->duplex = g_strdup ("full");
- else
- s_wired->duplex = g_strdup ("half");
- }
-}
-
-static void
-ethernet_autonegotiate_changed (GtkToggleButton *button, gpointer user_data)
-{
- NMSettingWired *s_wired;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- if (s_wired)
- s_wired->auto_negotiate = gtk_toggle_button_get_active (button);
-}
-
-static void
-ethernet_mtu_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWired *s_wired;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- if (s_wired)
- s_wired->mtu = gtk_spin_button_get_value_as_int (button);
-}
-
-static void
-wireless_mode_changed (GtkComboBox *combo, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless) {
- if (s_wireless->mode)
- g_free (s_wireless->mode);
-
- switch (gtk_combo_box_get_active (combo)) {
- case 0 : s_wireless->mode = g_strdup ("infrastructure"); break;
- case 1 : s_wireless->mode = g_strdup ("adhoc"); break;
- }
- }
-}
-
-static void
-wireless_band_changed (GtkComboBox *combo, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless) {
- if (s_wireless->band)
- g_free (s_wireless->band);
-
- switch (gtk_combo_box_get_active (combo)) {
- case 0 : s_wireless->band = g_strdup ("a"); break;
- case 1 : s_wireless->band = g_strdup ("bg"); break;
- }
- }
-}
-
-static void
-wireless_channel_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless)
- s_wireless->channel = gtk_spin_button_get_value_as_int (button);
-}
-
-static void
-wireless_rate_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless)
- s_wireless->rate = gtk_spin_button_get_value_as_int (button);
-}
-
-static void
-wireless_tx_power_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless)
- s_wireless->tx_power = gtk_spin_button_get_value_as_int (button);
-}
-
-static void
-wireless_mtu_changed (GtkSpinButton *button, gpointer user_data)
-{
- NMSettingWireless *s_wireless;
- NMConnectionEditor *editor = (NMConnectionEditor *) user_data;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- if (s_wireless)
- s_wireless->mtu = gtk_spin_button_get_value_as_int (button);
-}
-#endif
-
static void
nm_connection_editor_init (NMConnectionEditor *editor)
{
GtkWidget *widget;
+ GtkWidget *dialog;
if (!g_file_test (GLADEDIR "/applet.glade", G_FILE_TEST_EXISTS)) {
- GtkWidget *dialog;
-
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
@@ -381,16 +151,25 @@
return;
}
- editor->pages = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
+ editor->xml = glade_xml_new (GLADEDIR "/nm-connection-editor.glade", NULL, NULL);
+ if (!editor->xml) {
+ dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_OK,
+ "%s",
+ _("The connection editor could not find some required resources (the glade file was not found)."));
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ gtk_main_quit ();
+ return;
+ }
- editor->dialog = get_widget (editor, "NMConnectionEditor");
+ editor->dialog = glade_xml_get_widget (editor->xml, "NMConnectionEditor");
g_signal_connect (G_OBJECT (editor->dialog), "response", G_CALLBACK (dialog_response_cb), editor);
- widget = get_widget (editor, "connection_name");
+ widget = glade_xml_get_widget (editor->xml, "connection_name");
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (connection_name_changed), editor);
-
- editor->wsec_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
}
static void
@@ -399,11 +178,10 @@
NMConnectionEditor *editor = NM_CONNECTION_EDITOR (object);
if (editor->connection)
- g_object_unref (G_OBJECT (editor->connection));
+ g_object_unref (editor->connection);
gtk_widget_destroy (editor->dialog);
- g_object_unref (G_OBJECT (editor->wsec_group));
- g_hash_table_destroy (editor->pages);
+ g_object_unref (editor->xml);
G_OBJECT_CLASS (nm_connection_editor_parent_class)->finalize (object);
}
@@ -438,28 +216,8 @@
return editor->connection;
}
-static void
-fill_connection_values (NMConnectionEditor *editor)
-{
- NMSettingConnection *s_con;
- GtkWidget *name;
- GtkWidget *autoconnect;
-
- name = get_widget (editor, "connection_name");
- autoconnect = get_widget (editor, "connection_autoconnect");
-
- s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
- if (s_con) {
- gtk_entry_set_text (GTK_ENTRY (name), s_con->id);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoconnect), s_con->autoconnect);
- } else {
- gtk_entry_set_text (GTK_ENTRY (name), NULL);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoconnect), FALSE);
- }
-}
-
-static gint
-spin_output_with_default (GtkSpinButton *spin, gpointer user_data)
+gint
+ce_spin_output_with_default (GtkSpinButton *spin, gpointer user_data)
{
int defvalue = GPOINTER_TO_INT (user_data);
int val;
@@ -479,557 +237,32 @@
}
static void
-add_wired_page (NMConnectionEditor *editor)
-{
- NMSettingWired *s_wired;
- GtkWidget *port;
- int port_idx = 0;
- GtkWidget *speed;
- int speed_idx = 0;
- GtkWidget *duplex;
- GtkWidget *autoneg;
- GtkWidget *mtu;
- int mtu_def;
-
- s_wired = NM_SETTING_WIRED (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRED));
- g_return_if_fail (s_wired != NULL);
-
- add_page (editor, "WiredPage", _("Wired"));
-
- port = get_widget (editor, "wired_port");
- speed = get_widget (editor, "wired_speed");
- duplex = get_widget (editor, "wired_duplex");
- autoneg = get_widget (editor, "wired_autonegotiate");
-
- mtu = get_widget (editor, "wired_mtu");
- mtu_def = get_property_default (NM_SETTING (s_wired), NM_SETTING_WIRED_MTU);
- g_signal_connect (G_OBJECT (mtu), "output",
- (GCallback) spin_output_with_default,
- GINT_TO_POINTER (mtu_def));
-
- if (s_wired->port) {
- if (!strcmp (s_wired->port, "tp"))
- port_idx = 1;
- else if (!strcmp (s_wired->port, "aui"))
- port_idx = 2;
- else if (!strcmp (s_wired->port, "bnc"))
- port_idx = 3;
- else if (!strcmp (s_wired->port, "mii"))
- port_idx = 4;
- }
- gtk_combo_box_set_active (GTK_COMBO_BOX (port), port_idx);
-
- switch (s_wired->speed) {
- case 10:
- speed_idx = 1;
- break;
- case 100:
- speed_idx = 2;
- break;
- case 1000:
- speed_idx = 3;
- break;
- case 10000:
- speed_idx = 4;
- break;
- default:
- break;
- }
- gtk_combo_box_set_active (GTK_COMBO_BOX (speed), speed_idx);
-
- if (!strcmp (s_wired->duplex ? s_wired->duplex : "", "half"))
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplex), FALSE);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplex), TRUE);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoneg), s_wired->auto_negotiate);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (mtu), (gdouble) s_wired->mtu);
-
- /* FIXME: MAC address */
-}
-
-static gboolean
-band_helper (NMConnectionEditor *editor, gboolean *aband, gboolean *gband)
-{
- switch (gtk_combo_box_get_active (GTK_COMBO_BOX (get_widget (editor, "wireless_band")))) {
- case 1: /* A */
- *gband = FALSE;
- return TRUE;
- case 2: /* B/G */
- *aband = FALSE;
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-static gint
-channel_spin_input_cb (GtkSpinButton *spin, gdouble *new_val, gpointer user_data)
-{
- NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
- gdouble channel;
- guint32 int_channel = 0;
- gboolean aband = TRUE;
- gboolean gband = TRUE;
-
- if (!band_helper (editor, &aband, &gband))
- return GTK_INPUT_ERROR;
-
- channel = g_strtod (gtk_entry_get_text (GTK_ENTRY (spin)), NULL);
- if (channel - floor (channel) < ceil (channel) - channel)
- int_channel = floor (channel);
- else
- int_channel = ceil (channel);
-
- if (utils_channel_to_freq (int_channel, aband ? "a" : "bg") == -1)
- return GTK_INPUT_ERROR;
-
- *new_val = channel;
- return TRUE;
-}
-
-static gint
-channel_spin_output_cb (GtkSpinButton *spin, gpointer user_data)
-{
- NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
- int channel;
- gchar *buf = NULL;
- guint32 freq;
- gboolean aband = TRUE;
- gboolean gband = TRUE;
-
- if (!band_helper (editor, &aband, &gband))
- buf = g_strdup (_("default"));
- else {
- channel = gtk_spin_button_get_value_as_int (spin);
- if (channel == 0)
- buf = g_strdup (_("default"));
- else {
- freq = utils_channel_to_freq (channel, aband ? "a" : "bg");
- if (freq == -1) {
- int direction = 0;
-
- if (editor->last_channel < channel)
- direction = 1;
- else if (editor->last_channel > channel)
- direction = -1;
- channel = utils_find_next_channel (channel, direction, aband ? "a" : "bg");
- freq = utils_channel_to_freq (channel, aband ? "a" : "bg");
- if (freq == -1) {
- g_warning ("%s: invalid channel %d!", __func__, channel);
- gtk_spin_button_set_value (spin, 0);
- goto out;
- }
- }
- buf = g_strdup_printf (_("%u (%u MHz)"), channel, freq);
- }
- editor->last_channel = channel;
- }
-
- if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin))))
- gtk_entry_set_text (GTK_ENTRY (spin), buf);
-
-out:
- g_free (buf);
- return TRUE;
-}
-
-static void
-band_value_changed_cb (GtkComboBox *box, gpointer user_data)
-{
- NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
- GtkWidget *widget;
-
- editor->last_channel = 0;
-
- widget = get_widget (editor, "wireless_channel");
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), 0);
-
- switch (gtk_combo_box_get_active (GTK_COMBO_BOX (box))) {
- case 1: /* A */
- case 2: /* B/G */
- gtk_widget_set_sensitive (widget, TRUE);
- break;
- default:
- gtk_widget_set_sensitive (widget, FALSE);
- break;
- }
-}
-
-static void
-add_wireless_page (NMConnectionEditor *editor)
-{
- NMSettingWireless *s_wireless;
- int band_idx = 0;
- GtkWidget *mode;
- GtkWidget *band;
- GtkWidget *channel;
- GtkWidget *rate;
- int rate_def;
- GtkWidget *tx_power;
- int tx_power_def;
- GtkWidget *mtu;
- int mtu_def;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- g_return_if_fail (s_wireless != NULL);
-
- add_page (editor, "WirelessPage", _("Wireless"));
-
- rate = get_widget (editor, "wireless_rate");
- rate_def = get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_RATE);
- g_signal_connect (G_OBJECT (rate), "output",
- (GCallback) spin_output_with_default,
- GINT_TO_POINTER (rate_def));
-
- tx_power = get_widget (editor, "wireless_tx_power");
- tx_power_def = get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_TX_POWER);
- g_signal_connect (G_OBJECT (tx_power), "output",
- (GCallback) spin_output_with_default,
- GINT_TO_POINTER (tx_power_def));
-
- mtu = get_widget (editor, "wireless_mtu");
- mtu_def = get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_MTU);
- g_signal_connect (G_OBJECT (mtu), "output",
- (GCallback) spin_output_with_default,
- GINT_TO_POINTER (mtu_def));
-
- /* FIXME: SSID */
-
- mode = get_widget (editor, "wireless_mode");
- if (!strcmp (s_wireless->mode ? s_wireless->mode : "", "infrastructure"))
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode), 0);
- else if (!strcmp (s_wireless->mode ? s_wireless->mode : "", "adhoc"))
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode), 1);
- else
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode), -1);
-
- channel = get_widget (editor, "wireless_channel");
- g_signal_connect (G_OBJECT (channel), "output",
- (GCallback) channel_spin_output_cb,
- editor);
- g_signal_connect (G_OBJECT (channel), "input",
- (GCallback) channel_spin_input_cb,
- editor);
-
- gtk_widget_set_sensitive (channel, FALSE);
- if (s_wireless->band) {
- if (!strcmp (s_wireless->band ? s_wireless->band : "", "a")) {
- band_idx = 1;
- gtk_widget_set_sensitive (channel, TRUE);
- } else if (!strcmp (s_wireless->band ? s_wireless->band : "", "bg")) {
- band_idx = 2;
- gtk_widget_set_sensitive (channel, TRUE);
- }
- }
- band = get_widget (editor, "wireless_band");
- gtk_combo_box_set_active (GTK_COMBO_BOX (band), band_idx);
- g_signal_connect (G_OBJECT (band), "changed",
- (GCallback) band_value_changed_cb,
- editor);
-
- /* Update the channel _after_ the band has been set so that it gets
- * the right values */
- editor->last_channel = s_wireless->channel;
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (channel), (gdouble) s_wireless->channel);
-
- /* FIXME: BSSID */
- /* FIXME: MAC address */
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate), (gdouble) s_wireless->rate);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (tx_power), (gdouble) s_wireless->tx_power);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (mtu), (gdouble) s_wireless->mtu);
-}
-
-static void
-add_ip4_pages (NMConnectionEditor *editor)
+fill_connection_values (NMConnectionEditor *editor)
{
- NMSettingIP4Config *s_ip4;
+ NMSettingConnection *s_con;
+ GtkWidget *name;
+ GtkWidget *autoconnect;
- add_page (editor, "IP4Page", _("IPv4 Settings"));
- add_page (editor, "IP4AddressPage", _("IPv4 Addresses"));
+ name = glade_xml_get_widget (editor->xml, "connection_name");
+ autoconnect = glade_xml_get_widget (editor->xml, "connection_autoconnect");
- s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_IP4_CONFIG));
- if (s_ip4) {
+ s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_CONNECTION));
+ if (s_con) {
+ gtk_entry_set_text (GTK_ENTRY (name), s_con->id);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoconnect), s_con->autoconnect);
} else {
+ gtk_entry_set_text (GTK_ENTRY (name), NULL);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoconnect), FALSE);
}
}
-static NMUtilsSecurityType
-get_default_type_for_security (NMSettingWirelessSecurity *sec)
-{
- if (!sec)
- return NMU_SEC_NONE;
-
- /* No IEEE 802.1x */
- if (!strcmp (sec->key_mgmt, "none")) {
- /* Static WEP */
- if ( sec->wep_tx_keyidx
- || sec->wep_key0
- || sec->wep_key1
- || sec->wep_key2
- || sec->wep_key3
- || (sec->auth_alg && !strcmp (sec->auth_alg, "shared")))
- return NMU_SEC_STATIC_WEP;
-
- /* Unencrypted */
- return NMU_SEC_NONE;
- }
-
- if (!strcmp (sec->key_mgmt, "ieee8021x")) {
- if (sec->auth_alg && !strcmp (sec->auth_alg, "leap"))
- return NMU_SEC_LEAP;
- return NMU_SEC_DYNAMIC_WEP;
- }
-
- if ( !strcmp (sec->key_mgmt, "wpa-none")
- || !strcmp (sec->key_mgmt, "wpa-psk")) {
- if (sec->proto && !strcmp (sec->proto->data, "rsn"))
- return NMU_SEC_WPA2_PSK;
- else if (sec->proto && !strcmp (sec->proto->data, "wpa"))
- return NMU_SEC_WPA_PSK;
- else
- return NMU_SEC_WPA_PSK;
- }
-
- if (!strcmp (sec->key_mgmt, "wpa-eap")) {
- if (sec->proto && !strcmp (sec->proto->data, "rsn"))
- return NMU_SEC_WPA2_ENTERPRISE;
- else if (sec->proto && !strcmp (sec->proto->data, "wpa"))
- return NMU_SEC_WPA_ENTERPRISE;
- else
- return NMU_SEC_WPA_ENTERPRISE;
- }
-
- return NMU_SEC_INVALID;
-}
-
-static void
-stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
-{
- NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
- GtkWidget *widget;
- gboolean valid = FALSE;
- NMSettingWireless *s_wireless;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (editor->connection, NM_TYPE_SETTING_WIRELESS));
- g_assert (s_wireless);
-
- valid = wireless_security_validate (sec, s_wireless->ssid);
- widget = get_widget (editor, "ok_button");
- gtk_widget_set_sensitive (widget, valid);
-}
-
-static void
-wsec_size_group_clear (GtkSizeGroup *group)
-{
- GSList *children;
- GSList *iter;
-
- g_return_if_fail (group != NULL);
-
- children = gtk_size_group_get_widgets (group);
- for (iter = children; iter; iter = g_slist_next (iter))
- gtk_size_group_remove_widget (group, GTK_WIDGET (iter->data));
-}
-
-static void
-wireless_security_combo_changed (GtkWidget *combo,
- gpointer user_data)
-{
- NMConnectionEditor *editor = NM_CONNECTION_EDITOR (user_data);
- GtkWidget *vbox;
- GList *elt, *children;
- GtkTreeIter iter;
- GtkTreeModel *model;
- WirelessSecurity *sec = NULL;
-
- vbox = get_widget (editor, "wireless_security_vbox");
- g_assert (vbox);
-
- wsec_size_group_clear (editor->wsec_group);
-
- /* Remove any previous wireless security widgets */
- children = gtk_container_get_children (GTK_CONTAINER (vbox));
- for (elt = children; elt; elt = g_list_next (elt))
- gtk_container_remove (GTK_CONTAINER (vbox), GTK_WIDGET (elt->data));
-
- model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
- gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
- if (sec) {
- GtkWidget *sec_widget;
- GtkWidget *widget;
-
- sec_widget = wireless_security_get_widget (sec);
- g_assert (sec_widget);
-
- widget = get_widget (editor, "wireless_security_combo_label");
- gtk_size_group_add_widget (editor->wsec_group, widget);
- wireless_security_add_to_size_group (sec, editor->wsec_group);
-
- gtk_container_add (GTK_CONTAINER (vbox), sec_widget);
- wireless_security_unref (sec);
- }
-}
-
-static void
-add_security_item (NMConnectionEditor *editor,
- WirelessSecurity *sec,
- GtkListStore *model,
- GtkTreeIter *iter,
- const char *text)
-{
- wireless_security_set_changed_notify (sec, stuff_changed_cb, editor);
- gtk_list_store_append (model, iter);
- gtk_list_store_set (model, iter, S_NAME_COLUMN, text, S_SEC_COLUMN, sec, -1);
- wireless_security_unref (sec);
-}
-
-static void
-add_wireless_security_page (NMConnectionEditor *editor, NMConnection *connection)
-{
- NMSettingWireless *s_wireless;
- NMSettingWirelessSecurity *s_wireless_sec;
- gboolean is_adhoc = FALSE;
- GtkListStore *sec_model;
- GtkTreeIter iter;
- guint32 dev_caps = 0;
- NMUtilsSecurityType default_type = NMU_SEC_NONE;
- int active = -1;
- int item = 0;
- const char *glade_file = GLADEDIR "/applet.glade";
- GtkWidget *combo;
-
- add_page (editor, "WirelessSecurityPage", _("Wireless Security"));
-
- combo = get_widget (editor, "wireless_security_combo");
-
- dev_caps = NM_802_11_DEVICE_CAP_CIPHER_WEP40
- | NM_802_11_DEVICE_CAP_CIPHER_WEP104
- | NM_802_11_DEVICE_CAP_CIPHER_TKIP
- | NM_802_11_DEVICE_CAP_CIPHER_CCMP
- | NM_802_11_DEVICE_CAP_WPA
- | NM_802_11_DEVICE_CAP_RSN;
-
- s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS));
- g_assert (s_wireless);
-
- if (s_wireless->mode && !strcmp (s_wireless->mode, "adhoc"))
- is_adhoc = TRUE;
-
- s_wireless_sec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection,
- NM_TYPE_SETTING_WIRELESS_SECURITY));
- default_type = get_default_type_for_security (s_wireless_sec);
-
- sec_model = gtk_list_store_new (2, G_TYPE_STRING, wireless_security_get_g_type ());
-
- if (nm_utils_security_valid (NMU_SEC_NONE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- gtk_list_store_append (sec_model, &iter);
- gtk_list_store_set (sec_model, &iter,
- S_NAME_COLUMN, _("None"),
- -1);
- if (default_type == NMU_SEC_NONE)
- active = item;
- }
-
- if (nm_utils_security_valid (NMU_SEC_STATIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- WirelessSecurityWEPKey *ws_wep_hex;
- WirelessSecurityWEPKey *ws_wep_ascii;
- WirelessSecurityWEPPassphrase *ws_wep_passphrase;
-
- ws_wep_passphrase = ws_wep_passphrase_new (glade_file, connection);
- if (ws_wep_passphrase) {
- add_security_item (editor, WIRELESS_SECURITY (ws_wep_passphrase), sec_model,
- &iter, _("WEP 128-bit Passphrase"));
- if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
- active = item++;
- }
-
- ws_wep_hex = ws_wep_key_new (glade_file, connection, WEP_KEY_TYPE_HEX);
- if (ws_wep_hex) {
- add_security_item (editor, WIRELESS_SECURITY (ws_wep_hex), sec_model,
- &iter, _("WEP 40/128-bit Hexadecimal"));
- if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
- active = item++;
- }
-
- ws_wep_ascii = ws_wep_key_new (glade_file, connection, WEP_KEY_TYPE_ASCII);
- if (ws_wep_ascii) {
- add_security_item (editor, WIRELESS_SECURITY (ws_wep_ascii), sec_model,
- &iter, _("WEP 40/128-bit ASCII"));
- if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
- active = item++;
- }
- }
-
- if (nm_utils_security_valid (NMU_SEC_LEAP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- WirelessSecurityLEAP *ws_leap;
-
- ws_leap = ws_leap_new (glade_file, connection);
- if (ws_leap) {
- add_security_item (editor, WIRELESS_SECURITY (ws_leap), sec_model,
- &iter, _("LEAP"));
- if ((active < 0) && (default_type == NMU_SEC_LEAP))
- active = item++;
- }
- }
-
- if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- WirelessSecurityDynamicWEP *ws_dynamic_wep;
-
- ws_dynamic_wep = ws_dynamic_wep_new (glade_file, connection);
- if (ws_dynamic_wep) {
- add_security_item (editor, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
- &iter, _("Dynamic WEP (802.1x)"));
- if ((active < 0) && (default_type == NMU_SEC_DYNAMIC_WEP))
- active = item++;
- }
- }
-
- if ( nm_utils_security_valid (NMU_SEC_WPA_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)
- || nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- WirelessSecurityWPAPSK *ws_wpa_psk;
-
- ws_wpa_psk = ws_wpa_psk_new (glade_file, connection);
- if (ws_wpa_psk) {
- add_security_item (editor, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
- &iter, _("WPA & WPA2 Personal"));
- if ((active < 0) && ((default_type == NMU_SEC_WPA_PSK) || (default_type == NMU_SEC_WPA2_PSK)))
- active = item++;
- }
- }
-
- if ( nm_utils_security_valid (NMU_SEC_WPA_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)
- || nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
- WirelessSecurityWPAEAP *ws_wpa_eap;
-
- ws_wpa_eap = ws_wpa_eap_new (glade_file, connection);
- if (ws_wpa_eap) {
- add_security_item (editor, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
- &iter, _("WPA & WPA2 Enterprise"));
- if ((active < 0) && ((default_type == NMU_SEC_WPA_ENTERPRISE) || (default_type == NMU_SEC_WPA2_ENTERPRISE)))
- active = item++;
- }
- }
-
- gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (sec_model));
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo), active < 0 ? 0 : (guint32) active);
- g_object_unref (G_OBJECT (sec_model));
-
- wireless_security_combo_changed (combo, editor);
- g_signal_connect (G_OBJECT (combo),
- "changed",
- GTK_SIGNAL_FUNC (wireless_security_combo_changed),
- editor);
-}
-
void
nm_connection_editor_set_connection (NMConnectionEditor *editor, NMConnection *connection)
{
NMSettingConnection *s_con;
-// GtkWidget *widget;
+ GtkWidget *widget;
+ char *title = NULL;
+ GtkWidget *ok_button;
g_return_if_fail (NM_IS_CONNECTION_EDITOR (editor));
g_return_if_fail (connection != NULL);
@@ -1043,18 +276,49 @@
editor->connection = (NMConnection *) g_object_ref (connection);
nm_connection_editor_update_title (editor);
+ ok_button = glade_xml_get_widget (editor->xml, "ok_button");
+
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
g_assert (s_con);
if (!strcmp (s_con->type, NM_SETTING_WIRED_SETTING_NAME)) {
- add_wired_page (editor);
- add_ip4_pages (editor);
+ widget = page_wired_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
+
+ widget = page_ip4_address_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
+
+ widget = page_ip4_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
} else if (!strcmp (s_con->type, NM_SETTING_WIRELESS_SETTING_NAME)) {
- add_wireless_page (editor);
- add_wireless_security_page (editor, connection);
- add_ip4_pages (editor);
+ GtkWidget *wireless_page;
+
+ wireless_page = page_wireless_new (editor->connection, (const char **) &title);
+ if (wireless_page)
+ add_page (editor, wireless_page, title);
+
+ widget = page_wireless_security_new (editor->connection, ok_button, wireless_page, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
+
+ widget = page_ip4_address_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
+
+ widget = page_ip4_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
} else if (!strcmp (s_con->type, NM_SETTING_VPN_SETTING_NAME)) {
- add_ip4_pages (editor);
+ widget = page_ip4_address_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
+
+ widget = page_ip4_new (editor->connection, (const char **) &title);
+ if (widget)
+ add_page (editor, widget, title);
} else {
g_warning ("Unhandled setting type '%s'", s_con->type);
}
Modified: trunk/src/connection-editor/nm-connection-editor.glade
==============================================================================
--- trunk/src/connection-editor/nm-connection-editor.glade (original)
+++ trunk/src/connection-editor/nm-connection-editor.glade Mon Jan 28 16:24:04 2008
@@ -325,1304 +325,4 @@
</child>
</widget>
-<widget class="GtkWindow" id="wired_page_widget">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkTable" id="WiredPage">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="n_rows">6</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Port:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wired_port</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="wired_port">
- <property name="visible">True</property>
- <property name="items" translatable="yes">default
-Twisted Pair (TP)
-Attachment Unit Interface (AUI)
-BNC
-Media Independent Interface (MII)</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Speed:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wired_speed</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="wired_speed">
- <property name="visible">True</property>
- <property name="items" translatable="yes">default
-10 Mb/s
-100 Mb/s
-1 Gb/s
-10 Gb/s</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="wired_duplex">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Full duple_x</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="wired_autonegotiate">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Aut_onegotiate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label26">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_MAC address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wired_mac_address</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="visible">True</property>
- <property name="label" translatable="yes">MT_U:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wired_mtu</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="wired_mtu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="wired_mac_address">
- <property name="visible">True</property>
- <property name="creation_function">create_byte_array_editor</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Wed, 29 Aug 2007 12:24:08 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">expand|shrink|fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="wireless_page_widget">
- <property name="title" translatable="yes">window2</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkTable" id="WirelessPage">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="n_rows">9</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label28">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_SSID:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_ssid</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label29">
- <property name="visible">True</property>
- <property name="label" translatable="yes">M_ode:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_mode</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="wireless_mode">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Infrastructure
-Adhoc</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label30">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ban_d:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_band</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="wireless_band">
- <property name="visible">True</property>
- <property name="items" translatable="yes">default
-A (5 GHz)
-B/G (2.4 GHz)</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label31">
- <property name="visible">True</property>
- <property name="label" translatable="yes">C_hannel:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_channel</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="wireless_channel">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 196 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label32">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_BSSID:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_bssid</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label33">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Rate:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_rate</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label34">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Transmission po_wer:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_tx_power</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="wireless_rate">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="wireless_tx_power">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label35">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_MAC address:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_mac_address</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label36">
- <property name="visible">True</property>
- <property name="label" translatable="yes">MT_U:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">wireless_mtu</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="wireless_mtu">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="wireless_bssid">
- <property name="visible">True</property>
- <property name="creation_function">create_byte_array_editor</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Wed, 29 Aug 2007 12:26:46 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="wireless_mac_address">
- <property name="visible">True</property>
- <property name="creation_function">create_byte_array_editor</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Wed, 29 Aug 2007 12:29:27 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="wireless_ssid">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="ip4_page_widget">
- <property name="title" translatable="yes">window3</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkVBox" id="IP4Page">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkCheckButton" id="ip4_manual">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Manual configuration</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="ip4_dns_servers_box">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label37">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>DNS Servers</b></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkTable" id="table7">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="ip4_new_dns_server">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="ip4_dns_servers">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">True</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="ip4_add_dns_server">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="ip4_delete_dns_server">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-delete</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="ip4_search_domains_box">
- <property name="visible">True</property>
- <property name="label" translatable="yes"><b>Search Domains</b></property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkTable" id="table8">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="ip4_new_search_domain">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="ip4_search_domains">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">True</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox3">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="ip4_add_search_domain">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="ip4_delete_search_domain">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-delete</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="ip4_address_page_widget">
- <property name="title" translatable="yes">window4</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkTable" id="IP4AddressPage">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">6</property>
-
- <child>
- <widget class="GtkEntry" id="ip4_address_new_address">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="ip4_address_addresses">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">True</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="ip4_address_add_ip_address">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="ip4_address_delete_ip_address">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-delete</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkWindow" id="wireless_security_page_widget">
- <property name="title" translatable="yes">window2</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
- <property name="decorated">True</property>
- <property name="skip_taskbar_hint">False</property>
- <property name="skip_pager_hint">False</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
-
- <child>
- <widget class="GtkTable" id="WirelessSecurityPage">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="wireless_security_combo_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Security:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="wireless_security_combo">
- <property name="visible">True</property>
- <property name="items">Foo</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="wireless_security_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
</glade-interface>
Modified: trunk/src/connection-editor/nm-connection-editor.h
==============================================================================
--- trunk/src/connection-editor/nm-connection-editor.h (original)
+++ trunk/src/connection-editor/nm-connection-editor.h Mon Jan 28 16:24:04 2008
@@ -27,6 +27,7 @@
#include <nm-connection.h>
#include <glade/glade-xml.h>
#include <gtk/gtksizegroup.h>
+#include <gtk/gtkspinbutton.h>
#define NM_TYPE_CONNECTION_EDITOR (nm_connection_editor_get_type ())
#define NM_IS_CONNECTION_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION_EDITOR))
@@ -39,9 +40,7 @@
NMConnection *connection;
GHashTable *pages;
GtkWidget *dialog;
- GtkSizeGroup *wsec_group;
-
- guint32 last_channel;
+ GladeXML *xml;
} NMConnectionEditor;
typedef struct {
@@ -56,4 +55,8 @@
NMConnection *nm_connection_editor_get_connection (NMConnectionEditor *editor);
void nm_connection_editor_set_connection (NMConnectionEditor *editor, NMConnection *connection);
+gint ce_spin_output_with_default (GtkSpinButton *spin, gpointer user_data);
+
+int ce_get_property_default (NMSetting *setting, const char *property_name);
+
#endif
Added: trunk/src/connection-editor/page-ip4-address.c
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-ip4-address.c Mon Jan 28 16:24:04 2008
@@ -0,0 +1,58 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <nm-setting-connection.h>
+#include <nm-setting-ip4-config.h>
+
+#include "page-ip4-address.h"
+
+GtkWidget *
+page_ip4_address_new (NMConnection *connection, const char **title)
+{
+ GladeXML *xml;
+ GtkWidget *page;
+ NMSettingIP4Config *s_ip4;
+
+ xml = glade_xml_new (GLADEDIR "/ce-page-ip4-address.glade", "IP4AddressPage", NULL);
+ g_return_val_if_fail (xml != NULL, NULL);
+ *title = _("IPv4 Addresses");
+
+ page = glade_xml_get_widget (xml, "IP4AddressPage");
+ g_return_val_if_fail (page != NULL, NULL);
+ g_object_set_data_full (G_OBJECT (page),
+ "glade-xml", xml,
+ (GDestroyNotify) g_object_unref);
+
+ s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG));
+ if (s_ip4 == NULL)
+ goto out;
+
+out:
+ return page;
+}
+
+
Added: trunk/src/connection-editor/page-ip4-address.h
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-ip4-address.h Mon Jan 28 16:24:04 2008
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#ifndef __PAGE_IP4_ADDRESS_H__
+#define __PAGE_IP4_ADDRESS_H__
+
+#include "nm-connection-editor.h"
+
+GtkWidget *page_ip4_address_new (NMConnection *connection, const char **title);
+
+
+#endif /* __PAGE_IP4_ADDRESS_H__ */
+
Added: trunk/src/connection-editor/page-ip4.c
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-ip4.c Mon Jan 28 16:24:04 2008
@@ -0,0 +1,58 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <nm-setting-connection.h>
+#include <nm-setting-ip4-config.h>
+
+#include "page-ip4.h"
+
+GtkWidget *
+page_ip4_new (NMConnection *connection, const char **title)
+{
+ GladeXML *xml;
+ GtkWidget *page;
+ NMSettingIP4Config *s_ip4;
+
+ xml = glade_xml_new (GLADEDIR "/ce-page-ip4.glade", "IP4Page", NULL);
+ g_return_val_if_fail (xml != NULL, NULL);
+ *title = _("IPv4 Settings");
+
+ page = glade_xml_get_widget (xml, "IP4Page");
+ g_return_val_if_fail (page != NULL, NULL);
+ g_object_set_data_full (G_OBJECT (page),
+ "glade-xml", xml,
+ (GDestroyNotify) g_object_unref);
+
+ s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG));
+ if (s_ip4 == NULL)
+ goto out;
+
+out:
+ return page;
+}
+
+
Added: trunk/src/connection-editor/page-ip4.h
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-ip4.h Mon Jan 28 16:24:04 2008
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#ifndef __PAGE_IP4_H__
+#define __PAGE_IP4_H__
+
+#include "nm-connection-editor.h"
+
+GtkWidget *page_ip4_new (NMConnection *connection, const char **title);
+
+
+#endif /* __PAGE_IP4_H__ */
+
Added: trunk/src/connection-editor/page-wired.c
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wired.c Mon Jan 28 16:24:04 2008
@@ -0,0 +1,115 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <nm-setting-connection.h>
+#include <nm-setting-wired.h>
+
+#include "page-wired.h"
+
+GtkWidget *
+page_wired_new (NMConnection *connection, const char **title)
+{
+ GladeXML *xml;
+ GtkWidget *page;
+ NMSettingWired *s_wired;
+ GtkWidget *port;
+ int port_idx = 0;
+ GtkWidget *speed;
+ int speed_idx = 0;
+ GtkWidget *duplex;
+ GtkWidget *autoneg;
+ GtkWidget *mtu;
+ int mtu_def;
+
+ s_wired = NM_SETTING_WIRED (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED));
+ g_return_val_if_fail (s_wired != NULL, NULL);
+
+ xml = glade_xml_new (GLADEDIR "/ce-page-wired.glade", "WiredPage", NULL);
+ g_return_val_if_fail (xml != NULL, NULL);
+ *title = _("Wired");
+
+ page = glade_xml_get_widget (xml, "WiredPage");
+ g_return_val_if_fail (page != NULL, NULL);
+ g_object_set_data_full (G_OBJECT (page),
+ "glade-xml", xml,
+ (GDestroyNotify) g_object_unref);
+
+ port = glade_xml_get_widget (xml, "wired_port");
+ speed = glade_xml_get_widget (xml, "wired_speed");
+ duplex = glade_xml_get_widget (xml, "wired_duplex");
+ autoneg = glade_xml_get_widget (xml, "wired_autonegotiate");
+
+ mtu = glade_xml_get_widget (xml, "wired_mtu");
+ mtu_def = ce_get_property_default (NM_SETTING (s_wired), NM_SETTING_WIRED_MTU);
+ g_signal_connect (G_OBJECT (mtu), "output",
+ (GCallback) ce_spin_output_with_default,
+ GINT_TO_POINTER (mtu_def));
+
+ if (s_wired->port) {
+ if (!strcmp (s_wired->port, "tp"))
+ port_idx = 1;
+ else if (!strcmp (s_wired->port, "aui"))
+ port_idx = 2;
+ else if (!strcmp (s_wired->port, "bnc"))
+ port_idx = 3;
+ else if (!strcmp (s_wired->port, "mii"))
+ port_idx = 4;
+ }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (port), port_idx);
+
+ switch (s_wired->speed) {
+ case 10:
+ speed_idx = 1;
+ break;
+ case 100:
+ speed_idx = 2;
+ break;
+ case 1000:
+ speed_idx = 3;
+ break;
+ case 10000:
+ speed_idx = 4;
+ break;
+ default:
+ break;
+ }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (speed), speed_idx);
+
+ if (!strcmp (s_wired->duplex ? s_wired->duplex : "", "half"))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplex), FALSE);
+ else
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplex), TRUE);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoneg), s_wired->auto_negotiate);
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (mtu), (gdouble) s_wired->mtu);
+
+ /* FIXME: MAC address */
+ return page;
+}
+
+
Added: trunk/src/connection-editor/page-wired.h
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wired.h Mon Jan 28 16:24:04 2008
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#ifndef __PAGE_WIRED_H__
+#define __PAGE_WIRED_H__
+
+#include "nm-connection-editor.h"
+
+GtkWidget *page_wired_new (NMConnection *connection, const char **title);
+
+
+#endif /* __PAGE_WIRED_H__ */
+
Added: trunk/src/connection-editor/page-wireless-security.c
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wireless-security.c Mon Jan 28 16:24:04 2008
@@ -0,0 +1,350 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <NetworkManager.h>
+#include <nm-setting-connection.h>
+#include <nm-setting-wireless.h>
+#include <nm-setting-wireless-security.h>
+#include <nm-utils.h>
+
+#include "wireless-security.h"
+#include "page-wireless-security.h"
+
+#define S_NAME_COLUMN 0
+#define S_SEC_COLUMN 1
+
+static NMUtilsSecurityType
+get_default_type_for_security (NMSettingWirelessSecurity *sec)
+{
+ if (!sec)
+ return NMU_SEC_NONE;
+
+ /* No IEEE 802.1x */
+ if (!strcmp (sec->key_mgmt, "none")) {
+ /* Static WEP */
+ if ( sec->wep_tx_keyidx
+ || sec->wep_key0
+ || sec->wep_key1
+ || sec->wep_key2
+ || sec->wep_key3
+ || (sec->auth_alg && !strcmp (sec->auth_alg, "shared")))
+ return NMU_SEC_STATIC_WEP;
+
+ /* Unencrypted */
+ return NMU_SEC_NONE;
+ }
+
+ if (!strcmp (sec->key_mgmt, "ieee8021x")) {
+ if (sec->auth_alg && !strcmp (sec->auth_alg, "leap"))
+ return NMU_SEC_LEAP;
+ return NMU_SEC_DYNAMIC_WEP;
+ }
+
+ if ( !strcmp (sec->key_mgmt, "wpa-none")
+ || !strcmp (sec->key_mgmt, "wpa-psk")) {
+ if (sec->proto && !strcmp (sec->proto->data, "rsn"))
+ return NMU_SEC_WPA2_PSK;
+ else if (sec->proto && !strcmp (sec->proto->data, "wpa"))
+ return NMU_SEC_WPA_PSK;
+ else
+ return NMU_SEC_WPA_PSK;
+ }
+
+ if (!strcmp (sec->key_mgmt, "wpa-eap")) {
+ if (sec->proto && !strcmp (sec->proto->data, "rsn"))
+ return NMU_SEC_WPA2_ENTERPRISE;
+ else if (sec->proto && !strcmp (sec->proto->data, "wpa"))
+ return NMU_SEC_WPA_ENTERPRISE;
+ else
+ return NMU_SEC_WPA_ENTERPRISE;
+ }
+
+ return NMU_SEC_INVALID;
+}
+
+static void
+stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
+{
+ GtkWidget *page = GTK_WIDGET (user_data);
+ GtkWidget *wireless_page;
+ GtkWidget *widget;
+ GladeXML *xml;
+ const char *txt_ssid;
+ GByteArray *ssid = NULL;
+ gboolean valid = FALSE;
+
+ // FIXME: hack until a real per-page validation system gets implemented
+ wireless_page = g_object_get_data (G_OBJECT (page), "wireless-page");
+ xml = g_object_get_data (G_OBJECT (wireless_page), "glade-xml");
+ widget = glade_xml_get_widget (xml, "wireless_ssid");
+
+ txt_ssid = gtk_entry_get_text (GTK_ENTRY (widget));
+ if (txt_ssid && strlen (txt_ssid)) {
+ ssid = g_byte_array_sized_new (strlen (txt_ssid));
+ g_byte_array_append (ssid, (const guint8 *) txt_ssid, strlen (txt_ssid));
+ valid = wireless_security_validate (sec, ssid);
+ g_byte_array_free (ssid, TRUE);
+ }
+
+ widget = g_object_get_data (G_OBJECT (page), "ok-button");
+ gtk_widget_set_sensitive (widget, valid);
+}
+
+static void
+wsec_size_group_clear (GtkSizeGroup *group)
+{
+ GSList *children;
+ GSList *iter;
+
+ g_return_if_fail (group != NULL);
+
+ children = gtk_size_group_get_widgets (group);
+ for (iter = children; iter; iter = g_slist_next (iter))
+ gtk_size_group_remove_widget (group, GTK_WIDGET (iter->data));
+}
+
+static void
+wireless_security_combo_changed (GtkWidget *combo,
+ gpointer user_data)
+{
+ GtkWidget *page = GTK_WIDGET (user_data);
+ GtkWidget *vbox;
+ GList *elt, *children;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ WirelessSecurity *sec = NULL;
+ GladeXML *xml;
+ GtkSizeGroup *wsec_group;
+
+ xml = g_object_get_data (G_OBJECT (page), "glade-xml");
+ wsec_group = g_object_get_data (G_OBJECT (page), "size-group");
+
+ vbox = glade_xml_get_widget (xml, "wireless_security_vbox");
+ g_assert (vbox);
+
+ wsec_size_group_clear (wsec_group);
+
+ /* Remove any previous wireless security widgets */
+ children = gtk_container_get_children (GTK_CONTAINER (vbox));
+ for (elt = children; elt; elt = g_list_next (elt))
+ gtk_container_remove (GTK_CONTAINER (vbox), GTK_WIDGET (elt->data));
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
+ gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo), &iter);
+ gtk_tree_model_get (model, &iter, S_SEC_COLUMN, &sec, -1);
+ if (sec) {
+ GtkWidget *sec_widget;
+ GtkWidget *widget;
+
+ sec_widget = wireless_security_get_widget (sec);
+ g_assert (sec_widget);
+
+ widget = glade_xml_get_widget (xml, "wireless_security_combo_label");
+ gtk_size_group_add_widget (wsec_group, widget);
+ wireless_security_add_to_size_group (sec, wsec_group);
+
+ gtk_container_add (GTK_CONTAINER (vbox), sec_widget);
+ wireless_security_unref (sec);
+ }
+}
+
+static void
+add_security_item (GtkWidget *page,
+ WirelessSecurity *sec,
+ GtkListStore *model,
+ GtkTreeIter *iter,
+ const char *text)
+{
+ wireless_security_set_changed_notify (sec, stuff_changed_cb, page);
+ gtk_list_store_append (model, iter);
+ gtk_list_store_set (model, iter, S_NAME_COLUMN, text, S_SEC_COLUMN, sec, -1);
+ wireless_security_unref (sec);
+}
+
+GtkWidget *
+page_wireless_security_new (NMConnection *connection,
+ GtkWidget *ok_button,
+ GtkWidget *wireless_page,
+ const char **title)
+{
+ GladeXML *xml;
+ GtkWidget *page;
+ NMSettingWireless *s_wireless;
+ NMSettingWirelessSecurity *s_wireless_sec;
+ gboolean is_adhoc = FALSE;
+ GtkListStore *sec_model;
+ GtkTreeIter iter;
+ guint32 dev_caps = 0;
+ NMUtilsSecurityType default_type = NMU_SEC_NONE;
+ int active = -1;
+ int item = 0;
+ const char *glade_file = GLADEDIR "/applet.glade";
+ GtkWidget *combo;
+ GtkSizeGroup *wsec_group;
+
+ s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS));
+ g_assert (s_wireless);
+
+ xml = glade_xml_new (GLADEDIR "/ce-page-wireless-security.glade", "WirelessSecurityPage", NULL);
+ g_return_val_if_fail (xml != NULL, NULL);
+ *title = _("Wireless Security");
+
+ page = glade_xml_get_widget (xml, "WirelessSecurityPage");
+ g_return_val_if_fail (page != NULL, NULL);
+ g_object_set_data_full (G_OBJECT (page),
+ "glade-xml", xml,
+ (GDestroyNotify) g_object_unref);
+
+ wsec_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+ g_object_set_data_full (G_OBJECT (page),
+ "size-group", wsec_group,
+ (GDestroyNotify) g_object_unref);
+
+ g_object_set_data (G_OBJECT (page), "ok-button", ok_button);
+ g_object_set_data (G_OBJECT (page), "wireless-page", wireless_page);
+
+ combo = glade_xml_get_widget (xml, "wireless_security_combo");
+
+ dev_caps = NM_802_11_DEVICE_CAP_CIPHER_WEP40
+ | NM_802_11_DEVICE_CAP_CIPHER_WEP104
+ | NM_802_11_DEVICE_CAP_CIPHER_TKIP
+ | NM_802_11_DEVICE_CAP_CIPHER_CCMP
+ | NM_802_11_DEVICE_CAP_WPA
+ | NM_802_11_DEVICE_CAP_RSN;
+
+ if (s_wireless->mode && !strcmp (s_wireless->mode, "adhoc"))
+ is_adhoc = TRUE;
+
+ s_wireless_sec = NM_SETTING_WIRELESS_SECURITY (nm_connection_get_setting (connection,
+ NM_TYPE_SETTING_WIRELESS_SECURITY));
+ default_type = get_default_type_for_security (s_wireless_sec);
+
+ sec_model = gtk_list_store_new (2, G_TYPE_STRING, wireless_security_get_g_type ());
+
+ if (nm_utils_security_valid (NMU_SEC_NONE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ gtk_list_store_append (sec_model, &iter);
+ gtk_list_store_set (sec_model, &iter,
+ S_NAME_COLUMN, _("None"),
+ -1);
+ if (default_type == NMU_SEC_NONE)
+ active = item;
+ }
+
+ if (nm_utils_security_valid (NMU_SEC_STATIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ WirelessSecurityWEPKey *ws_wep_hex;
+ WirelessSecurityWEPKey *ws_wep_ascii;
+ WirelessSecurityWEPPassphrase *ws_wep_passphrase;
+
+ ws_wep_passphrase = ws_wep_passphrase_new (glade_file, connection);
+ if (ws_wep_passphrase) {
+ add_security_item (page, WIRELESS_SECURITY (ws_wep_passphrase), sec_model,
+ &iter, _("WEP 128-bit Passphrase"));
+ if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
+ active = item++;
+ }
+
+ ws_wep_hex = ws_wep_key_new (glade_file, connection, WEP_KEY_TYPE_HEX);
+ if (ws_wep_hex) {
+ add_security_item (page, WIRELESS_SECURITY (ws_wep_hex), sec_model,
+ &iter, _("WEP 40/128-bit Hexadecimal"));
+ if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
+ active = item++;
+ }
+
+ ws_wep_ascii = ws_wep_key_new (glade_file, connection, WEP_KEY_TYPE_ASCII);
+ if (ws_wep_ascii) {
+ add_security_item (page, WIRELESS_SECURITY (ws_wep_ascii), sec_model,
+ &iter, _("WEP 40/128-bit ASCII"));
+ if ((active < 0) && (default_type == NMU_SEC_STATIC_WEP))
+ active = item++;
+ }
+ }
+
+ if (nm_utils_security_valid (NMU_SEC_LEAP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ WirelessSecurityLEAP *ws_leap;
+
+ ws_leap = ws_leap_new (glade_file, connection);
+ if (ws_leap) {
+ add_security_item (page, WIRELESS_SECURITY (ws_leap), sec_model,
+ &iter, _("LEAP"));
+ if ((active < 0) && (default_type == NMU_SEC_LEAP))
+ active = item++;
+ }
+ }
+
+ if (nm_utils_security_valid (NMU_SEC_DYNAMIC_WEP, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ WirelessSecurityDynamicWEP *ws_dynamic_wep;
+
+ ws_dynamic_wep = ws_dynamic_wep_new (glade_file, connection);
+ if (ws_dynamic_wep) {
+ add_security_item (page, WIRELESS_SECURITY (ws_dynamic_wep), sec_model,
+ &iter, _("Dynamic WEP (802.1x)"));
+ if ((active < 0) && (default_type == NMU_SEC_DYNAMIC_WEP))
+ active = item++;
+ }
+ }
+
+ if ( nm_utils_security_valid (NMU_SEC_WPA_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)
+ || nm_utils_security_valid (NMU_SEC_WPA2_PSK, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ WirelessSecurityWPAPSK *ws_wpa_psk;
+
+ ws_wpa_psk = ws_wpa_psk_new (glade_file, connection);
+ if (ws_wpa_psk) {
+ add_security_item (page, WIRELESS_SECURITY (ws_wpa_psk), sec_model,
+ &iter, _("WPA & WPA2 Personal"));
+ if ((active < 0) && ((default_type == NMU_SEC_WPA_PSK) || (default_type == NMU_SEC_WPA2_PSK)))
+ active = item++;
+ }
+ }
+
+ if ( nm_utils_security_valid (NMU_SEC_WPA_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)
+ || nm_utils_security_valid (NMU_SEC_WPA2_ENTERPRISE, dev_caps, FALSE, is_adhoc, 0, 0, 0)) {
+ WirelessSecurityWPAEAP *ws_wpa_eap;
+
+ ws_wpa_eap = ws_wpa_eap_new (glade_file, connection);
+ if (ws_wpa_eap) {
+ add_security_item (page, WIRELESS_SECURITY (ws_wpa_eap), sec_model,
+ &iter, _("WPA & WPA2 Enterprise"));
+ if ((active < 0) && ((default_type == NMU_SEC_WPA_ENTERPRISE) || (default_type == NMU_SEC_WPA2_ENTERPRISE)))
+ active = item++;
+ }
+ }
+
+ gtk_combo_box_set_model (GTK_COMBO_BOX (combo), GTK_TREE_MODEL (sec_model));
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), active < 0 ? 0 : (guint32) active);
+ g_object_unref (G_OBJECT (sec_model));
+
+ wireless_security_combo_changed (combo, page);
+ g_signal_connect (G_OBJECT (combo),
+ "changed",
+ GTK_SIGNAL_FUNC (wireless_security_combo_changed),
+ page);
+
+ return page;
+}
+
+
Added: trunk/src/connection-editor/page-wireless-security.h
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wireless-security.h Mon Jan 28 16:24:04 2008
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#ifndef __PAGE_WIRELESS_SECURITY_H__
+#define __PAGE_WIRELESS_SECURITY_H__
+
+#include "nm-connection-editor.h"
+
+GtkWidget * page_wireless_security_new (NMConnection *connection,
+ GtkWidget *ok_button,
+ GtkWidget *wireless_page,
+ const char **title);
+
+#endif /* __PAGE_WIRELESS_SECURITY_H__ */
+
Added: trunk/src/connection-editor/page-wireless.c
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wireless.c Mon Jan 28 16:24:04 2008
@@ -0,0 +1,251 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#include <string.h>
+#include <math.h>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include <nm-setting-connection.h>
+#include <nm-setting-wireless.h>
+
+#include "page-wireless.h"
+#include "utils.h"
+
+static gboolean
+band_helper (GtkWidget *page, gboolean *aband, gboolean *gband)
+{
+ GladeXML *xml;
+ GtkWidget *band_combo;
+
+ xml = g_object_get_data (G_OBJECT (page), "glade-xml");
+ band_combo = glade_xml_get_widget (xml, "wireless_band");
+
+ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (band_combo))) {
+ case 1: /* A */
+ *gband = FALSE;
+ return TRUE;
+ case 2: /* B/G */
+ *aband = FALSE;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+static gint
+channel_spin_input_cb (GtkSpinButton *spin, gdouble *new_val, gpointer user_data)
+{
+ GtkWidget *page = GTK_WIDGET (user_data);
+ gdouble channel;
+ guint32 int_channel = 0;
+ gboolean aband = TRUE;
+ gboolean gband = TRUE;
+
+ if (!band_helper (page, &aband, &gband))
+ return GTK_INPUT_ERROR;
+
+ channel = g_strtod (gtk_entry_get_text (GTK_ENTRY (spin)), NULL);
+ if (channel - floor (channel) < ceil (channel) - channel)
+ int_channel = floor (channel);
+ else
+ int_channel = ceil (channel);
+
+ if (utils_channel_to_freq (int_channel, aband ? "a" : "bg") == -1)
+ return GTK_INPUT_ERROR;
+
+ *new_val = channel;
+ return TRUE;
+}
+
+static gint
+channel_spin_output_cb (GtkSpinButton *spin, gpointer user_data)
+{
+ GtkWidget *page = GTK_WIDGET (user_data);
+ int channel;
+ gchar *buf = NULL;
+ guint32 freq;
+ gboolean aband = TRUE;
+ gboolean gband = TRUE;
+ guint32 last_channel;
+
+ last_channel = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (page), "last-channel"));
+
+ if (!band_helper (page, &aband, &gband))
+ buf = g_strdup (_("default"));
+ else {
+ channel = gtk_spin_button_get_value_as_int (spin);
+ if (channel == 0)
+ buf = g_strdup (_("default"));
+ else {
+ freq = utils_channel_to_freq (channel, aband ? "a" : "bg");
+ if (freq == -1) {
+ int direction = 0;
+
+ if (last_channel < channel)
+ direction = 1;
+ else if (last_channel > channel)
+ direction = -1;
+ channel = utils_find_next_channel (channel, direction, aband ? "a" : "bg");
+ freq = utils_channel_to_freq (channel, aband ? "a" : "bg");
+ if (freq == -1) {
+ g_warning ("%s: invalid channel %d!", __func__, channel);
+ gtk_spin_button_set_value (spin, 0);
+ goto out;
+ }
+ }
+ buf = g_strdup_printf (_("%u (%u MHz)"), channel, freq);
+ }
+ g_object_set_data (G_OBJECT (page), "last-channel", GUINT_TO_POINTER (channel));
+ }
+
+ if (strcmp (buf, gtk_entry_get_text (GTK_ENTRY (spin))))
+ gtk_entry_set_text (GTK_ENTRY (spin), buf);
+
+out:
+ g_free (buf);
+ return TRUE;
+}
+
+static void
+band_value_changed_cb (GtkComboBox *box, gpointer user_data)
+{
+ GtkWidget *page = GTK_WIDGET (user_data);
+ GtkWidget *widget;
+ GladeXML *xml;
+
+ g_object_set_data (G_OBJECT (page), "last-channel", GUINT_TO_POINTER (0));
+
+ xml = g_object_get_data (G_OBJECT (page), "glade-xml");
+ widget = glade_xml_get_widget (xml, "wireless_channel");
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), 0);
+
+ switch (gtk_combo_box_get_active (GTK_COMBO_BOX (box))) {
+ case 1: /* A */
+ case 2: /* B/G */
+ gtk_widget_set_sensitive (widget, TRUE);
+ break;
+ default:
+ gtk_widget_set_sensitive (widget, FALSE);
+ break;
+ }
+}
+
+GtkWidget *
+page_wireless_new (NMConnection *connection, const char **title)
+{
+ GladeXML *xml;
+ GtkWidget *page;
+ NMSettingWireless *s_wireless;
+ int band_idx = 0;
+ GtkWidget *mode;
+ GtkWidget *band;
+ GtkWidget *channel;
+ GtkWidget *rate;
+ int rate_def;
+ GtkWidget *tx_power;
+ int tx_power_def;
+ GtkWidget *mtu;
+ int mtu_def;
+
+ s_wireless = NM_SETTING_WIRELESS (nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS));
+ g_return_val_if_fail (s_wireless != NULL, NULL);
+
+ xml = glade_xml_new (GLADEDIR "/ce-page-wireless.glade", "WirelessPage", NULL);
+ g_return_val_if_fail (xml != NULL, NULL);
+ *title = _("Wireless");
+
+ page = glade_xml_get_widget (xml, "WirelessPage");
+ g_return_val_if_fail (page != NULL, NULL);
+ g_object_set_data_full (G_OBJECT (page),
+ "glade-xml", xml,
+ (GDestroyNotify) g_object_unref);
+
+ rate = glade_xml_get_widget (xml, "wireless_rate");
+ rate_def = ce_get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_RATE);
+ g_signal_connect (G_OBJECT (rate), "output",
+ (GCallback) ce_spin_output_with_default,
+ GINT_TO_POINTER (rate_def));
+
+ tx_power = glade_xml_get_widget (xml, "wireless_tx_power");
+ tx_power_def = ce_get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_TX_POWER);
+ g_signal_connect (G_OBJECT (tx_power), "output",
+ (GCallback) ce_spin_output_with_default,
+ GINT_TO_POINTER (tx_power_def));
+
+ mtu = glade_xml_get_widget (xml, "wireless_mtu");
+ mtu_def = ce_get_property_default (NM_SETTING (s_wireless), NM_SETTING_WIRELESS_MTU);
+ g_signal_connect (G_OBJECT (mtu), "output",
+ (GCallback) ce_spin_output_with_default,
+ GINT_TO_POINTER (mtu_def));
+
+ /* FIXME: SSID */
+
+ mode = glade_xml_get_widget (xml, "wireless_mode");
+ if (!strcmp (s_wireless->mode ? s_wireless->mode : "", "infrastructure"))
+ gtk_combo_box_set_active (GTK_COMBO_BOX (mode), 0);
+ else if (!strcmp (s_wireless->mode ? s_wireless->mode : "", "adhoc"))
+ gtk_combo_box_set_active (GTK_COMBO_BOX (mode), 1);
+ else
+ gtk_combo_box_set_active (GTK_COMBO_BOX (mode), -1);
+
+ channel = glade_xml_get_widget (xml, "wireless_channel");
+ g_signal_connect (G_OBJECT (channel), "output",
+ (GCallback) channel_spin_output_cb,
+ page);
+ g_signal_connect (G_OBJECT (channel), "input",
+ (GCallback) channel_spin_input_cb,
+ page);
+
+ gtk_widget_set_sensitive (channel, FALSE);
+ if (s_wireless->band) {
+ if (!strcmp (s_wireless->band ? s_wireless->band : "", "a")) {
+ band_idx = 1;
+ gtk_widget_set_sensitive (channel, TRUE);
+ } else if (!strcmp (s_wireless->band ? s_wireless->band : "", "bg")) {
+ band_idx = 2;
+ gtk_widget_set_sensitive (channel, TRUE);
+ }
+ }
+ band = glade_xml_get_widget (xml, "wireless_band");
+ gtk_combo_box_set_active (GTK_COMBO_BOX (band), band_idx);
+ g_signal_connect (G_OBJECT (band), "changed",
+ (GCallback) band_value_changed_cb,
+ page);
+
+ /* Update the channel _after_ the band has been set so that it gets
+ * the right values */
+ g_object_set_data (G_OBJECT (page), "last-channel", GUINT_TO_POINTER (s_wireless->channel));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (channel), (gdouble) s_wireless->channel);
+
+ /* FIXME: BSSID */
+ /* FIXME: MAC address */
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate), (gdouble) s_wireless->rate);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (tx_power), (gdouble) s_wireless->tx_power);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (mtu), (gdouble) s_wireless->mtu);
+
+ return page;
+}
+
+
Added: trunk/src/connection-editor/page-wireless.h
==============================================================================
--- (empty file)
+++ trunk/src/connection-editor/page-wireless.h Mon Jan 28 16:24:04 2008
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager Connection editor -- Connection editor for NetworkManager
+ *
+ * Dan Williams <dcbw redhat com>
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * (C) Copyright 2008 Red Hat, Inc.
+ */
+
+#ifndef __PAGE_WIRELESS_H__
+#define __PAGE_WIRELESS_H__
+
+#include "nm-connection-editor.h"
+
+GtkWidget *page_wireless_new (NMConnection *connection, const char **title);
+
+
+#endif /* __PAGE_WIRELESS_H__ */
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]