network-manager-applet r494 - in branches/network-manager-applet-0-6: . editor po src
- From: tambeti svn gnome org
- To: svn-commits-list gnome org
- Subject: network-manager-applet r494 - in branches/network-manager-applet-0-6: . editor po src
- Date: Wed, 30 Jan 2008 21:45:28 +0000 (GMT)
Author: tambeti
Date: Wed Jan 30 21:45:28 2008
New Revision: 494
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=494&view=rev
Log:
2008-01-30 Tambet Ingo <tambet gmail com>
Implement wireless network editor.
* Makefile.am: Add editor to build.
* src/main.c: Remove a compiler warning.
* src/wso-wep-hex.c (widget_create_func): Ditto.
* src/wso-wep-ascii.c (widget_create_func): Ditto.
* src/applet.c (edit_essid_items_selected)
(nma_menu_add_edit_essid_item): Implement.
(nma_menu_add_devices): Add the editor item to the menu.
* editor/*: Implement.
Added:
branches/network-manager-applet-0-6/editor/
branches/network-manager-applet-0-6/editor/Makefile.am
branches/network-manager-applet-0-6/editor/bssid-editor-dialog.c
branches/network-manager-applet-0-6/editor/bssid-editor-dialog.h
branches/network-manager-applet-0-6/editor/editor-app.c
branches/network-manager-applet-0-6/editor/editor-app.h
branches/network-manager-applet-0-6/editor/editor-gconf-helper.c
branches/network-manager-applet-0-6/editor/editor-gconf-helper.h
branches/network-manager-applet-0-6/editor/editor-keyring-helper.c
branches/network-manager-applet-0-6/editor/editor-keyring-helper.h
branches/network-manager-applet-0-6/editor/editor.glade
branches/network-manager-applet-0-6/editor/nm-editor.desktop
branches/network-manager-applet-0-6/editor/widget-wso-wep.c
branches/network-manager-applet-0-6/editor/widget-wso-wpa-enterprise.c
branches/network-manager-applet-0-6/editor/widget-wso-wpa-personal.c
branches/network-manager-applet-0-6/editor/widget-wso.h
Modified:
branches/network-manager-applet-0-6/ChangeLog
branches/network-manager-applet-0-6/Makefile.am
branches/network-manager-applet-0-6/configure.ac
branches/network-manager-applet-0-6/po/POTFILES.in
branches/network-manager-applet-0-6/src/applet.c
branches/network-manager-applet-0-6/src/main.c
branches/network-manager-applet-0-6/src/wso-wep-ascii.c
branches/network-manager-applet-0-6/src/wso-wep-hex.c
Modified: branches/network-manager-applet-0-6/Makefile.am
==============================================================================
--- branches/network-manager-applet-0-6/Makefile.am (original)
+++ branches/network-manager-applet-0-6/Makefile.am Wed Jan 30 21:45:28 2008
@@ -1,4 +1,4 @@
-SUBDIRS = src icons po
+SUBDIRS = src editor icons po
EXTRA_DIST = \
CONTRIBUTING \
Modified: branches/network-manager-applet-0-6/configure.ac
==============================================================================
--- branches/network-manager-applet-0-6/configure.ac (original)
+++ branches/network-manager-applet-0-6/configure.ac Wed Jan 30 21:45:28 2008
@@ -253,6 +253,7 @@
AC_OUTPUT([
Makefile
src/Makefile
+editor/Makefile
icons/Makefile
po/Makefile.in
])
Added: branches/network-manager-applet-0-6/editor/Makefile.am
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/Makefile.am Wed Jan 30 21:45:28 2008
@@ -0,0 +1,75 @@
+NULL=
+
+INCLUDES = -I${top_srcdir}/../include -I${top_srcdir}/../libnm-util
+
+bin_PROGRAMS = nm-editor
+
+nm_editor_CPPFLAGS = \
+ $(DBUS_CFLAGS) \
+ $(GTHREAD_CFLAGS) \
+ $(HAL_CFLAGS) \
+ $(DBUS_GLIB_CFLAGS) \
+ $(GLADE_CFLAGS) \
+ $(GTK_CFLAGS) \
+ $(GCONF_CFLAGS) \
+ $(LIBGNOMEUI_CFLAGS) \
+ $(PANEL_APPLET_CFLAGS) \
+ $(GNOME_KEYRING_CFLAGS) \
+ $(NM_CFLAGS) \
+ -DICONDIR=\""$(datadir)/pixmaps"\" \
+ -DGLADEDIR=\""$(gladedir)"\" \
+ -DBINDIR=\""$(bindir)"\" \
+ -DSYSCONFDIR=\""$(sysconfdir)"\" \
+ -DAUTOSTARTDIR=\""$(datadir)/gnome/autostart"\" \
+ -DVPN_NAME_FILES_DIR=\""$(sysconfdir)/NetworkManager/VPN"\" \
+ -DDBUS_API_SUBJECT_TO_CHANGE \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGNOME_DISABLE_DEPRECATED \
+ -DGNOMELOCALEDIR=\"$(datadir)/locale\" \
+ -DVERSION=\"$(VERSION)\" \
+ $(NULL)
+
+nm_editor_SOURCES = \
+ editor-app.c \
+ editor-app.h \
+ bssid-editor-dialog.c \
+ bssid-editor-dialog.h \
+ widget-wso.h \
+ widget-wso-wep.c \
+ widget-wso-wpa-personal.c \
+ widget-wso-wpa-enterprise.c \
+ editor-gconf-helper.h \
+ editor-gconf-helper.c \
+ editor-keyring-helper.h \
+ editor-keyring-helper.c \
+ $(NULL)
+
+nm_editor_LDADD = \
+ $(DBUS_LIBS) \
+ $(HAL_LIBS) \
+ $(GTHREAD_LIBS) \
+ $(GLADE_LIBS) \
+ $(DBUS_GLIB_LIBS) \
+ $(PANEL_APPLET_LIBS) \
+ $(GTK_LIBS) \
+ $(GCONF_LIBS) \
+ $(LIBGNOMEUI_LIBS) \
+ $(GNOME_KEYRING_LIBS) \
+ $(NM_LIBS) \
+ $(NULL)
+
+
+gladedir = $(datadir)/nm-editor
+glade_DATA = editor.glade
+desktopdatadir = $(datadir)/applications
+desktopdata_DATA = nm-editor.desktop
+
+CLEANFILES = $(server_DATA) *.bak *.gladep
+
+EXTRA_DIST = \
+ $(glade_DATA) \
+ $(desktopdata_DATA) \
+ $(NULL)
+
+
Added: branches/network-manager-applet-0-6/editor/bssid-editor-dialog.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/bssid-editor-dialog.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,427 @@
+/* NetworkManager bssid editor dialog -- Edits bssids on wireless access points
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "bssid-editor-dialog.h"
+
+#define BSSID_DIALOG "bssids_dialog"
+#define BSSID_EDITOR "bssid_editor"
+#define BSSID_TREEVIEW "bssids_treeview"
+#define BSSID_ADD "add_button"
+#define BSSID_REMOVE "remove_button"
+#define BSSID_EDIT "edit_button"
+#define BSSID_EDITOR_DIALOG "bssid_editor"
+#define BSSID_EDITOR_ENTRY "bssid_entry"
+
+typedef struct _bssid_editor_data
+{
+ GladeXML *glade_xml;
+ GtkWidget *dialog;
+ GtkWidget *treeview;
+ GtkWidget *add_button;
+ GtkWidget *remove_button;
+ GtkWidget *edit_button;
+} BED_DATA; //bssid_editor_dialog
+
+void selection_changed_cb (GtkTreeSelection *selection, gpointer data);
+void add_button_clicked_cb(GtkButton *button, gpointer data);
+void remove_button_clicked_cb(GtkButton *button, gpointer data);
+void edit_button_clicked_cb(GtkButton *button, gpointer data);
+
+
+gboolean run_bssid_editor(GtkWidget *parent, gchar *gconf_dir)
+{
+ char *glade_file;
+ GtkTreeSelection *select;
+ GConfClient *gconf_client;
+ GSList *bssids;
+ GtkListStore *store;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkTreeModel *filter;
+ GError *err = NULL;
+ BED_DATA *bed_data;
+ gboolean rc = FALSE;
+
+ bed_data = (BED_DATA *)malloc(sizeof(BED_DATA));
+ if(bed_data == NULL)
+ {
+ g_print("malloc error\n");
+ return FALSE;
+ }
+
+ memset(bed_data, 0, sizeof(BED_DATA));
+
+ // load the glade file
+ glade_file = g_build_filename (GLADEDIR, "editor.glade", NULL);
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ glade_file = g_build_filename ("", "editor.glade", NULL);
+
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_print("Error loading editor.glade file!\n");
+ g_free (glade_file);
+ return FALSE;
+ }
+
+ bed_data->glade_xml = glade_xml_new (glade_file, BSSID_DIALOG, NULL);
+ g_free(glade_file);
+
+ bed_data->dialog = glade_xml_get_widget (bed_data->glade_xml, BSSID_DIALOG);
+
+ bed_data->treeview = glade_xml_get_widget( bed_data->glade_xml,
+ BSSID_TREEVIEW);
+ bed_data->add_button = glade_xml_get_widget( bed_data->glade_xml,
+ BSSID_ADD);
+ bed_data->remove_button = glade_xml_get_widget( bed_data->glade_xml,
+ BSSID_REMOVE);
+ bed_data->edit_button = glade_xml_get_widget( bed_data->glade_xml,
+ BSSID_EDIT);
+
+ select = gtk_tree_view_get_selection(GTK_TREE_VIEW (bed_data->treeview));
+ gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
+
+ g_signal_connect (G_OBJECT (select), "changed",
+ G_CALLBACK (selection_changed_cb), bed_data);
+ g_signal_connect (G_OBJECT (bed_data->add_button), "clicked",
+ G_CALLBACK (add_button_clicked_cb), bed_data);
+ g_signal_connect (G_OBJECT (bed_data->remove_button), "clicked",
+ G_CALLBACK (remove_button_clicked_cb), bed_data);
+ g_signal_connect (G_OBJECT (bed_data->edit_button), "clicked",
+ G_CALLBACK (edit_button_clicked_cb), bed_data);
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+
+ gconf_client = gconf_client_get_default();
+
+ // Get the bssids
+ bssids = gconf_client_get_list(gconf_client, gconf_dir,
+ GCONF_VALUE_STRING, &err);
+ if(err == 0)
+ {
+ gchar *bssid = NULL;
+
+ while(bssids)
+ {
+ GtkTreeIter iter;
+
+ bssid = g_strdup(bssids->data);
+
+ gtk_list_store_append (store, &iter);
+
+ gtk_list_store_set (store, &iter, 0, bssid, -1);
+
+ g_free(bssids->data);
+
+ bssids = g_slist_delete_link (bssids, bssids);
+ }
+ }
+
+ filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL);
+
+ gtk_tree_view_set_model (GTK_TREE_VIEW (bed_data->treeview), filter);
+
+ g_object_unref (store);
+ g_object_unref (filter);
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes ("Name", renderer,
+ "markup", 0, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (bed_data->treeview), column);
+ gtk_tree_view_column_set_sort_column_id (column, 0);
+
+
+ gtk_window_set_transient_for(GTK_WINDOW(bed_data->dialog),
+ GTK_WINDOW(parent));
+
+ gint result = gtk_dialog_run (GTK_DIALOG (bed_data->dialog));
+
+ if(result == GTK_RESPONSE_OK)
+ {
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ gboolean valid;
+ gchar *new_bssid;
+ GSList *bssid_list;
+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(bed_data->treeview));
+
+ valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ bssid_list = NULL;
+
+ while(valid)
+ {
+ gtk_tree_model_get(model, &iter, 0, &new_bssid, -1);
+
+ bssid_list = g_slist_append(bssid_list, new_bssid);
+
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+
+ err = NULL;
+
+ if(bssid_list)
+ {
+ gconf_client_set_list(gconf_client, gconf_dir,
+ GCONF_VALUE_STRING, bssid_list, NULL);
+ }
+ else
+ {
+ gconf_client_unset(gconf_client, gconf_dir, NULL);
+ }
+
+ gconf_client_suggest_sync(gconf_client, NULL);
+ rc = TRUE;
+ }
+
+ gtk_widget_destroy(bed_data->dialog);
+ g_free(bed_data->glade_xml);
+
+ free(bed_data);
+
+ g_object_unref(gconf_client);
+
+ return rc;
+}
+
+
+
+
+void selection_changed_cb (GtkTreeSelection *selection, gpointer data)
+{
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ BED_DATA *bed_data;
+ gboolean enable;
+
+ bed_data = data;
+
+ enable = gtk_tree_selection_get_selected (selection, &model, &iter);
+
+ gtk_widget_set_sensitive(bed_data->remove_button, enable);
+ gtk_widget_set_sensitive(bed_data->edit_button, enable);
+}
+
+
+
+
+void remove_button_clicked_cb(GtkButton *button, gpointer data)
+{
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreeIter childIter;
+ GtkTreeModel *model;
+ BED_DATA *bed_data;
+ GtkListStore *store;
+
+ bed_data = data;
+
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (bed_data->treeview));
+
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ store = GTK_LIST_STORE(gtk_tree_model_filter_get_model(
+ GTK_TREE_MODEL_FILTER(model)));
+
+ gtk_tree_model_filter_convert_iter_to_child_iter(
+ GTK_TREE_MODEL_FILTER(model),
+ &childIter,
+ &iter);
+
+ gtk_list_store_remove ( store, &childIter);
+}
+
+
+
+
+void add_button_clicked_cb(GtkButton *button, gpointer data)
+{
+ char *glade_file;
+ GtkWidget *dialog;
+ GtkWidget *bssid_entry;
+ BED_DATA *bed_data;
+ GladeXML *glade_xml;
+
+ bed_data = data;
+
+ // load the glade file
+ glade_file = g_build_filename (GLADEDIR, "editor.glade", NULL);
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ glade_file = g_build_filename ("", "editor.glade", NULL);
+
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_print("Error loading editor.glade file!\n");
+ g_free (glade_file);
+ return;
+ }
+
+ glade_xml = glade_xml_new (glade_file, BSSID_EDITOR_DIALOG, NULL);
+ g_free(glade_file);
+
+ dialog = glade_xml_get_widget (glade_xml, BSSID_EDITOR_DIALOG);
+
+ bssid_entry = glade_xml_get_widget( glade_xml,
+ BSSID_EDITOR_ENTRY);
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),
+ GTK_WINDOW(bed_data->dialog));
+
+ gint result = gtk_dialog_run (GTK_DIALOG(dialog));
+
+ if(result == GTK_RESPONSE_OK)
+ {
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreeIter childIter;
+ GtkTreeModel *model;
+ GtkListStore *store;
+ gchar *new_bssid;
+
+ new_bssid = g_strdup(gtk_entry_get_text(GTK_ENTRY(bssid_entry)));
+
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (bed_data->treeview));
+
+ gtk_tree_selection_get_selected (selection, &model, &iter);
+
+ store = GTK_LIST_STORE(gtk_tree_model_filter_get_model(
+ GTK_TREE_MODEL_FILTER(model)));
+
+ gtk_list_store_append (store, &childIter);
+ gtk_list_store_set (store, &childIter,
+ 0, new_bssid,
+ -1);
+
+ gtk_tree_model_filter_convert_child_iter_to_iter(
+ GTK_TREE_MODEL_FILTER(model),
+ &iter,
+ &childIter);
+
+ gtk_tree_selection_select_iter(selection, &iter);
+ }
+
+ gtk_widget_destroy(dialog);
+ g_free(glade_xml);
+
+}
+
+
+
+
+void edit_button_clicked_cb(GtkButton *button, gpointer data)
+{
+ char *glade_file;
+ GtkWidget *dialog;
+ GtkWidget *bssid_entry;
+ BED_DATA *bed_data;
+ GladeXML *glade_xml;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreeIter childIter;
+ GtkTreeModel *model;
+ GtkListStore *store;
+ gchar *bssid_value = NULL;
+
+ bed_data = data;
+
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (bed_data->treeview));
+
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, 0, &bssid_value, -1);
+ if(bssid_value == NULL)
+ return;
+
+ // load the glade file
+ glade_file = g_build_filename (GLADEDIR, "editor.glade", NULL);
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ glade_file = g_build_filename ("", "editor.glade", NULL);
+
+ if (!glade_file || !g_file_test (glade_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_print("Error loading editor.glade file!\n");
+ g_free (glade_file);
+ return;
+ }
+
+ glade_xml = glade_xml_new (glade_file, BSSID_EDITOR_DIALOG, NULL);
+ g_free(glade_file);
+
+ dialog = glade_xml_get_widget (glade_xml, BSSID_EDITOR_DIALOG);
+
+ bssid_entry = glade_xml_get_widget( glade_xml,
+ BSSID_EDITOR_ENTRY);
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog),
+ GTK_WINDOW(bed_data->dialog));
+
+ gtk_entry_set_text(GTK_ENTRY(bssid_entry), bssid_value);
+
+ gint result = gtk_dialog_run (GTK_DIALOG(dialog));
+
+ if(result == GTK_RESPONSE_OK)
+ {
+ gchar *new_bssid;
+
+ new_bssid = g_strdup(gtk_entry_get_text(GTK_ENTRY(bssid_entry)));
+
+ store = GTK_LIST_STORE(gtk_tree_model_filter_get_model(
+ GTK_TREE_MODEL_FILTER(model)));
+
+ gtk_tree_model_filter_convert_iter_to_child_iter(
+ GTK_TREE_MODEL_FILTER(model),
+ &childIter,
+ &iter);
+
+ gtk_list_store_set ( store, &childIter, 0, new_bssid, -1);
+ }
+
+ gtk_widget_destroy(dialog);
+ g_free(glade_xml);
+
+
+
+}
+
+
Added: branches/network-manager-applet-0-6/editor/bssid-editor-dialog.h
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/bssid-editor-dialog.h Wed Jan 30 21:45:28 2008
@@ -0,0 +1,39 @@
+/* NetworkManager bssid editor dialog -- Edits bssids on wireless access points
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifndef BSSID_EDITOR_DIALOG_H
+#define BSSID_EDITOR_DIALOG_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gconf/gconf-client.h>
+#include <glade/glade.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib.h>
+#include <net/ethernet.h>
+
+gboolean run_bssid_editor(GtkWidget *parent, gchar *gconf_dir);
+
+
+#endif // BSSID_EDITOR_DIALOG_H
Added: branches/network-manager-applet-0-6/editor/editor-app.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-app.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,1145 @@
+/* NetworkManager Wireless Editor -- Edit wireless access points
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glib.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "editor-app.h"
+#include "editor-gconf-helper.h"
+#include "bssid-editor-dialog.h"
+#include "widget-wso.h"
+
+#define WE_GCONF_WIRELESS_PATH "/system/networking/wireless/networks"
+
+#define WE_ICON_SIZE 24
+
+// WirelessNetworkTreeView defines
+#define WNTV_DISPLAY_COLUMN 0
+#define WNTV_PIXBUF_COLUMN 1
+#define WNTV_DATA_COLUMN 2
+#define WNTV_NUM_COLUMNS 3
+
+// Security Options for Combo Box
+#define SEC_OPTION_NONE 0
+#define SEC_OPTION_WEP64 1
+#define SEC_OPTION_WEP128 2
+#define SEC_OPTION_WPA_PERSONAL 3
+#define SEC_OPTION_WPA2_PERSONAL 4
+#define SEC_OPTION_WPA_ENTERPRISE 5
+#define SEC_OPTION_WPA2_ENTERPRISE 6
+
+
+WE_DATA *get_editor();
+gboolean quit_editor(WE_DATA *we_data);
+void about_editor_cb(GtkMenuItem *menuitem, gpointer user_data);
+gboolean setup_dialog_idle(WE_DATA *we_data);
+void setup_dialog(WE_DATA *we_data);
+void populate_model(WE_DATA *we_data, GtkListStore *store);
+void network_selection_changed_cb (GtkTreeSelection *selection,
+ gpointer data);
+void bssids_button_clicked_cb(GtkButton *button, gpointer user_data);
+void network_remove_button_clicked_cb(GtkButton *button, gpointer user_data);
+void update_dialog_for_current_network(WE_DATA *we_data, gboolean enabled);
+void essid_entry_changed(GtkEntry *essid_entry, gpointer data);
+gboolean essid_entry_focus_lost(GtkWidget *widget, GdkEventFocus *event,
+ gpointer data);
+void security_combo_changed(GtkWidget *combo, gpointer data);
+void change_security_settings(gint option, gpointer data);
+void time_stamp_changed(GnomeDateEdit *dateedit, gpointer user_data);
+void update_security_widget(gint option, gpointer data);
+void set_security_combo(gint option, gpointer data);
+void connect_signal_handlers(WE_DATA *we_data, gboolean connect);
+
+
+
+int main(int argc, char **argv)
+{
+ WE_DATA *we_data;
+
+ gnome_program_init(PACKAGE, VERSION,
+ LIBGNOMEUI_MODULE, argc, argv,
+ GNOME_PARAM_NONE, GNOME_PARAM_NONE);
+
+ we_data = get_editor();
+ if(we_data != NULL)
+ {
+ gtk_widget_show_all(we_data->window);
+ gtk_main();
+ return 0;
+ }
+
+ return -1;
+}
+
+
+WE_DATA *get_editor()
+{
+ WE_DATA *we_data;
+ GtkTreeSelection *select;
+ GtkWidget *widget;
+
+ we_data = (WE_DATA *)malloc(sizeof(WE_DATA));
+ if(we_data == NULL)
+ {
+ g_print("malloc error\n");
+ return NULL;
+ }
+
+ memset(we_data, 0, sizeof(WE_DATA));
+
+ // load the glade file
+ we_data->glade_file = g_build_filename (GLADEDIR, "editor.glade", NULL);
+ if (!we_data->glade_file ||
+ !g_file_test (we_data->glade_file, G_FILE_TEST_IS_REGULAR))
+ {
+ we_data->glade_file = g_build_filename ("", "editor.glade", NULL);
+ }
+
+ if (!we_data->glade_file ||
+ !g_file_test (we_data->glade_file, G_FILE_TEST_IS_REGULAR))
+ {
+ g_print("Error loading editor.glade file!\n");
+ g_free (we_data->glade_file);
+ return NULL;
+ }
+
+ we_data->editor_xml = glade_xml_new (we_data->glade_file,
+ "wireless_editor", NULL);
+
+ we_data->window = glade_xml_get_widget (we_data->editor_xml,
+ "wireless_editor");
+
+ we_data->gconf_client = gconf_client_get_default();
+
+ g_signal_connect_swapped (we_data->window, "delete_event",
+ G_CALLBACK (quit_editor), we_data);
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "quit_nm_editor");
+
+ g_signal_connect_swapped (widget, "activate",
+ G_CALLBACK (quit_editor), we_data);
+
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "about_nm_editor");
+
+ g_signal_connect_swapped (widget, "activate",
+ G_CALLBACK (about_editor_cb), we_data->window);
+
+ we_data->treeview = glade_xml_get_widget(we_data->editor_xml,
+ "wireless_treeview");
+
+ select = gtk_tree_view_get_selection (GTK_TREE_VIEW (we_data->treeview));
+ gtk_tree_selection_set_mode (select, GTK_SELECTION_SINGLE);
+
+ g_signal_connect (G_OBJECT (select), "changed",
+ G_CALLBACK (network_selection_changed_cb), we_data);
+
+ we_data->essid_entry = glade_xml_get_widget(we_data->editor_xml,
+ "essid_entry");
+ we_data->security_combo = glade_xml_get_widget(we_data->editor_xml,
+ "security_combo");
+ we_data->stamp_editor = glade_xml_get_widget(we_data->editor_xml,
+ "lastused_dateedit");
+ we_data->remove_button = glade_xml_get_widget(we_data->editor_xml,
+ "remove_button");
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "bssids_modify");
+
+ g_signal_connect (G_OBJECT (widget), "clicked",
+ G_CALLBACK (bssids_button_clicked_cb), we_data);
+
+ g_signal_connect (G_OBJECT (we_data->remove_button), "clicked",
+ G_CALLBACK (network_remove_button_clicked_cb), we_data);
+
+ g_idle_add((GSourceFunc)setup_dialog_idle, we_data);
+
+ return we_data;
+}
+
+
+gboolean quit_editor(WE_DATA *we_data)
+{
+ if(we_data != NULL)
+ {
+ if(we_data->editor_xml != NULL)
+ g_object_unref(we_data->editor_xml);
+ if(we_data->gconf_client != NULL)
+ g_object_unref(we_data->gconf_client);
+ if(we_data->glade_file != NULL)
+ g_free(we_data->glade_file);
+ free(we_data);
+ }
+
+ gtk_exit(0);
+ return TRUE;
+}
+
+static void about_dialog_activate_link_cb (GtkAboutDialog *about,
+ const gchar *url,
+ gpointer data)
+{
+ gnome_url_show (url, NULL);
+}
+
+void about_editor_cb(GtkMenuItem *menuitem, gpointer user_data)
+{
+ static const gchar *authors[] =
+ {
+ "Calvin Gaisford <cgaisford novell com>",
+ "\nNetworkManager Developers:",
+ "Christopher Aillon <caillon redhat com>",
+ "Jonathan Blandford <jrb redhat com>",
+ "John Palmieri <johnp redhat com>",
+ "Ray Strode <rstrode redhat com>",
+ "Colin Walters <walters redhat com>",
+ "Dan Williams <dcbw redhat com>",
+ "David Zeuthen <davidz redhat com>",
+ "Bill Moss <bmoss clemson edu>",
+ "Tom Parker",
+ "j bootlab org",
+ "Peter Jones <pjones redhat com>",
+ "Robert Love <rml novell com>",
+ "Tim Niemueller <tim niemueller de>",
+ NULL
+ };
+
+ static const gchar *artists[] =
+ {
+ NULL
+ };
+
+ static const gchar *documenters[] =
+ {
+ NULL
+ };
+
+#if !GTK_CHECK_VERSION(2,6,0)
+ GdkPixbuf *pixbuf;
+ char *file;
+ GtkWidget *about_dialog;
+
+ /* GTK 2.4 and earlier, have to use libgnome for about dialog */
+ file = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP,
+ "gnome-networktool.png", FALSE, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (file, NULL);
+ g_free (file);
+
+ about_dialog = gnome_about_new (_("NetworkManager Editor"),
+ VERSION,
+ _("Copyright \xc2\xa9 2007 Novell, Inc."),
+ _("Editor for managing your wireless networks"),
+ authors,
+ documenters,
+ _("translator-credits"),
+ pixbuf);
+ g_object_unref (pixbuf);
+
+ gtk_window_set_screen (GTK_WINDOW (about_dialog),
+ gtk_widget_get_screen (GTK_WIDGET (applet)));
+ g_signal_connect (about_dialog, "destroy",
+ G_CALLBACK (gtk_widget_destroyed), &about_dialog);
+ gtk_widget_show (about_dialog);
+
+#else
+ static gboolean been_here = FALSE;
+ if (!been_here)
+ {
+ been_here = TRUE;
+ gtk_about_dialog_set_url_hook (about_dialog_activate_link_cb,
+ NULL, NULL);
+ }
+
+ /* GTK 2.6 and later code */
+ gtk_show_about_dialog (NULL,
+ "name", _("NetworkManager Editor"),
+ "version", VERSION,
+ "copyright", _("Copyright \xc2\xa9 2007 Novell, Inc."),
+ "comments", _("Editor for managing your wireless networks."),
+ "website", "http://www.gnome.org/projects/NetworkManager/",
+ "authors", authors,
+ "artists", artists,
+ "documenters", documenters,
+ "translator-credits", _("translator-credits"),
+ "logo-icon-name", GTK_STOCK_NETWORK,
+ NULL);
+#endif
+}
+
+
+gboolean setup_dialog_idle(WE_DATA *we_data)
+{
+ setup_dialog(we_data);
+ return FALSE;
+}
+
+
+void setup_dialog(WE_DATA *we_data)
+{
+ GtkListStore *store;
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer;
+ GtkTreeModel *filter;
+ GtkTreeIter iter;
+
+ store = gtk_list_store_new (WNTV_NUM_COLUMNS,
+ G_TYPE_STRING,
+ GDK_TYPE_PIXBUF,
+ G_TYPE_POINTER);
+
+ populate_model (we_data, store);
+
+ filter = gtk_tree_model_filter_new (GTK_TREE_MODEL (store), NULL);
+
+ gtk_tree_view_set_model (GTK_TREE_VIEW (we_data->treeview),
+ filter);
+
+ g_object_unref (store);
+ g_object_unref (filter);
+
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ column = gtk_tree_view_column_new_with_attributes ("Image", renderer,
+ "pixbuf", WNTV_PIXBUF_COLUMN, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (we_data->treeview), column);
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes ("Name", renderer,
+ "markup", WNTV_DISPLAY_COLUMN, NULL);
+
+ gtk_tree_view_append_column (GTK_TREE_VIEW (we_data->treeview), column);
+ gtk_tree_view_column_set_sort_column_id (column, 0);
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("None"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WEP 64-bit"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WEP 128-bit"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WPA Personal"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WPA2 Personal"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WPA Enterprise"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("WPA2 Enterprise"),
+ -1);
+
+ gtk_combo_box_set_model (GTK_COMBO_BOX(we_data->security_combo),
+ GTK_TREE_MODEL (store));
+
+ g_object_unref (store);
+}
+
+
+void populate_model(WE_DATA *we_data, GtkListStore *store)
+{
+ GtkTreeIter iter;
+ GdkPixbuf *pixbuf;
+ int icon_size = WE_ICON_SIZE;
+ GtkIconTheme *theme;
+ GSList *gconf_dirs;
+ GError *err;
+
+ if (gtk_widget_has_screen (we_data->treeview))
+ {
+ theme = gtk_icon_theme_get_for_screen (
+ gtk_widget_get_screen (we_data->treeview));
+ }
+ else
+ {
+ theme = gtk_icon_theme_get_default ();
+ }
+
+ pixbuf = gtk_icon_theme_load_icon (theme, "nm-device-wireless", icon_size,
+ 0, NULL);
+
+ gconf_dirs = gconf_client_all_dirs(we_data->gconf_client,
+ WE_GCONF_WIRELESS_PATH, &err);
+
+ while (gconf_dirs)
+ {
+ GError *err = NULL;
+ gchar *name_key = NULL;
+ gchar *name;
+ gchar *gconf_entry_dir;
+
+
+ gconf_entry_dir = g_strdup(gconf_dirs->data);
+ name_key = g_strdup_printf("%s/essid", gconf_entry_dir);
+ name = gconf_client_get_string(we_data->gconf_client, name_key, &err);
+
+ gtk_list_store_append (store, &iter);
+
+ gtk_list_store_set (store, &iter,
+ WNTV_DISPLAY_COLUMN, name,
+ WNTV_PIXBUF_COLUMN, pixbuf,
+ WNTV_DATA_COLUMN, gconf_entry_dir,
+ -1);
+
+ g_free(name_key);
+
+ gconf_dirs = g_slist_delete_link (gconf_dirs, gconf_dirs);
+ }
+}
+
+
+void network_selection_changed_cb (GtkTreeSelection *selection,
+ gpointer data)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ {
+ update_dialog_for_current_network(we_data, FALSE);
+ return;
+ }
+
+ gtk_tree_model_get (model, &iter, WNTV_DATA_COLUMN,
+ &(we_data->cur_gconf_dir), -1);
+
+ if(we_data->cur_gconf_dir != NULL)
+ {
+ connect_signal_handlers(we_data, FALSE);
+ update_dialog_for_current_network(we_data, TRUE);
+ connect_signal_handlers(we_data, TRUE);
+ }
+ else
+ update_dialog_for_current_network(we_data, FALSE);
+}
+
+
+void update_dialog_for_current_network(WE_DATA *we_data, gboolean enabled)
+{
+ GError *err = NULL;
+ gchar *key = NULL;
+ gchar *value;
+ GtkWidget *widget;
+ GSList *values;
+ gint intValue;
+ gint we_cipher;
+ gint wpa_version;
+
+ if(!enabled)
+ {
+ gtk_widget_set_sensitive(we_data->remove_button, TRUE);
+ gtk_entry_set_text(GTK_ENTRY(we_data->essid_entry), "");
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "bssids_entry");
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "lastused_dateedit");
+ gnome_date_edit_set_time(GNOME_DATE_EDIT(widget), 0);
+ gtk_widget_set_sensitive(widget, FALSE);
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "bssids_modify");
+ gtk_widget_set_sensitive(widget, FALSE);
+
+ set_security_combo(SEC_OPTION_NONE, we_data);
+ widget = glade_xml_get_widget(we_data->editor_xml, "security_combo");
+ gtk_widget_set_sensitive(widget, FALSE);
+ return;
+ }
+
+ // ============ COMMON PROPERTIES ============
+ // Get the essid
+ value = eh_gconf_client_get_string(we_data, "essid");
+ if(err == 0)
+ {
+ if(we_data->essid_value != NULL)
+ {
+ g_free(we_data->essid_value);
+ we_data->essid_value = NULL;
+ }
+ gtk_entry_set_text(GTK_ENTRY(we_data->essid_entry), value);
+ we_data->essid_value = g_strdup(value);
+ g_free(value);
+ }
+
+ // Get the bssids
+ widget = glade_xml_get_widget(we_data->editor_xml,
+ "bssids_entry");
+
+ key = g_strdup_printf("%s/bssids", we_data->cur_gconf_dir);
+ values = gconf_client_get_list(we_data->gconf_client, key,
+ GCONF_VALUE_STRING, &err);
+ if(err == 0)
+ {
+ gchar *strvalue = NULL;
+
+ while(values)
+ {
+ if(strvalue == NULL)
+ strvalue = g_strdup(values->data);
+ else
+ {
+ gchar *tmpstr;
+
+ tmpstr = strvalue;
+ strvalue = g_strdup_printf("%s, %s", tmpstr, (char *) values->data);
+ g_free(tmpstr);
+ }
+
+ g_free(values->data);
+
+ values = g_slist_delete_link (values, values);
+ }
+
+ if(strvalue != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), strvalue);
+ g_free(strvalue);
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+
+ g_free(key);
+
+
+ // set the Calendar editor
+ intValue = eh_gconf_client_get_int(we_data, "timestamp");
+ {
+ time_t t;
+
+ t = intValue;
+
+ widget = glade_xml_get_widget(we_data->editor_xml,
+ "lastused_dateedit");
+
+ gnome_date_edit_set_time(GNOME_DATE_EDIT(widget), t);
+ gtk_widget_set_sensitive(widget, TRUE);
+ }
+
+ widget = glade_xml_get_widget(we_data->editor_xml, "bssids_modify");
+ gtk_widget_set_sensitive(widget, TRUE);
+
+
+ // ============ GET CIPHER PROPERTY AND SWITCH ============
+ // Get the cipher
+ we_cipher = eh_gconf_client_get_int(we_data, "we_cipher");
+
+ switch(we_cipher)
+ {
+ default:
+ case IW_AUTH_CIPHER_NONE: // no security
+ set_security_combo(SEC_OPTION_NONE, we_data);
+ break;
+ case IW_AUTH_CIPHER_WEP40: // WEP 64bit
+ set_security_combo(SEC_OPTION_WEP64, we_data);
+ break;
+ case IW_AUTH_CIPHER_WEP104: // WEP 128bit
+ set_security_combo(SEC_OPTION_WEP128, we_data);
+ break;
+ case NM_AUTH_TYPE_WPA_PSK_AUTO: // WPA or WPA2 PERSONAL
+ case IW_AUTH_CIPHER_TKIP:
+ case IW_AUTH_CIPHER_CCMP:
+ {
+ wpa_version = eh_gconf_client_get_int(we_data,
+ "wpa_psk_wpa_version");
+ switch(wpa_version)
+ {
+ case IW_AUTH_WPA_VERSION_WPA:
+ set_security_combo(SEC_OPTION_WPA_PERSONAL, we_data);
+ break;
+ default:
+ case IW_AUTH_WPA_VERSION_WPA2:
+ set_security_combo(SEC_OPTION_WPA2_PERSONAL, we_data);
+ break;
+ }
+ break;
+ }
+ case NM_AUTH_TYPE_WPA_EAP: // WPA or WPA2 Enterprise
+ {
+ wpa_version = eh_gconf_client_get_int(we_data,
+ "wpa_eap_wpa_version");
+ switch(wpa_version)
+ {
+ case IW_AUTH_WPA_VERSION_WPA:
+ set_security_combo(SEC_OPTION_WPA_ENTERPRISE, we_data);
+ break;
+ default:
+ case IW_AUTH_WPA_VERSION_WPA2:
+ set_security_combo(SEC_OPTION_WPA2_ENTERPRISE, we_data);
+ break;
+ }
+ break;
+ }
+ }
+}
+
+
+gboolean essid_entry_focus_lost(GtkWidget *widget, GdkEventFocus *event,
+ gpointer data)
+{
+ essid_entry_changed(GTK_ENTRY(widget), data);
+ return FALSE;
+}
+
+
+// This function not only updated the gconf entry with the new
+// essid entry, but also moves the gconf dir for the entire set
+// of entries since they are stored in gconf by the essid
+void essid_entry_changed(GtkEntry *essid_entry, gpointer data)
+{
+ WE_DATA *we_data;
+ const gchar *new_essid;
+ gboolean do_update;
+
+ do_update = FALSE;
+ we_data = (WE_DATA *)data;
+ new_essid = gtk_entry_get_text(essid_entry);
+
+ if(we_data->essid_value == NULL)
+ do_update = TRUE;
+ else if(g_ascii_strcasecmp(new_essid, we_data->essid_value) != 0)
+ do_update = TRUE;
+
+ if(we_data->essid_value != NULL)
+ {
+ g_free(we_data->essid_value);
+ we_data->essid_value = g_strdup(new_essid);
+ }
+
+ if(do_update)
+ {
+ GtkTreeSelection *selection;
+ GError *err = NULL;
+ GtkTreeIter iter;
+ GtkTreeIter childIter;
+ GtkTreeModel *model;
+ GtkListStore *store;
+ gchar *key = NULL;
+ gchar *gconf_path;
+ gchar *gconf_new_path;
+ GSList *gconf_entries;
+
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (we_data->treeview));
+
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, WNTV_DATA_COLUMN, &gconf_path, -1);
+ if(gconf_path == NULL)
+ return;
+
+ // go through and move all of the gconf entries to the new entry
+ key = g_strdup_printf("%s/essid", gconf_path);
+ gconf_client_set_string(we_data->gconf_client, key, new_essid, &err);
+ g_free(key);
+
+ gconf_new_path = g_strdup_printf("%s/%s", WE_GCONF_WIRELESS_PATH,
+ new_essid);
+
+ err = NULL;
+ gconf_entries = gconf_client_all_entries(we_data->gconf_client,
+ gconf_path,
+ &err);
+ while (gconf_entries)
+ {
+ GConfEntry *gconf_entry;
+ gchar *entry_tail;
+
+ gconf_entry = gconf_entries->data;
+
+ entry_tail = g_strrstr(gconf_entry->key, "/");
+ if(entry_tail != NULL)
+ {
+ gchar *new_key;
+
+ new_key = g_strdup_printf("%s%s", gconf_new_path, entry_tail);
+
+ gconf_client_set(we_data->gconf_client,
+ new_key,
+ gconf_entry->value,
+ &err);
+
+ gconf_client_unset(we_data->gconf_client,
+ gconf_entry->key,
+ &err);
+ g_free(new_key);
+ }
+ gconf_entry_free(gconf_entry);
+ gconf_entries = g_slist_delete_link (gconf_entries, gconf_entries);
+ }
+ gconf_client_suggest_sync(we_data->gconf_client, &err);
+
+
+ // now update the data in the treeview
+ store = GTK_LIST_STORE(gtk_tree_model_filter_get_model(
+ GTK_TREE_MODEL_FILTER(model)));
+
+ gtk_tree_model_filter_convert_iter_to_child_iter(
+ GTK_TREE_MODEL_FILTER(model),
+ &childIter,
+ &iter);
+
+ gtk_list_store_set (
+ store,
+ &childIter,
+ WNTV_DISPLAY_COLUMN, g_strdup(new_essid),
+ WNTV_DATA_COLUMN, g_strdup(gconf_new_path),
+ -1);
+
+ g_free(gconf_new_path);
+ }
+}
+
+
+void security_combo_changed(GtkWidget *combo, gpointer data)
+{
+ switch(gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
+ {
+ case 0:
+ default:
+ change_security_settings(SEC_OPTION_NONE, data);
+ update_security_widget(SEC_OPTION_NONE, data);
+ break;
+ case 1:
+ change_security_settings(SEC_OPTION_WEP64, data);
+ update_security_widget(SEC_OPTION_WEP64, data);
+ break;
+ case 2:
+ change_security_settings(SEC_OPTION_WEP128, data);
+ update_security_widget(SEC_OPTION_WEP128, data);
+ break;
+ case 3:
+ change_security_settings(SEC_OPTION_WPA_PERSONAL, data);
+ update_security_widget(SEC_OPTION_WPA_PERSONAL, data);
+ break;
+ case 4:
+ change_security_settings(SEC_OPTION_WPA2_PERSONAL, data);
+ update_security_widget(SEC_OPTION_WPA2_PERSONAL, data);
+ break;
+ case 5:
+ change_security_settings(SEC_OPTION_WPA_ENTERPRISE, data);
+ update_security_widget(SEC_OPTION_WPA_ENTERPRISE, data);
+ break;
+ case 6:
+ change_security_settings(SEC_OPTION_WPA2_ENTERPRISE, data);
+ update_security_widget(SEC_OPTION_WPA2_ENTERPRISE, data);
+ break;
+ }
+}
+
+
+
+void change_security_settings(gint option, gpointer data)
+{
+ WE_DATA *we_data;
+
+ we_data = data;
+ g_return_if_fail(we_data != NULL);
+
+ switch(option)
+ {
+ default:
+ case SEC_OPTION_NONE:
+ eh_gconf_client_set_int(we_data, "we_cipher",
+ IW_AUTH_CIPHER_NONE);
+ eh_gconf_client_unset(we_data, "wep_auth_algorithm");
+ eh_gconf_client_unset(we_data, "wpa_psk_wpa_version");
+ break;
+ case SEC_OPTION_WEP64:
+ eh_gconf_client_set_int(we_data, "we_cipher",
+ IW_AUTH_CIPHER_WEP40);
+ eh_gconf_client_set_int(we_data, "wep_auth_algorithm",
+ IW_AUTH_ALG_OPEN_SYSTEM);
+ eh_gconf_client_unset(we_data, "wpa_psk_wpa_version");
+ break;
+ case SEC_OPTION_WEP128:
+ eh_gconf_client_set_int(we_data, "we_cipher",
+ IW_AUTH_CIPHER_WEP104);
+ eh_gconf_client_set_int(we_data, "wep_auth_algorithm",
+ IW_AUTH_ALG_OPEN_SYSTEM);
+ eh_gconf_client_unset(we_data, "wpa_psk_wpa_version");
+ break;
+ case SEC_OPTION_WPA_PERSONAL:
+ eh_gconf_client_set_int(we_data, "we_cipher", 0); // auto
+ eh_gconf_client_set_int(we_data, "wpa_psk_wpa_version",
+ IW_AUTH_WPA_VERSION_WPA);
+ eh_gconf_client_unset(we_data, "wep_auth_algorithm");
+ break;
+ case SEC_OPTION_WPA2_PERSONAL:
+ eh_gconf_client_set_int(we_data, "we_cipher", 0); // auto
+ eh_gconf_client_set_int(we_data, "wpa_psk_wpa_version",
+ IW_AUTH_WPA_VERSION_WPA2);
+ eh_gconf_client_unset(we_data, "wep_auth_algorithm");
+ break;
+ case SEC_OPTION_WPA_ENTERPRISE:
+ eh_gconf_client_set_int(we_data, "we_cipher",
+ NM_AUTH_TYPE_WPA_EAP);
+ eh_gconf_client_set_int(we_data, "wpa_eap_wpa_version",
+ IW_AUTH_WPA_VERSION_WPA);
+ eh_gconf_client_unset(we_data, "wep_auth_algorithm");
+ break;
+ case SEC_OPTION_WPA2_ENTERPRISE:
+ eh_gconf_client_set_int(we_data, "we_cipher",
+ NM_AUTH_TYPE_WPA_EAP);
+ eh_gconf_client_set_int(we_data, "wpa_eap_wpa_version",
+ IW_AUTH_WPA_VERSION_WPA2);
+ eh_gconf_client_unset(we_data, "wep_auth_algorithm");
+ break;
+ }
+}
+
+
+
+void set_security_combo(gint option, gpointer data)
+{
+ GtkWidget *combo;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ // get the combo so we can set the value
+ combo = GTK_WIDGET( glade_xml_get_widget(we_data->editor_xml,
+ "security_combo"));
+ g_return_if_fail(combo != NULL);
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), option);
+ gtk_widget_set_sensitive(combo, TRUE);
+ update_security_widget(option, data);
+}
+
+
+
+void update_security_widget(gint option, gpointer data)
+{
+ WE_DATA *we_data;
+ GtkWidget *vbox;
+ GList *children;
+ GtkWidget *childWidget;
+
+ we_data = data;
+ g_return_if_fail(we_data != NULL);
+
+ vbox = GTK_WIDGET( glade_xml_get_widget(we_data->editor_xml,
+ "swapout_vbox"));
+ g_return_if_fail(vbox != NULL);
+
+ // loop through and remove all of the existing children
+ for(children = gtk_container_get_children(GTK_CONTAINER(vbox));
+ children;
+ children = g_list_next(children))
+ {
+ GtkWidget *child = GTK_WIDGET(children->data);
+ gtk_container_remove(GTK_CONTAINER(vbox), child);
+ }
+
+ if(we_data->sub_xml != NULL)
+ {
+ g_object_unref(we_data->sub_xml);
+ we_data->sub_xml = NULL;
+ }
+
+ switch(option)
+ {
+ default:
+ case SEC_OPTION_NONE:
+ childWidget = NULL;
+ break;
+ case SEC_OPTION_WEP64:
+ case SEC_OPTION_WEP128:
+ childWidget = get_wep_widget(we_data);
+ break;
+ case SEC_OPTION_WPA_PERSONAL:
+ case SEC_OPTION_WPA2_PERSONAL:
+ childWidget = get_wpa_personal_widget(we_data);
+ break;
+ case SEC_OPTION_WPA_ENTERPRISE:
+ case SEC_OPTION_WPA2_ENTERPRISE:
+ childWidget = get_wpa_enterprise_widget(we_data);
+ break;
+ }
+
+ if(childWidget != NULL)
+ gtk_container_add(GTK_CONTAINER(vbox), childWidget);
+}
+
+
+
+void connect_signal_handlers(WE_DATA *we_data, gboolean connect)
+{
+ if(g_signal_handler_is_connected(G_OBJECT(we_data->essid_entry),
+ we_data->essid_shid))
+ {
+ g_signal_handler_disconnect(G_OBJECT(we_data->essid_entry),
+ we_data->essid_shid);
+ we_data->essid_shid = 0;
+ }
+ if(g_signal_handler_is_connected(G_OBJECT(we_data->essid_entry),
+ we_data->essid_focus_shid))
+ {
+ g_signal_handler_disconnect(G_OBJECT(we_data->essid_entry),
+ we_data->essid_focus_shid);
+ we_data->essid_focus_shid = 0;
+ }
+ if(g_signal_handler_is_connected(G_OBJECT(we_data->security_combo),
+ we_data->combo_shid))
+ {
+ g_signal_handler_disconnect(G_OBJECT(we_data->security_combo),
+ we_data->combo_shid);
+ we_data->essid_shid = 0;
+ }
+ if(g_signal_handler_is_connected(G_OBJECT(we_data->stamp_editor),
+ we_data->stamp_date_shid))
+ {
+ g_signal_handler_disconnect(G_OBJECT(we_data->stamp_editor),
+ we_data->stamp_date_shid);
+ we_data->stamp_date_shid = 0;
+ }
+ if(g_signal_handler_is_connected(G_OBJECT(we_data->stamp_editor),
+ we_data->stamp_time_shid))
+ {
+ g_signal_handler_disconnect(G_OBJECT(we_data->stamp_editor),
+ we_data->stamp_time_shid);
+ we_data->stamp_time_shid = 0;
+ }
+ if(connect)
+ {
+ we_data->essid_shid = g_signal_connect(
+ G_OBJECT(we_data->essid_entry), "activate",
+ GTK_SIGNAL_FUNC (essid_entry_changed), we_data);
+ we_data->essid_focus_shid = g_signal_connect(
+ G_OBJECT(we_data->essid_entry), "focus-out-event",
+ GTK_SIGNAL_FUNC (essid_entry_focus_lost), we_data);
+ we_data->combo_shid = g_signal_connect(
+ G_OBJECT(we_data->security_combo), "changed",
+ GTK_SIGNAL_FUNC (security_combo_changed), we_data);
+ we_data->stamp_date_shid = g_signal_connect(
+ G_OBJECT(we_data->stamp_editor), "date-changed",
+ GTK_SIGNAL_FUNC (time_stamp_changed), we_data);
+ we_data->stamp_time_shid = g_signal_connect(
+ G_OBJECT(we_data->stamp_editor), "time-changed",
+ GTK_SIGNAL_FUNC (time_stamp_changed), we_data);
+ }
+}
+
+
+void bssids_button_clicked_cb(GtkButton *button, gpointer user_data)
+{
+ WE_DATA *we_data;
+ GtkTreeSelection *selection;
+ gchar *key = NULL;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ gchar *gconf_path;
+ GSList *values;
+ GtkWidget *widget;
+ GError *err = NULL;
+
+ we_data = user_data;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (we_data->treeview));
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, WNTV_DATA_COLUMN, &gconf_path, -1);
+ if(gconf_path == NULL)
+ return;
+
+ key = g_strdup_printf("%s/bssids", gconf_path);
+
+ widget = glade_xml_get_widget(we_data->editor_xml,
+ "bssids_entry");
+
+ if(run_bssid_editor(we_data->window, key))
+ {
+ values = gconf_client_get_list(we_data->gconf_client, key,
+ GCONF_VALUE_STRING, &err);
+
+ if(err == 0)
+ {
+ gchar *strvalue = NULL;
+
+ while(values)
+ {
+ if(strvalue == NULL)
+ strvalue = g_strdup(values->data);
+ else
+ {
+ gchar *tmpstr;
+
+ tmpstr = strvalue;
+ strvalue = g_strdup_printf("%s, %s", tmpstr, (char *) values->data);
+ g_free(tmpstr);
+ }
+
+ g_free(values->data);
+
+ values = g_slist_delete_link (values, values);
+ }
+
+ if(strvalue != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), strvalue);
+ g_free(strvalue);
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ }
+
+ g_free(key);
+}
+
+
+
+void time_stamp_changed(GnomeDateEdit *dateedit, gpointer user_data)
+{
+ WE_DATA *we_data;
+ GtkTreeSelection *selection;
+ gchar *key = NULL;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ gchar *gconf_path;
+ GError *err = NULL;
+ time_t t;
+
+ we_data = user_data;
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (we_data->treeview));
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, WNTV_DATA_COLUMN, &gconf_path, -1);
+ if(gconf_path == NULL)
+ return;
+
+ key = g_strdup_printf("%s/timestamp", gconf_path);
+
+ t = gnome_date_edit_get_time(dateedit);
+
+ gconf_client_set_int(we_data->gconf_client, key, t, NULL);
+
+ gconf_client_suggest_sync(we_data->gconf_client, &err);
+
+ g_free(key);
+}
+
+
+
+void network_remove_button_clicked_cb(GtkButton *button, gpointer user_data)
+{
+ WE_DATA *we_data;
+ GtkTreeSelection *selection;
+ GError *err = NULL;
+ GtkTreeIter iter;
+ GtkTreeIter childIter;
+ GtkTreeModel *model;
+ GtkListStore *store;
+ gchar *gconf_path;
+ GSList *gconf_entries;
+
+ we_data = (WE_DATA *)user_data;
+
+ selection = gtk_tree_view_get_selection (
+ GTK_TREE_VIEW (we_data->treeview));
+
+ if(!gtk_tree_selection_get_selected (selection, &model, &iter))
+ return;
+
+ gtk_tree_model_get (model, &iter, WNTV_DATA_COLUMN, &gconf_path, -1);
+ if(gconf_path == NULL)
+ return;
+
+ err = NULL;
+ gconf_entries = gconf_client_all_entries(we_data->gconf_client,
+ gconf_path,
+ &err);
+
+ while (gconf_entries)
+ {
+ GConfEntry *gconf_entry;
+
+ gconf_entry = gconf_entries->data;
+
+ gconf_client_unset(we_data->gconf_client,
+ gconf_entry->key,
+ &err);
+
+ gconf_entry_free(gconf_entry);
+ gconf_entries = g_slist_delete_link (gconf_entries, gconf_entries);
+ }
+
+ gconf_client_suggest_sync(we_data->gconf_client, &err);
+
+ // now update the data in the treeview
+ store = GTK_LIST_STORE(gtk_tree_model_filter_get_model(
+ GTK_TREE_MODEL_FILTER(model)));
+
+ gtk_tree_model_filter_convert_iter_to_child_iter(
+ GTK_TREE_MODEL_FILTER(model),
+ &childIter,
+ &iter);
+
+ gtk_list_store_remove ( store, &childIter);
+
+}
+
+
Added: branches/network-manager-applet-0-6/editor/editor-app.h
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-app.h Wed Jan 30 21:45:28 2008
@@ -0,0 +1,80 @@
+/* NetworkManager Wireless Editor -- Edits wireless access points
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifndef EDITOR_H
+#define EDITOR_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <gconf/gconf-client.h>
+#include <glade/glade.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib.h>
+#include <net/ethernet.h>
+
+
+// FIX THIS... these should be included from the proper files!
+/* IW_AUTH_WPA_VERSION values (bit field) */
+#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
+#define IW_AUTH_WPA_VERSION_WPA 0x00000002
+#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
+
+/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
+#define IW_AUTH_CIPHER_NONE 0x00000001
+#define IW_AUTH_CIPHER_WEP40 0x00000002
+#define IW_AUTH_CIPHER_TKIP 0x00000004
+#define IW_AUTH_CIPHER_CCMP 0x00000008
+#define IW_AUTH_CIPHER_WEP104 0x00000010
+
+/* IW_AUTH_80211_AUTH_ALG values (bit field) */
+#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
+#define IW_AUTH_ALG_SHARED_KEY 0x00000002
+#define IW_AUTH_ALG_LEAP 0x00000004
+
+
+typedef struct _wireless_editor_data
+{
+ gchar *glade_file;
+ GladeXML *editor_xml;
+ GladeXML *sub_xml;
+ GConfClient *gconf_client;
+ gchar *cur_gconf_dir;
+ GtkWidget *window;
+ GtkWidget *treeview;
+ GtkWidget *remove_button;
+ GtkWidget *essid_entry;
+ GtkWidget *stamp_editor;
+ GtkWidget *security_combo;
+ gchar *essid_value;
+ gulong essid_shid;
+ gulong essid_focus_shid;
+ gulong stamp_date_shid;
+ gulong stamp_time_shid;
+ gulong combo_shid;
+} WE_DATA;
+
+
+
+
+#endif // EDITOR_H
Added: branches/network-manager-applet-0-6/editor/editor-gconf-helper.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-gconf-helper.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,98 @@
+/* Wireless Security Editor gconf helper functions
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "editor-gconf-helper.h"
+
+
+void eh_gconf_client_set_string(WE_DATA *we_data, gchar *subkey, gchar *value)
+{
+ gchar *key;
+
+ key = g_strdup_printf("%s/%s", we_data->cur_gconf_dir, subkey);
+ gconf_client_set_string(we_data->gconf_client, key, value, NULL);
+ gconf_client_suggest_sync(we_data->gconf_client, NULL);
+ g_free(key);
+}
+
+gchar *eh_gconf_client_get_string(WE_DATA *we_data, gchar *subkey)
+{
+ gchar *key;
+ gchar *value;
+
+ key = g_strdup_printf("%s/%s", we_data->cur_gconf_dir, subkey);
+ value = gconf_client_get_string(we_data->gconf_client, key, NULL);
+ g_free(key);
+
+ return value;
+}
+
+void eh_gconf_client_set_int(WE_DATA *we_data, gchar *subkey, gint value)
+{
+ gchar *key;
+
+ key = g_strdup_printf("%s/%s", we_data->cur_gconf_dir, subkey);
+ gconf_client_set_int(we_data->gconf_client, key, value, NULL);
+ gconf_client_suggest_sync(we_data->gconf_client, NULL);
+ g_free(key);
+}
+
+gint eh_gconf_client_get_int(WE_DATA *we_data, gchar *subkey)
+{
+ gchar *key;
+ gint value = 0;
+
+ key = g_strdup_printf("%s/%s", we_data->cur_gconf_dir, subkey);
+ value = gconf_client_get_int(we_data->gconf_client, key, NULL);
+ g_free(key);
+
+ return value;
+}
+
+void eh_gconf_client_unset(WE_DATA *we_data, gchar *subkey)
+{
+ gchar *key;
+
+ key = g_strdup_printf("%s/%s", we_data->cur_gconf_dir, subkey);
+ gconf_client_unset(we_data->gconf_client,
+ key,
+ NULL);
+ gconf_client_suggest_sync(we_data->gconf_client, NULL);
+ g_free(key);
+}
+
Added: branches/network-manager-applet-0-6/editor/editor-gconf-helper.h
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-gconf-helper.h Wed Jan 30 21:45:28 2008
@@ -0,0 +1,58 @@
+/* Wireless Security Editor gconf helper functions
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+
+#ifndef EDITOR_GCONF_HELPER_H
+#define EDITOR_GCONF_HELPER_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "editor-app.h"
+
+void eh_gconf_client_set_string(WE_DATA *we_data, gchar *subkey, gchar *value);
+gchar *eh_gconf_client_get_string(WE_DATA *we_data, gchar *subkey);
+void eh_gconf_client_set_int(WE_DATA *we_data, gchar *subkey, gint value);
+gint eh_gconf_client_get_int(WE_DATA *we_data, gchar *subkey);
+void eh_gconf_client_unset(WE_DATA *we_data, gchar *subkey);
+
+#endif // EDITOR_GCONF_HELPER_H
+
+
+
+
+
+
Added: branches/network-manager-applet-0-6/editor/editor-keyring-helper.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-keyring-helper.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,138 @@
+/* -*- Mode: C; tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
+
+/* Wireless Security Editor keyring helper functions
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <gnome-keyring.h>
+#include <NetworkManager.h>
+
+#include "editor-keyring-helper.h"
+
+
+static GnomeKeyringResult real_get_key (const char *essid, const char *key_name, char **key)
+{
+ GnomeKeyringResult ret;
+ GList * found_list = NULL;
+ GnomeKeyringFound * found;
+
+ *key = NULL;
+
+ g_return_val_if_fail (essid != NULL, GNOME_KEYRING_RESULT_BAD_ARGUMENTS);
+
+ ret = gnome_keyring_find_itemsv_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ &found_list,
+ key_name,
+ GNOME_KEYRING_ATTRIBUTE_TYPE_STRING,
+ essid,
+ NULL);
+
+ if (ret != GNOME_KEYRING_RESULT_OK)
+ return ret;
+
+ if (found_list) {
+ found = (GnomeKeyringFound *) found_list->data;
+ *key = g_strdup (found->secret);
+ gnome_keyring_found_list_free (found_list);
+ }
+
+ return ret;
+}
+
+
+GnomeKeyringResult get_key_from_keyring (const char *essid, char **key)
+{
+ return real_get_key (essid, "essid", key);
+}
+
+GnomeKeyringResult get_eap_key_from_keyring (const char *essid, char **key)
+{
+ return real_get_key (essid, "private-key-passwd", key);
+}
+
+static GnomeKeyringResult
+real_set_key (const char *essid,
+ const char *key_name,
+ const char *description,
+ const char *key)
+{
+ GnomeKeyringAttributeList * attributes;
+ GnomeKeyringAttribute attr;
+ GnomeKeyringResult ret;
+ guint32 item_id;
+
+ attributes = gnome_keyring_attribute_list_new ();
+ attr.name = g_strdup (key_name);
+ attr.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING;
+ attr.value.string = g_strdup (essid);
+ g_array_append_val (attributes, attr);
+
+ ret = gnome_keyring_item_create_sync (NULL,
+ GNOME_KEYRING_ITEM_GENERIC_SECRET,
+ description,
+ attributes,
+ key,
+ TRUE,
+ &item_id);
+
+ gnome_keyring_attribute_list_free (attributes);
+
+ return ret;
+}
+
+GnomeKeyringResult set_key_in_keyring (const char *essid, const char *key)
+{
+ GnomeKeyringResult res;
+ char *desc;
+
+ desc = g_strdup_printf (_("Passphrase for wireless network %s"), essid);
+ res = real_set_key (essid, "essid", desc, key);
+ g_free (desc);
+
+ return res;
+}
+
+GnomeKeyringResult set_eap_key_in_keyring (const char *essid, const char *key)
+{
+ GnomeKeyringResult res;
+ char *desc;
+
+ desc = g_strdup_printf (_("Private key password for wireless network %s"), essid);
+ res = real_set_key (essid, "private-key-passwd", desc, key);
+ g_free (desc);
+
+ return res;
+}
Added: branches/network-manager-applet-0-6/editor/editor-keyring-helper.h
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor-keyring-helper.h Wed Jan 30 21:45:28 2008
@@ -0,0 +1,56 @@
+/* Wireless Security Editor keyring helper functions
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+
+#ifndef EDITOR_KEYRING_HELPER_H
+#define EDITOR_KEYRING_HELPER_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <gnome-keyring.h>
+
+#include "editor-app.h"
+
+GnomeKeyringResult get_key_from_keyring (const char *essid, char **key);
+GnomeKeyringResult get_eap_key_from_keyring (const char *essid, char **key);
+
+GnomeKeyringResult set_key_in_keyring (const char *essid, const char *key);
+GnomeKeyringResult set_eap_key_in_keyring (const char *essid, const char *key);
+
+#endif // EDITOR_KEYRING_HELPER_H
+
+
+
+
+
+
Added: branches/network-manager-applet-0-6/editor/editor.glade
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/editor.glade Wed Jan 30 21:45:28 2008
@@ -0,0 +1,2477 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+<requires lib="gnome"/>
+
+<widget class="GtkWindow" id="wireless_editor">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Wireless Networks</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="default_width">600</property>
+ <property name="default_height">400</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="vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
+ <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
+
+ <child>
+ <widget class="GtkMenuItem" id="file1">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_FILE_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="file1_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="quit_nm_editor">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property>
+ <signal name="activate" handler="on_quit_activate" last_modification_time="Mon, 08 Jan 2007 22:18:37 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="help1">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_HELP_TREE</property>
+
+ <child>
+ <widget class="GtkMenu" id="help1_menu">
+
+ <child>
+ <widget class="GtkImageMenuItem" id="about_nm_editor">
+ <property name="visible">True</property>
+ <property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
+ <signal name="activate" handler="on_about_nm_editor" last_modification_time="Mon, 08 Jan 2007 22:18:37 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHPaned" id="hpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="position">1</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="border_width">6</property>
+ <property name="width_request">175</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Wireless Networks</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="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</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_NEVER</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="wireless_treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</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="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-remove</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="shrink">False</property>
+ <property name="resize">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="border_width">6</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Properties</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="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</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_NONE</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+
+ <child>
+ <widget class="GtkVBox" id="properties_vbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">5</property>
+ <property name="column_spacing">5</property>
+
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Name:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</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="GtkEntry" id="essid_entry">
+ <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="invisible_char">â</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>
+
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">bssids:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</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">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkEntry" id="bssids_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</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="invisible_char">â</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="bssids_modify">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-edit</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NONE</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </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="label4">
+ <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_RIGHT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</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">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="security_combo">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="items" translatable="yes">None
+WEP 128-bit Passphrase
+WEB 64/128 bit Hex
+WEP 64/128-bit ASCII
+</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">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Last Used:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_RIGHT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">1</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">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GnomeDateEdit" id="lastused_dateedit">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="dateedit_flags">GNOME_DATE_EDIT_SHOW_TIME|GNOME_DATE_EDIT_24_HR</property>
+ <property name="lower_hour">0</property>
+ <property name="upper_hour">23</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="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="swapout_vbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="shrink">False</property>
+ <property name="resize">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="GtkDialog" id="bssids_dialog">
+ <property name="width_request">300</property>
+ <property name="height_request">250</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">bssid editor</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</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_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="vbox4">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Access points</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="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <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_ETCHED_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTreeView" id="bssids_treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">False</property>
+ <property name="reorderable">False</property>
+ <property name="enable_search">False</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="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVButtonBox" id="vbuttonbox1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_START</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkButton" id="add_button">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-add</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Add</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.5</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>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="remove_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="stock">gtk-remove</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Remove</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.5</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>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="edit_button">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image3">
+ <property name="visible">True</property>
+ <property name="stock">gtk-edit</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</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.5</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>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</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>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkDialog" id="bssid_editor">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Edit Access Point</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">False</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_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">True</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox2">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Access Point:</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.5</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="GtkEntry" id="bssid_entry">
+ <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="invisible_char">â</property>
+ <property name="activates_default">False</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkWindow" id="wep_subwindow">
+ <property name="visible">True</property>
+ <property name="title">wep_subwindow</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="GtkNotebook" id="wep_notebook">
+ <property name="visible">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+
+ <child>
+ <widget class="GtkTable" id="table2">
+ <property name="border_width">8</property>
+ <property name="visible">True</property>
+ <property name="n_rows">3</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="wep_key_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Key:</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">1</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="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Authentication:</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">1</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">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="auth_method_combo">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Open System
+Shared Key</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="label14">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wep_key_entry">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</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="invisible_char">â</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>
+
+ <child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="wep_show_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">_Show Key</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">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="wep_set_key_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Set _Key</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </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>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkDialog" id="wep_key_editor">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Set WEP Key</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="modal">False</property>
+ <property name="resizable">False</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_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">False</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox3">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area3">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="cancelbutton3">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="okbutton3">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="table3">
+ <property name="border_width">5</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="label17">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Key:</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="GtkEntry" id="wep_key_editor_entry">
+ <property name="width_request">300</property>
+ <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="invisible_char">â</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>
+
+ <child>
+ <widget class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Format:</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">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="wep_key_editor_combo">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Hex
+ASCII
+Passphrase</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>
+ </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="wpa_psk_subwindow">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">wpa_psk_subwindow</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="GtkNotebook" id="wpa_psk_notebook">
+ <property name="visible">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+
+ <child>
+ <widget class="GtkTable" id="table4">
+ <property name="border_width">8</property>
+ <property name="visible">True</property>
+ <property name="n_rows">3</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="wpa_psk_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Password:</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.5</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="GtkEntry" id="wpa_psk_entry">
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</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="invisible_char">â</property>
+ <property name="activates_default">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"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa_psk_type_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Type:</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">1</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">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="wpa_psk_type_combo">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Automatic (Default)
+AES-CCMP
+TKIP</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="label21">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="show_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show Password</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">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="wpa_psk_set_password">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Set _Password</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </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>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkWindow" id="wpa_eap_subwindow">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">wpa_eap_subwindow</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="GtkNotebook" id="wpa_eap_notebook">
+ <property name="visible">True</property>
+ <property name="show_tabs">False</property>
+ <property name="show_border">False</property>
+ <property name="tab_pos">GTK_POS_TOP</property>
+ <property name="scrollable">False</property>
+ <property name="enable_popup">False</property>
+
+ <child>
+ <widget class="GtkTable" id="table5">
+ <property name="border_width">8</property>
+ <property name="visible">True</property>
+ <property name="n_rows">10</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="wpa-eap-ca-cert-file-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">CA Certificate File:</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">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-private-key-file-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Private Key File:</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">7</property>
+ <property name="bottom_attach">8</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFileChooserButton" id="wpa_eap_ca_cert_file_chooser_button">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select the CA Certificate File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">False</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</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="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFileChooserButton" id="wpa_eap_private_key_file_chooser_button">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select the Private Key File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">False</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</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="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-private-key-passwd-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Private Key Password:</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">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wpa_eap_private_key_passwd_entry">
+ <property name="visible">True</property>
+ <property name="sensitive">False</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="invisible_char">â</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">8</property>
+ <property name="bottom_attach">9</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-client-cert-file-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Client Certificate File:</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">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkFileChooserButton" id="wpa_eap_client_cert_file_chooser_button">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Select the Client Certificate File</property>
+ <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
+ <property name="local_only">True</property>
+ <property name="show_hidden">True</property>
+ <property name="do_overwrite_confirmation">False</property>
+ <property name="width_chars">-1</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="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-identity-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Identity:</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">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-password-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Password:</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">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="wpa-eap-anon-identity-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Anonymous Identity:</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">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wpa_eap_identity_entry">
+ <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="invisible_char">â</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">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wpa_eap_passwd_entry">
+ <property name="visible">True</property>
+ <property name="sensitive">False</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="invisible_char">â</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">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkEntry" id="wpa_eap_anon_identity_entry">
+ <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="invisible_char">â</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">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-eap-method-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">EAP Method:</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="wpa_eap_eap_method_combo">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">MD5
+MSCHAPv2
+OTP
+GTC
+PEAP
+TLS
+TTLS</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="x_options">fill</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label32">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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">9</property>
+ <property name="bottom_attach">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="show_checkbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show passwords</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">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">9</property>
+ <property name="bottom_attach">10</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="wpa-key-type-label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Key Type:</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">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="wpa_eap_key_type_combo">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Automatic (Default)
+AES-CCMP
+TKIP
+Dynamic WEP</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>
+ </widget>
+ <packing>
+ <property name="tab_expand">False</property>
+ <property name="tab_fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label34">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label35">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></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.5</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="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+<widget class="GtkDialog" id="set_password_dialog">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Set Password</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="modal">False</property>
+ <property name="resizable">False</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_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+ <property name="focus_on_map">True</property>
+ <property name="urgency_hint">False</property>
+ <property name="has_separator">False</property>
+
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="hbuttonbox4">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button2">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-ok</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-5</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkTable" id="table6">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="n_rows">1</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="label36">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Password:</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="GtkEntry" id="password_entry">
+ <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="invisible_char">â</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>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
+</glade-interface>
Added: branches/network-manager-applet-0-6/editor/nm-editor.desktop
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/nm-editor.desktop Wed Jan 30 21:45:28 2008
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=Network Manager Editor
+Comment=Edits the wireless networks used in Network Manager
+Icon=nm-device-wireless
+Exec=nm-editor
+Terminal=false
+Type=Application
+Categories=System;SystemSetup;
+OnlyShowIn=GNOME;
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=NetworkManager
+X-GNOME-Bugzilla-Component=general
Added: branches/network-manager-applet-0-6/editor/widget-wso-wep.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/widget-wso-wep.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,240 @@
+/* Wireless Security Option WEP Widget
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "widget-wso.h"
+
+void wep_auth_method_changed(GtkWidget *combo, gpointer data);
+void wep_show_toggled(GtkToggleButton *button, gpointer data);
+void set_key_button_clicked_cb(GtkButton *button, gpointer user_data);
+
+GtkWidget *get_wep_widget(WE_DATA *we_data)
+{
+ GtkWidget *main_widget = NULL;
+ GtkWidget *widget = NULL;
+ gint intValue;
+
+ we_data->sub_xml = glade_xml_new(we_data->glade_file,
+ "wep_notebook", NULL);
+ if(we_data->sub_xml == NULL)
+ return NULL;
+
+ main_widget = glade_xml_get_widget(we_data->sub_xml, "wep_notebook");
+ if(main_widget != NULL)
+ g_object_ref(G_OBJECT(main_widget));
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wep_show_checkbutton");
+ g_signal_connect (G_OBJECT (widget), "toggled",
+ G_CALLBACK (wep_show_toggled), we_data);
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "auth_method_combo");
+ intValue = eh_gconf_client_get_int(we_data, "wep_auth_algorithm");
+ if(intValue == IW_AUTH_ALG_SHARED_KEY)
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
+ else
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
+
+ g_signal_connect( G_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC (wep_auth_method_changed), we_data);
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wep_key_label");
+ gtk_label_set_text(GTK_LABEL(widget), _("Key"));
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wep_show_checkbutton");
+ gtk_button_set_label(GTK_BUTTON(widget), _("_Show Key"));
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wep_set_key_button");
+ g_signal_connect (G_OBJECT (widget), "clicked",
+ G_CALLBACK (set_key_button_clicked_cb), we_data);
+
+ return main_widget;
+}
+
+
+void wep_auth_method_changed(GtkWidget *combo, gpointer data)
+{
+ WE_DATA *we_data;
+ gint intValue;
+
+ we_data = data;
+
+ intValue = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ if(intValue == 0)
+ eh_gconf_client_set_int(we_data, "wep_auth_algorithm",
+ IW_AUTH_ALG_OPEN_SYSTEM);
+ else
+ eh_gconf_client_set_int(we_data, "wep_auth_algorithm",
+ IW_AUTH_ALG_SHARED_KEY);
+}
+
+
+
+void wep_show_toggled(GtkToggleButton *button, gpointer data)
+{
+ GtkWidget *widget;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wep_key_entry");
+
+ if(gtk_toggle_button_get_active(button))
+ {
+ gchar *key;
+ GnomeKeyringResult kresult;
+
+ kresult = get_key_from_keyring(we_data->essid_value, &key);
+ if(kresult == GNOME_KEYRING_RESULT_OK ||
+ kresult == GNOME_KEYRING_RESULT_NO_SUCH_KEYRING)
+ {
+ gtk_widget_set_sensitive(widget, TRUE);
+
+ if(key != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), key);
+ g_free(key);
+ }
+ }
+ else
+ gtk_toggle_button_set_active(button, FALSE);
+ if(kresult == GNOME_KEYRING_RESULT_DENIED)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), _("Unable to read key"));
+ }
+ }
+ else
+ {
+ gtk_widget_set_sensitive(widget, FALSE);
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ }
+}
+
+
+void set_key_button_clicked_cb(GtkButton *button, gpointer user_data)
+{
+ GladeXML *glade_xml;
+ GtkWidget *dialog;
+ GtkWidget *keyEntry;
+ GtkWidget *formatCombo;
+ WE_DATA *we_data;
+ GtkListStore *store;
+ GtkTreeIter iter;
+ GtkWindow *parentWindow;
+
+ we_data = user_data;
+
+ glade_xml = glade_xml_new(we_data->glade_file,
+ "wep_key_editor", NULL);
+
+
+ dialog = glade_xml_get_widget (glade_xml, "wep_key_editor");
+
+ keyEntry = glade_xml_get_widget (glade_xml, "wep_key_editor_entry");
+
+ formatCombo = glade_xml_get_widget (glade_xml, "wep_key_editor_combo");
+
+ parentWindow = GTK_WINDOW(gtk_widget_get_ancestor(
+ GTK_WIDGET(button), GTK_TYPE_WINDOW));
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), parentWindow);
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("Hex"),
+ -1);
+
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("ASCII"),
+ -1);
+
+ gint we_cipher = eh_gconf_client_get_int(we_data, "we_cipher");
+ if(we_cipher == IW_AUTH_CIPHER_WEP104)
+ {
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _("Passphrase"),
+ -1);
+ }
+
+ gtk_combo_box_set_model(GTK_COMBO_BOX(formatCombo),
+ GTK_TREE_MODEL (store));
+
+ gtk_combo_box_set_active(GTK_COMBO_BOX(formatCombo), 0);
+
+ g_object_unref (store);
+
+ gint result = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ if(result == GTK_RESPONSE_OK)
+ {
+ const gchar *key;
+ GnomeKeyringResult kresult;
+
+ key = gtk_entry_get_text(GTK_ENTRY(keyEntry));
+
+ if(key != NULL)
+ {
+ kresult = set_key_in_keyring (we_data->essid_value, key);
+
+ if(kresult != GNOME_KEYRING_RESULT_OK)
+ {
+ GtkWidget *errorDialog = gtk_message_dialog_new (parentWindow,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to set key"));
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (errorDialog),
+ _("There was a problem setting the wireless key to the gnome keyring. Error 0x%02X."),
+ (int)kresult);
+
+ gtk_dialog_run (GTK_DIALOG (errorDialog));
+ gtk_widget_destroy (errorDialog);
+ }
+ }
+ }
+
+ gtk_widget_destroy(dialog);
+ g_free(glade_xml);
+}
+
+
Added: branches/network-manager-applet-0-6/editor/widget-wso-wpa-enterprise.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/widget-wso-wpa-enterprise.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,540 @@
+/* Wireless Security Option WPA/WPA2 Enterprise Widget
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "widget-wso.h"
+
+void wpa_eap_eap_method_changed(GtkWidget *combo, gpointer data);
+void wpa_eap_key_type_changed(GtkWidget *combo, gpointer data);
+void wpa_eap_show_toggled(GtkToggleButton *button, gpointer data);
+void wpa_eap_private_key_changed(GtkWidget *button, gpointer data);
+void wpa_eap_client_key_changed(GtkWidget *button, gpointer data);
+void wpa_eap_ca_key_changed(GtkWidget *button, gpointer data);
+
+
+void wpa_eap_password_entry_changed(GtkEntry *password_entry, gpointer data);
+gboolean wpa_eap_password_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data);
+void wpa_eap_priv_password_entry_changed(GtkEntry *pass_entry, gpointer data);
+gboolean wpa_eap_priv_password_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data);
+
+void wpa_eap_identity_entry_changed(GtkEntry *widget, gpointer data);
+gboolean wpa_eap_identity_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data);
+void wpa_eap_anon_identity_entry_changed(GtkEntry *widget, gpointer data);
+gboolean wpa_eap_anon_identity_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data);
+
+GtkWidget *get_wpa_enterprise_widget(WE_DATA *we_data)
+{
+ GtkWidget *main_widget = NULL;
+ GtkWidget *widget = NULL;
+ gint intValue;
+ gchar *strValue;
+
+ we_data->sub_xml = glade_xml_new(we_data->glade_file,
+ "wpa_eap_notebook", NULL);
+ if(we_data->sub_xml == NULL)
+ return NULL;
+
+ main_widget = glade_xml_get_widget(we_data->sub_xml, "wpa_eap_notebook");
+ if(main_widget != NULL)
+ g_object_ref(G_OBJECT(main_widget));
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "show_checkbutton");
+ g_signal_connect (G_OBJECT (widget), "toggled",
+ G_CALLBACK (wpa_eap_show_toggled), we_data);
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_eap_eap_method_combo");
+ intValue = eh_gconf_client_get_int(we_data, "wpa_eap_eap_method");
+ switch(intValue)
+ {
+ case NM_EAP_METHOD_MD5:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
+ break;
+ case NM_EAP_METHOD_MSCHAP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
+ break;
+ case NM_EAP_METHOD_OTP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 2);
+ break;
+ case NM_EAP_METHOD_GTC:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 3);
+ break;
+ default:
+ case NM_EAP_METHOD_PEAP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 4);
+ break;
+ case NM_EAP_METHOD_TLS:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 5);
+ break;
+ case NM_EAP_METHOD_TTLS:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 6);
+ break;
+ }
+ g_signal_connect( G_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC (wpa_eap_eap_method_changed), we_data);
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_eap_key_type_combo");
+ intValue = eh_gconf_client_get_int(we_data, "wpa_eap_key_type");
+ switch(intValue)
+ {
+ default:
+ case NM_AUTH_TYPE_WPA_PSK_AUTO:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
+ break;
+ case NM_AUTH_TYPE_WPA_PSK_TKIP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
+ break;
+ case NM_AUTH_TYPE_WPA_PSK_CCMP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 2);
+ break;
+ case NM_AUTH_TYPE_WPA_EAP:
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 3);
+ break;
+ }
+ g_signal_connect( G_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC (wpa_eap_key_type_changed), we_data);
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_eap_identity_entry");
+ strValue = eh_gconf_client_get_string(we_data, "wpa_eap_identity");
+ if(strValue != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), strValue);
+ g_free(strValue);
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ g_signal_connect( G_OBJECT(widget), "activate",
+ GTK_SIGNAL_FUNC (wpa_eap_identity_entry_changed), we_data);
+ g_signal_connect( G_OBJECT(widget), "focus-out-event",
+ GTK_SIGNAL_FUNC (wpa_eap_identity_entry_focus_lost),
+ we_data);
+
+ widget = glade_xml_get_widget(we_data->sub_xml,
+ "wpa_eap_anon_identity_entry");
+ strValue = eh_gconf_client_get_string(we_data, "wpa_eap_anon_identity");
+ if(strValue != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), strValue);
+ g_free(strValue);
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ g_signal_connect( G_OBJECT(widget), "activate",
+ GTK_SIGNAL_FUNC (wpa_eap_anon_identity_entry_changed),
+ we_data);
+ g_signal_connect( G_OBJECT(widget), "focus-out-event",
+ GTK_SIGNAL_FUNC (wpa_eap_anon_identity_entry_focus_lost),
+ we_data);
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml,
+ "wpa_eap_private_key_file_chooser_button");
+ strValue = eh_gconf_client_get_string(we_data, "wpa_eap_private_key_file");
+ if(strValue != NULL)
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(widget), strValue);
+ g_signal_connect( G_OBJECT(widget), "selection-changed",
+ GTK_SIGNAL_FUNC (wpa_eap_private_key_changed), we_data);
+
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml,
+ "wpa_eap_client_cert_file_chooser_button");
+ strValue = eh_gconf_client_get_string(we_data, "wpa_eap_client_cert_file");
+ if(strValue != NULL)
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(widget), strValue);
+ g_signal_connect( G_OBJECT(widget), "selection-changed",
+ GTK_SIGNAL_FUNC (wpa_eap_client_key_changed), we_data);
+
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml,
+ "wpa_eap_ca_cert_file_chooser_button");
+ strValue = eh_gconf_client_get_string(we_data, "wpa_eap_ca_cert_file");
+ if(strValue != NULL)
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(widget), strValue);
+ g_signal_connect( G_OBJECT(widget), "selection-changed",
+ GTK_SIGNAL_FUNC (wpa_eap_ca_key_changed), we_data);
+
+ return main_widget;
+}
+
+
+void wpa_eap_eap_method_changed(GtkWidget *combo, gpointer data)
+{
+ WE_DATA *we_data;
+ gint intValue;
+
+ we_data = data;
+
+ intValue = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ switch(intValue)
+ {
+ case 0:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_MD5);
+ break;
+ case 1:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_MSCHAP);
+ break;
+ case 2:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_OTP);
+ break;
+ case 3:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_GTC);
+ break;
+ default:
+ case 4:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_PEAP);
+ break;
+ case 5:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_TLS);
+ break;
+ case 6:
+ eh_gconf_client_set_int(we_data, "wpa_eap_eap_method",
+ NM_EAP_METHOD_TTLS);
+ break;
+
+ }
+}
+
+
+void wpa_eap_key_type_changed(GtkWidget *combo, gpointer data)
+{
+ WE_DATA *we_data;
+ gint intValue;
+
+ we_data = data;
+
+ intValue = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ switch(intValue)
+ {
+ default:
+ case 0:
+ eh_gconf_client_set_int(we_data, "wpa_eap_key_type",
+ NM_AUTH_TYPE_WPA_PSK_AUTO);
+ break;
+ case 1:
+ eh_gconf_client_set_int(we_data, "wpa_eap_key_type",
+ NM_AUTH_TYPE_WPA_PSK_TKIP);
+ break;
+ case 2:
+ eh_gconf_client_set_int(we_data, "wpa_eap_key_type",
+ NM_AUTH_TYPE_WPA_PSK_CCMP);
+ break;
+ case 3:
+ eh_gconf_client_set_int(we_data, "wpa_eap_key_type",
+ NM_AUTH_TYPE_WPA_EAP);
+ break;
+ }
+}
+
+
+void wpa_eap_private_key_changed(GtkWidget *button, gpointer data)
+{
+ WE_DATA *we_data;
+ gchar *strValue = NULL;
+
+ we_data = data;
+
+ strValue = gtk_file_chooser_get_filename(
+ GTK_FILE_CHOOSER(button));
+ if(strValue != NULL)
+ eh_gconf_client_set_string(we_data, "wpa_eap_private_key_file",
+ strValue);
+}
+
+
+void wpa_eap_client_key_changed(GtkWidget *button, gpointer data)
+{
+ WE_DATA *we_data;
+ gchar *strValue = NULL;
+
+ we_data = data;
+
+ strValue = gtk_file_chooser_get_filename(
+ GTK_FILE_CHOOSER(button));
+ if(strValue != NULL)
+ eh_gconf_client_set_string(we_data, "wpa_eap_client_cert_file",
+ strValue);
+}
+
+
+void wpa_eap_ca_key_changed(GtkWidget *button, gpointer data)
+{
+ WE_DATA *we_data;
+ gchar *strValue = NULL;
+
+ we_data = data;
+
+ strValue = gtk_file_chooser_get_filename(
+ GTK_FILE_CHOOSER(button));
+ if(strValue != NULL)
+ eh_gconf_client_set_string(we_data, "wpa_eap_ca_cert_file",
+ strValue);
+}
+
+void wpa_eap_show_toggled(GtkToggleButton *button, gpointer data)
+{
+ GtkWidget *widget;
+ WE_DATA *we_data;
+ gint32 sid;
+ gchar *key = NULL;
+ GnomeKeyringResult kresult;
+
+ we_data = data;
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_eap_passwd_entry");
+ if(gtk_toggle_button_get_active(button))
+ {
+ kresult = get_eap_key_from_keyring(we_data->essid_value, &key);
+ if (key != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), key);
+ g_free(key);
+ }
+ else
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+
+ gtk_widget_set_sensitive(widget, TRUE);
+ gtk_entry_set_editable(GTK_ENTRY(widget), TRUE);
+
+ sid = g_signal_connect( G_OBJECT(widget), "activate",
+ GTK_SIGNAL_FUNC (wpa_eap_password_entry_changed), we_data);
+ g_object_set_data(G_OBJECT(widget), "password_activate_sid",
+ GINT_TO_POINTER(sid));
+ sid = g_signal_connect( G_OBJECT(widget), "focus-out-event",
+ GTK_SIGNAL_FUNC (wpa_eap_password_entry_focus_lost),
+ we_data);
+ g_object_set_data(G_OBJECT(widget), "password_focus_out_sid",
+ GINT_TO_POINTER(sid));
+ }
+ else
+ {
+ gtk_widget_set_sensitive(widget, FALSE);
+ gtk_entry_set_editable(GTK_ENTRY(widget), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+
+ sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+ "password_activate_sid"));
+ g_signal_handler_disconnect(G_OBJECT(widget), sid);
+ sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+ "password_focus_out_sid"));
+ g_signal_handler_disconnect(G_OBJECT(widget), sid);
+ }
+
+
+ widget = glade_xml_get_widget(we_data->sub_xml,
+ "wpa_eap_private_key_passwd_entry");
+ if(gtk_toggle_button_get_active(button))
+ {
+ kresult = get_key_from_keyring(we_data->essid_value, &key);
+ if(key != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), key);
+ g_free(key);
+ }
+
+ gtk_widget_set_sensitive(widget, TRUE);
+ gtk_entry_set_editable(GTK_ENTRY(widget), TRUE);
+
+ sid = g_signal_connect( G_OBJECT(widget), "activate",
+ GTK_SIGNAL_FUNC (wpa_eap_priv_password_entry_changed),
+ we_data);
+ g_object_set_data(G_OBJECT(widget), "priv_password_activate_sid",
+ GINT_TO_POINTER(sid));
+ sid = g_signal_connect( G_OBJECT(widget), "focus-out-event",
+ GTK_SIGNAL_FUNC (wpa_eap_priv_password_entry_focus_lost),
+ we_data);
+ g_object_set_data(G_OBJECT(widget), "priv_password_focus_out_sid",
+ GINT_TO_POINTER(sid));
+ }
+ else
+ {
+ gtk_widget_set_sensitive(widget, FALSE);
+ gtk_entry_set_editable(GTK_ENTRY(widget), FALSE);
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+
+ sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+ "priv_password_activate_sid"));
+ g_signal_handler_disconnect(G_OBJECT(widget), sid);
+ sid = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(widget),
+ "priv_password_focus_out_sid"));
+ g_signal_handler_disconnect(G_OBJECT(widget), sid);
+ }
+
+}
+
+
+gboolean wpa_eap_password_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data)
+{
+ wpa_eap_password_entry_changed(GTK_ENTRY(widget), data);
+ return FALSE;
+}
+
+void wpa_eap_password_entry_changed(GtkEntry *password_entry, gpointer data)
+{
+ gchar *password;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ password = (gchar *)gtk_entry_get_text(password_entry);
+ if(password != NULL)
+ {
+ GnomeKeyringResult kresult;
+
+ kresult = set_eap_key_in_keyring (we_data->essid_value, password);
+ if(kresult != GNOME_KEYRING_RESULT_OK)
+ {
+ GtkWindow *parentWindow;
+
+ parentWindow = GTK_WINDOW(gtk_widget_get_ancestor(
+ GTK_WIDGET(password_entry), GTK_TYPE_WINDOW));
+
+ GtkWidget *errorDialog = gtk_message_dialog_new (parentWindow,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to set password"));
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (errorDialog),
+ _("There was a problem storing the private password in the gnome keyring. Error 0x%02X."),
+ (int)kresult);
+
+ gtk_dialog_run (GTK_DIALOG (errorDialog));
+ gtk_widget_destroy (errorDialog);
+ }
+ }
+}
+
+
+gboolean wpa_eap_priv_password_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data)
+{
+ wpa_eap_priv_password_entry_changed(GTK_ENTRY(widget), data);
+ return FALSE;
+}
+
+void wpa_eap_priv_password_entry_changed(GtkEntry *pass_entry, gpointer data)
+{
+ gchar *password;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ password = (gchar *)gtk_entry_get_text(pass_entry);
+ if(password != NULL)
+ {
+ GnomeKeyringResult kresult;
+
+ kresult = set_key_in_keyring (we_data->essid_value, password);
+ if(kresult != GNOME_KEYRING_RESULT_OK)
+ {
+ GtkWindow *parentWindow;
+
+ parentWindow = GTK_WINDOW(gtk_widget_get_ancestor(
+ GTK_WIDGET(pass_entry), GTK_TYPE_WINDOW));
+
+ GtkWidget *errorDialog = gtk_message_dialog_new (parentWindow,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to set password"));
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (errorDialog),
+ _("There was a problem storing the private password in the gnome keyring. Error 0x%02X."),
+ (int)kresult);
+
+ gtk_dialog_run (GTK_DIALOG (errorDialog));
+ gtk_widget_destroy (errorDialog);
+ }
+ }
+}
+
+gboolean wpa_eap_identity_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data)
+{
+ wpa_eap_identity_entry_changed(GTK_ENTRY(widget), data);
+ return FALSE;
+}
+
+void wpa_eap_identity_entry_changed(GtkEntry *widget, gpointer data)
+{
+ gchar *strValue;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ strValue = (gchar *)gtk_entry_get_text(widget);
+ if(strValue != NULL)
+ eh_gconf_client_set_string(we_data, "wpa_eap_identity", strValue);
+}
+
+gboolean wpa_eap_anon_identity_entry_focus_lost(GtkWidget *widget,
+ GdkEventFocus *event, gpointer data)
+{
+ wpa_eap_anon_identity_entry_changed(GTK_ENTRY(widget), data);
+ return FALSE;
+}
+
+void wpa_eap_anon_identity_entry_changed(GtkEntry *widget, gpointer data)
+{
+ gchar *strValue;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ strValue = (gchar *)gtk_entry_get_text(widget);
+ if(strValue != NULL)
+ eh_gconf_client_set_string(we_data, "wpa_eap_anon_identity", strValue);
+}
+
Added: branches/network-manager-applet-0-6/editor/widget-wso-wpa-personal.c
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/widget-wso-wpa-personal.c Wed Jan 30 21:45:28 2008
@@ -0,0 +1,206 @@
+/* Wireless Security Option WPA/WPA2 Personal Widget
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <libgnomeui/libgnomeui.h>
+#include <libgnome/libgnome.h>
+
+#if !GTK_CHECK_VERSION(2,6,0)
+#include <gnome.h>
+#endif
+
+#include <glade/glade.h>
+#include <gconf/gconf-client.h>
+#include <NetworkManager.h>
+
+#include "widget-wso.h"
+
+void wpa_psk_type_changed(GtkWidget *combo, gpointer data);
+void wpa_psk_show_toggled(GtkToggleButton *button, gpointer data);
+void wpa_psk_set_password_button_clicked_cb(GtkButton *button,
+ gpointer user_data);
+
+GtkWidget *get_wpa_personal_widget(WE_DATA *we_data)
+{
+ GtkWidget *main_widget = NULL;
+ GtkWidget *widget = NULL;
+ gint intValue;
+
+ we_data->sub_xml = glade_xml_new(we_data->glade_file,
+ "wpa_psk_notebook", NULL);
+ if(we_data->sub_xml == NULL)
+ return NULL;
+
+ main_widget = glade_xml_get_widget(we_data->sub_xml, "wpa_psk_notebook");
+ if(main_widget != NULL)
+ g_object_ref(G_OBJECT(main_widget));
+
+ // set the combo to match what is in gconf
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "show_checkbutton");
+ g_signal_connect (G_OBJECT (widget), "toggled",
+ G_CALLBACK (wpa_psk_show_toggled), we_data);
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_psk_type_combo");
+ intValue = eh_gconf_client_get_int(we_data, "we_cipher");
+ if (intValue == IW_AUTH_CIPHER_CCMP)
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
+ else if (intValue == IW_AUTH_CIPHER_TKIP)
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 2);
+ else // set to auto
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
+
+ g_signal_connect( G_OBJECT(widget), "changed",
+ GTK_SIGNAL_FUNC (wpa_psk_type_changed), we_data);
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_psk_set_password");
+ g_signal_connect (G_OBJECT (widget), "clicked",
+ G_CALLBACK (wpa_psk_set_password_button_clicked_cb),
+ we_data);
+
+ return main_widget;
+}
+
+
+void wpa_psk_type_changed(GtkWidget *combo, gpointer data)
+{
+ WE_DATA *we_data;
+ gint intValue;
+
+ we_data = data;
+
+ intValue = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ if(intValue == 1)
+ eh_gconf_client_set_int(we_data, "we_cipher", IW_AUTH_CIPHER_CCMP);
+ else if(intValue == 2)
+ eh_gconf_client_set_int(we_data, "we_cipher", IW_AUTH_CIPHER_TKIP);
+ else
+ eh_gconf_client_set_int(we_data, "we_cipher", 0);
+}
+
+
+
+void wpa_psk_show_toggled(GtkToggleButton *button, gpointer data)
+{
+ GtkWidget *widget;
+ WE_DATA *we_data;
+
+ we_data = data;
+
+ widget = glade_xml_get_widget(we_data->sub_xml, "wpa_psk_entry");
+
+ if(gtk_toggle_button_get_active(button))
+ {
+ gchar *key;
+ GnomeKeyringResult kresult;
+
+ kresult = get_key_from_keyring(we_data->essid_value, &key);
+ if(kresult == GNOME_KEYRING_RESULT_OK ||
+ kresult == GNOME_KEYRING_RESULT_NO_SUCH_KEYRING)
+ {
+ gtk_widget_set_sensitive(widget, TRUE);
+
+ if(key != NULL)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), key);
+ g_free(key);
+ }
+ }
+ else
+ gtk_toggle_button_set_active(button, FALSE);
+
+ if(kresult == GNOME_KEYRING_RESULT_DENIED)
+ {
+ gtk_entry_set_text(GTK_ENTRY(widget), _("Unable to read key"));
+ }
+ }
+ else
+ {
+ gtk_widget_set_sensitive(widget, FALSE);
+ gtk_entry_set_text(GTK_ENTRY(widget), "");
+ }
+}
+
+
+void wpa_psk_set_password_button_clicked_cb(GtkButton *button,
+ gpointer user_data)
+{
+ GladeXML *glade_xml;
+ GtkWidget *dialog;
+ GtkWidget *keyEntry;
+ WE_DATA *we_data;
+ GtkWindow *parentWindow;
+
+ we_data = user_data;
+
+ glade_xml = glade_xml_new(we_data->glade_file,
+ "set_password_dialog", NULL);
+
+ dialog = glade_xml_get_widget (glade_xml, "set_password_dialog");
+
+ keyEntry = glade_xml_get_widget (glade_xml, "password_entry");
+
+ parentWindow = GTK_WINDOW(gtk_widget_get_ancestor(
+ GTK_WIDGET(button), GTK_TYPE_WINDOW));
+
+ gtk_window_set_transient_for(GTK_WINDOW(dialog), parentWindow);
+
+ gint result = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ if(result == GTK_RESPONSE_OK)
+ {
+ const gchar *key;
+ GnomeKeyringResult kresult;
+
+ key = gtk_entry_get_text(GTK_ENTRY(keyEntry));
+
+ if(key != NULL)
+ {
+ kresult = set_key_in_keyring (we_data->essid_value, key);
+
+ if(kresult != GNOME_KEYRING_RESULT_OK)
+ {
+ GtkWidget *errorDialog = gtk_message_dialog_new (parentWindow,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ _("Unable to set password"));
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (errorDialog),
+ _("There was a problem storing the password in the gnome keyring. Error 0x%02X."),
+ (int)kresult);
+
+ gtk_dialog_run (GTK_DIALOG (errorDialog));
+ gtk_widget_destroy (errorDialog);
+ }
+ }
+ }
+
+ gtk_widget_destroy(dialog);
+ g_free(glade_xml);
+}
+
Added: branches/network-manager-applet-0-6/editor/widget-wso.h
==============================================================================
--- (empty file)
+++ branches/network-manager-applet-0-6/editor/widget-wso.h Wed Jan 30 21:45:28 2008
@@ -0,0 +1,38 @@
+/* NetworkManager Wireless Widgets -- Code for WSO Widgets
+ *
+ * Calvin Gaisford <cgaisford novell 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 2006 Novell, Inc.
+ */
+
+#ifndef WIDGET_WSO_H
+#define WIDGET_WSO_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "editor-app.h"
+#include "editor-keyring-helper.h"
+#include "editor-gconf-helper.h"
+
+GtkWidget *get_wep_widget(WE_DATA *we_data);
+GtkWidget *get_wpa_personal_widget(WE_DATA *we_data);
+GtkWidget *get_wpa_enterprise_widget(WE_DATA *we_data);
+
+
+#endif // WIDGET_WSO_H
Modified: branches/network-manager-applet-0-6/po/POTFILES.in
==============================================================================
--- branches/network-manager-applet-0-6/po/POTFILES.in (original)
+++ branches/network-manager-applet-0-6/po/POTFILES.in Wed Jan 30 21:45:28 2008
@@ -21,3 +21,11 @@
src/wso-wep-passphrase.c
src/wso-wpa-eap.c
src/wso-wpa-psk.c
+editor/bssid-editor-dialog.c
+editor/editor-app.c
+editor/editor-gconf-helper.c
+editor/editor-keyring-helper.c
+editor/widget-wso-wep.c
+editor/widget-wso-wpa-enterprise.c
+editor/widget-wso-wpa-personal.c
+editor/editor.glade
Modified: branches/network-manager-applet-0-6/src/applet.c
==============================================================================
--- branches/network-manager-applet-0-6/src/applet.c (original)
+++ branches/network-manager-applet-0-6/src/applet.c Wed Jan 30 21:45:28 2008
@@ -1601,6 +1601,28 @@
}
+static void edit_essid_items_selected (GtkWidget *menu_item, NMApplet *applet)
+{
+ g_spawn_command_line_async ("nm-editor", NULL);
+}
+
+
+static void nma_menu_add_edit_essid_item (GtkWidget *menu, NMApplet *applet)
+{
+ GtkWidget *menu_item;
+ GtkWidget *label;
+
+ menu_item = gtk_menu_item_new ();
+ label = gtk_label_new_with_mnemonic (_("_Edit Wireless Networks..."));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_container_add (GTK_CONTAINER (menu_item), label);
+ gtk_widget_show_all (menu_item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+ g_signal_connect (menu_item, "activate", G_CALLBACK (edit_essid_items_selected), applet);
+}
+
+
+
static void new_network_item_selected (GtkWidget *menu_item, NMApplet *applet)
{
nma_other_network_dialog_run (applet, TRUE);
@@ -2005,6 +2027,7 @@
nma_menu_add_separator_item (menu);
nma_menu_add_custom_essid_item (menu, applet);
nma_menu_add_create_network_item (menu, applet);
+ nma_menu_add_edit_essid_item (menu, applet);
}
Modified: branches/network-manager-applet-0-6/src/main.c
==============================================================================
--- branches/network-manager-applet-0-6/src/main.c (original)
+++ branches/network-manager-applet-0-6/src/main.c Wed Jan 30 21:45:28 2008
@@ -31,6 +31,7 @@
#include <glib/gi18n-lib.h>
#include "applet.h"
+#include "applet-dbus.h"
#include "applet-dbus-vpn.h"
static void session_die (GnomeClient *client, gpointer client_data)
Modified: branches/network-manager-applet-0-6/src/wso-wep-ascii.c
==============================================================================
--- branches/network-manager-applet-0-6/src/wso-wep-ascii.c (original)
+++ branches/network-manager-applet-0-6/src/wso-wep-ascii.c Wed Jan 30 21:45:28 2008
@@ -109,7 +109,7 @@
entry = glade_xml_get_widget (opt->uixml, opt->data->entry_name);
gtk_entry_set_max_length (GTK_ENTRY (entry), 13);
g_signal_connect (G_OBJECT (entry), "changed", validate_cb, user_data);
- g_signal_connect (G_OBJECT (entry), "insert-text", entry_filter_cb, user_data);
+ g_signal_connect (G_OBJECT (entry), "insert-text", G_CALLBACK (entry_filter_cb), user_data);
checkbutton = glade_xml_get_widget (opt->uixml, opt->data->show_checkbutton_name);
g_signal_connect (G_OBJECT (checkbutton), "toggled", GTK_SIGNAL_FUNC (show_key_cb), GTK_ENTRY (entry));
Modified: branches/network-manager-applet-0-6/src/wso-wep-hex.c
==============================================================================
--- branches/network-manager-applet-0-6/src/wso-wep-hex.c (original)
+++ branches/network-manager-applet-0-6/src/wso-wep-hex.c Wed Jan 30 21:45:28 2008
@@ -107,7 +107,7 @@
entry = glade_xml_get_widget (opt->uixml, opt->data->entry_name);
gtk_entry_set_max_length (GTK_ENTRY (entry), 26);
g_signal_connect (G_OBJECT (entry), "changed", validate_cb, user_data);
- g_signal_connect (G_OBJECT (entry), "insert-text", entry_filter_cb, user_data);
+ g_signal_connect (G_OBJECT (entry), "insert-text", G_CALLBACK (entry_filter_cb), user_data);
checkbutton = glade_xml_get_widget (opt->uixml, opt->data->show_checkbutton_name);
g_signal_connect (G_OBJECT (checkbutton), "toggled", GTK_SIGNAL_FUNC (show_key_cb), GTK_ENTRY (entry));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]