From 5435af273f540d68f8aa2bdc2b1136aa2497114a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 25 Aug 2004 18:55:20 +0000 Subject: [PATCH] Add to CVS git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@63 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- .../NetworkManagerInfoNetworksDialog.c | 92 +++++++ .../NetworkManagerInfoNetworksDialog.h | 30 +++ info-daemon/networks.glade | 226 ++++++++++++++++++ 3 files changed, 348 insertions(+) create mode 100644 info-daemon/NetworkManagerInfoNetworksDialog.c create mode 100644 info-daemon/NetworkManagerInfoNetworksDialog.h create mode 100644 info-daemon/networks.glade diff --git a/info-daemon/NetworkManagerInfoNetworksDialog.c b/info-daemon/NetworkManagerInfoNetworksDialog.c new file mode 100644 index 0000000000..d95976982d --- /dev/null +++ b/info-daemon/NetworkManagerInfoNetworksDialog.c @@ -0,0 +1,92 @@ +/* NetworkManagerInfo -- Manage allowed access points and provide a UI + * for WEP key entry + * + * Dan Williams + * + * 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 2004 Red Hat, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "NetworkManagerInfo.h" +#include "NetworkManagerInfoNetworksDialog.h" + + +/* + * nmi_networks_dialog_init + * + * Initialize the networks modification dialog + * + * Returns: 0 on success + * -1 on failure + */ +int nmi_networks_dialog_init (NMIAppInfo *info) +{ + GtkWidget *dialog; + GtkWidget *list_view; + GtkButton *save_button; + GtkButton *cancel_button; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + GError *error = NULL; + + info->networks_dialog = glade_xml_new(GLADEDIR"/networks.glade", NULL, NULL); + if (!info->networks_dialog) + { + fprintf (stderr, "Could not open the networks dialog glade file!\n"); + return (-1); + } + + dialog = glade_xml_get_widget (info->networks_dialog, "networks_dialog"); + gtk_widget_hide (dialog); + +#if 0 + save_button = GTK_BUTTON (glade_xml_get_widget (info->networks_dialog, "save_button")); + g_signal_connect (G_OBJECT (save_button), "clicked", GTK_SIGNAL_FUNC (nmi_networks_dialog_save_clicked), info); + cancel_button = GTK_BUTTON (glade_xml_get_widget (info->networks_dialog, "cancel_button")); + g_signal_connect (G_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (nmi_networks_dialog_cancel_clicked), info); + + /* Create data store for our networks list */ + info->networks_list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN); + if (!info->networks_list_store) + return (-1); + + /* Tell the list to use our data store */ + list_view = glade_xml_get_widget (info->networks_dialog, "networks_list"); + gtk_tree_view_set_model (GTK_TREE_VIEW (list_view), GTK_TREE_MODEL (info->networks_list_store)); + + /* Set up the columns and renderers for our list */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_expand (column, TRUE); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + gtk_tree_view_column_set_attributes (column, renderer, "markup", TEXT_COLUMN, NULL); + gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column); + + info->padlock_pixbuf = gdk_pixbuf_new_from_file_at_size (GLADEDIR"/keyring.png", 16, 16, &error); + if (!info->padlock_pixbuf) + fprintf (stderr, "nmi_new_networks_dialog_init(): could not load padlock image\n"); +#endif + + return (0); +} diff --git a/info-daemon/NetworkManagerInfoNetworksDialog.h b/info-daemon/NetworkManagerInfoNetworksDialog.h new file mode 100644 index 0000000000..d7655a3ae5 --- /dev/null +++ b/info-daemon/NetworkManagerInfoNetworksDialog.h @@ -0,0 +1,30 @@ +/* NetworkManagerInfo -- Manage allowed access points and provide a UI + * for WEP key entry + * + * Dan Williams + * + * 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 2004 Red Hat, Inc. + */ + +#ifndef NETWORK_MANAGER_INFO_NETWORKS_DIALOG_H +#define NETWORK_MANAGER_INFO_NETWORKS_DIALOG_H + +#include "NetworkManagerInfo.h" + +int nmi_networks_dialog_init (NMIAppInfo *info); + +#endif diff --git a/info-daemon/networks.glade b/info-daemon/networks.glade new file mode 100644 index 0000000000..e44d931af5 --- /dev/null +++ b/info-daemon/networks.glade @@ -0,0 +1,226 @@ + + + + + + + + 6 + 400 + 400 + Modify Wireless Networks + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + True + False + 12 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + -11 + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + True + True + True + gtk-save + True + GTK_RELIEF_NORMAL + True + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + 6 + True + False + 6 + + + + True + <span weight="bold">Wireless Networks:</span> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + False + 12 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + + + + + 0 + True + True + + + + + + True + False + 67 + + + + True + GTK_BUTTONBOX_SPREAD + 0 + + + + True + True + True + gtk-go-up + True + GTK_RELIEF_NORMAL + False + + + + + + True + True + True + gtk-go-down + True + GTK_RELIEF_NORMAL + True + + + + + 28 + True + True + + + + + + True + True + gtk-delete + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + +