network: Add the first version of a simple network panel that uses NetworkManager

This is very much a work in progress, and will be changed quite a bit before GNOME 3.
This commit is contained in:
Richard Hughes 2010-12-14 10:23:26 +00:00
parent 4821672a75
commit a134e09848
10 changed files with 1235 additions and 19 deletions

View file

@ -383,6 +383,8 @@ panels/info/Makefile
panels/info/gnome-info-panel.desktop.in panels/info/gnome-info-panel.desktop.in
panels/power/Makefile panels/power/Makefile
panels/power/gnome-power-panel.desktop.in panels/power/gnome-power-panel.desktop.in
panels/network/Makefile
panels/network/gnome-network-panel.desktop.in
panels/universal-access/Makefile panels/universal-access/Makefile
panels/universal-access/gnome-universal-access-panel.desktop.in panels/universal-access/gnome-universal-access-panel.desktop.in
panels/user-accounts/Makefile panels/user-accounts/Makefile

View file

@ -7,6 +7,7 @@ SUBDIRS= \
mouse \ mouse \
region \ region \
proxy \ proxy \
network \
info \ info \
sound \ sound \
default-applications \ default-applications \

View file

@ -0,0 +1,31 @@
INCLUDES = \
$(PANEL_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMECC_UI_DIR="\"$(uidir)\"" \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libnetwork.la
libnetwork_la_SOURCES = \
network-module.c \
cc-network-panel.c \
cc-network-panel.h
libnetwork_la_LIBADD = $(PANEL_LIBS) $(CAPPLET_LIBS)
libnetwork_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
dist_ui_DATA = network.ui
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = gnome-network-panel.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
-include $(top_srcdir)/git.mk

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,72 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2010 Richard Hughes <richard@hughsie.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.
*
*/
#ifndef _CC_NETWORK_PANEL_H
#define _CC_NETWORK_PANEL_H
#include <libgnome-control-center/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_NETWORK_PANEL cc_network_panel_get_type()
#define CC_NETWORK_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
CC_TYPE_NETWORK_PANEL, CcNetworkPanel))
#define CC_NETWORK_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
CC_TYPE_NETWORK_PANEL, CcNetworkPanelClass))
#define CC_IS_NETWORK_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
CC_TYPE_NETWORK_PANEL))
#define CC_IS_NETWORK_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
CC_TYPE_NETWORK_PANEL))
#define CC_NETWORK_PANEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
CC_TYPE_NETWORK_PANEL, CcNetworkPanelClass))
typedef struct _CcNetworkPanel CcNetworkPanel;
typedef struct _CcNetworkPanelClass CcNetworkPanelClass;
typedef struct _CcNetworkPanelPrivate CcNetworkPanelPrivate;
struct _CcNetworkPanel
{
CcPanel parent;
CcNetworkPanelPrivate *priv;
};
struct _CcNetworkPanelClass
{
CcPanelClass parent_class;
};
GType cc_network_panel_get_type (void) G_GNUC_CONST;
void cc_network_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_NETWORK_PANEL_H */

View file

@ -0,0 +1,17 @@
[Desktop Entry]
_Name=Network
_Comment=Network settings
Exec=gnome-control-center network
Icon=gnome-network-properties
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;X-GNOME-NetworkSettings;X-GNOME-Settings-Panel;
OnlyShowIn=GNOME;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-control-center
X-GNOME-Bugzilla-Component=network
X-GNOME-Bugzilla-Version=@VERSION@
X-GNOME-Settings-Panel=network
# Translators: those are keywords for the network control-center panel
_X-GNOME-Keywords=Network;Wireless;IP;LAN;

View file

@ -0,0 +1,41 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2010 Richard Hughes <richard@hughsie.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.
*
*
*/
#include <config.h>
#include "cc-network-panel.h"
#include <glib/gi18n-lib.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_network_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}

View file

@ -13,13 +13,15 @@
<object class="GtkListStore" id="liststore_devices"> <object class="GtkListStore" id="liststore_devices">
<columns> <columns>
<!-- column-name icon --> <!-- column-name icon -->
<column type="gchar"/> <column type="gchararray"/>
<!-- column-name title --> <!-- column-name title -->
<column type="gchar"/> <column type="gchararray"/>
<!-- column-name id --> <!-- column-name id -->
<column type="gchar"/> <column type="gchararray"/>
<!-- column-name tooltip --> <!-- column-name tooltip -->
<column type="gchar"/> <column type="gchararray"/>
<!-- column-name proxy-device -->
<column type="gpointer"/>
</columns> </columns>
</object> </object>
<object class="GtkWindow" id="window1"> <object class="GtkWindow" id="window1">
@ -40,7 +42,7 @@
<object class="GtkScrolledWindow" id="scrolledwindow1"> <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">automatic</property> <property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">automatic</property> <property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<child> <child>
@ -64,7 +66,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkHBox" id="hbox3"> <object class="GtkHBox" id="hbox_device_header">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
@ -78,7 +80,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkImage" id="image1"> <object class="GtkImage" id="image_device">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-preferences</property> <property name="stock">gtk-preferences</property>
<property name="icon-size">6</property> <property name="icon-size">6</property>
@ -96,7 +98,7 @@
<object class="GtkHBox" id="hbox4"> <object class="GtkHBox" id="hbox4">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkLabel" id="label1"> <object class="GtkLabel" id="label_device">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label">Wired</property> <property name="label">Wired</property>
<attributes> <attributes>
@ -121,7 +123,7 @@
<object class="GtkHBox" id="hbox5"> <object class="GtkHBox" id="hbox5">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkLabel" id="label2"> <object class="GtkLabel" id="label_status">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label">Cable unplugged</property> <property name="label">Cable unplugged</property>
</object> </object>
@ -984,7 +986,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkComboBox" id="combobox_proxy_mode"> <object class="GtkComboBoxText" id="combobox_proxy_mode">
<property name="visible">True</property> <property name="visible">True</property>
<property name="model">liststore_proxy_method</property> <property name="model">liststore_proxy_method</property>
</object> </object>
@ -1043,7 +1045,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox34"> <object class="GtkHBox" id="hbox_proxy_http">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">9</property> <property name="spacing">9</property>
<child> <child>
@ -1087,7 +1089,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox36"> <object class="GtkHBox" id="hbox_proxy_shttp">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">9</property> <property name="spacing">9</property>
<child> <child>
@ -1131,7 +1133,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox46"> <object class="GtkHBox" id="hbox_proxy_ftp">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">9</property> <property name="spacing">9</property>
<child> <child>
@ -1175,7 +1177,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox48"> <object class="GtkHBox" id="hbox_proxy_socks">
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">9</property> <property name="spacing">9</property>
<child> <child>
@ -1279,7 +1281,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">start</property> <property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="button2"> <object class="GtkButton" id="button_add">
<property name="label">gtk-add</property> <property name="label">gtk-add</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -1294,7 +1296,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="button3"> <object class="GtkButton" id="button_remove">
<property name="label">gtk-remove</property> <property name="label">gtk-remove</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -1389,19 +1391,23 @@
<object class="GtkListStore" id="liststore_proxy_method"> <object class="GtkListStore" id="liststore_proxy_method">
<columns> <columns>
<!-- column-name text --> <!-- column-name text -->
<column type="gchar"/> <column type="gchararray"/>
<!-- column-name type --> <!-- column-name type -->
<column type="gint"/> <column type="gint"/>
</columns> </columns>
<data> <data>
<row> <row>
<col id="0">A</col> <col id="0">None</col>
<col id="1">0</col> <col id="1">0</col>
</row> </row>
<row> <row>
<col id="0">M</col> <col id="0">Manual</col>
<col id="1">1</col> <col id="1">1</col>
</row> </row>
<row>
<col id="0">Automatic</col>
<col id="1">2</col>
</row>
</data> </data>
</object> </object>
</interface> </interface>

View file

@ -48,6 +48,8 @@ panels/mouse/gnome-mouse-panel.desktop.in.in
panels/proxy/gnome-proxy-properties.c panels/proxy/gnome-proxy-properties.c
panels/proxy/gnome-proxy-panel.desktop.in.in panels/proxy/gnome-proxy-panel.desktop.in.in
[type: gettext/glade]panels/proxy/gnome-proxy-properties.ui [type: gettext/glade]panels/proxy/gnome-proxy-properties.ui
panels/network/cc-network-panel.c
panels/network/gnome-network-panel.desktop.in.in
[type: gettext/glade]panels/network/network.ui [type: gettext/glade]panels/network/network.ui
panels/power/gnome-power-panel.desktop.in.in panels/power/gnome-power-panel.desktop.in.in
panels/power/cc-power-panel.c panels/power/cc-power-panel.c

View file

@ -19,6 +19,7 @@ panels/user-accounts/fingerprint-strings.h
capplets/localization/localization.desktop.in capplets/localization/localization.desktop.in
capplets/mouse/gnome-settings-mouse.desktop.in capplets/mouse/gnome-settings-mouse.desktop.in
panels/proxy/gnome-proxy-panel.desktop.in panels/proxy/gnome-proxy-panel.desktop.in
panels/network/gnome-network-panel.desktop.in
capplets/sound/gnome-settings-sound.desktop.in capplets/sound/gnome-settings-sound.desktop.in
font-viewer/gnome-font-viewer.desktop.in font-viewer/gnome-font-viewer.desktop.in
schemas/desktop_gnome_font_rendering.schemas.in schemas/desktop_gnome_font_rendering.schemas.in