NetworkManager/info-daemon/NetworkManagerInfoNetworksDialog.c
Colin Walters 6871fe28bc 2004-08-29 Colin Walters <walters@verbum.org>
* test/nminfotest.c: Include string.h and stdlib.h.
	(get_network_string_property, get_networks_of_type): Return NULL.

	* test/nmclienttest.c (get_device_name, get_active_device): Return
	NULL.

	* src/backends/NetworkManagerRedHat.c (nm_system_device_stop_dhcp): Just
	use strlen, fgets always NULL-terminates the string.

	* src/NetworkManagerDbus.c (nm_dbus_nmi_filter,
	dbus_message_get_member): Remove /* in comment.

	* src/NetworkManagerUtils.c (LOCKING_DEBUG): Ditto.

	* src/NetworkManager.c (quit): Unused, delete.
	(nm_data_free): Cast arg to GFunc.

	* panel-applet/NMWirelessAppletDbus.c: Need to include
	string.h, and dbus-glib-lowlevel.h (the latter is needed
	for dbus_connection_setup_with_g_main at present).
	(nmwa_dbus_update_wireless_network_list): Parenthesize
	assignment in conditional.
	(nmwa_dbus_worker): Return NULL.

	* panel-applet/NMWirelessApplet.c (nmwa_redraw)
	(nmwa_get_menu_pos, nmwa_toplevel_menu_activate)
	(nmwa_menu_add_text_item, nmwa_setup_widgets): Kill unused variables.
	(nmwa_populate_menu): Return NULL on failure, instead of just
	return;

	* initscript/NMLaunchHelper.c (g_timeout_add): Cast arg to GSourceFunc.

	* info-daemon/NetworkManagerInfoNetworksDialog.c (nmi_networks_dialog_init): Kill unused
	variables.

	* info-daemon/NetworkManagerInfo.c (nmi_print_usage): Unused,
	delete.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@105 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2004-08-29 06:06:51 +00:00

86 lines
3.1 KiB
C

/* NetworkManagerInfo -- Manage allowed access points and provide a UI
* for WEP key entry
*
* Dan Williams <dcbw@redhat.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* (C) Copyright 2004 Red Hat, Inc.
*/
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include "NetworkManagerInfo.h"
#include "NetworkManagerInfoNetworksDialog.h"
/*
* nmi_networks_dialog_init
*
* Initialize the networks modification dialog
*
* Returns: 0 on success
* -1 on failure
*/
int nmi_networks_dialog_init (NMIAppInfo *info)
{
GtkWidget *dialog;
info->networks_dialog = glade_xml_new(GLADEDIR"/networks.glade", NULL, NULL);
if (!info->networks_dialog)
{
fprintf (stderr, "Could not open the networks dialog glade file!\n");
return (-1);
}
dialog = glade_xml_get_widget (info->networks_dialog, "networks_dialog");
gtk_widget_hide (dialog);
#if 0
save_button = GTK_BUTTON (glade_xml_get_widget (info->networks_dialog, "save_button"));
g_signal_connect (G_OBJECT (save_button), "clicked", GTK_SIGNAL_FUNC (nmi_networks_dialog_save_clicked), info);
cancel_button = GTK_BUTTON (glade_xml_get_widget (info->networks_dialog, "cancel_button"));
g_signal_connect (G_OBJECT (cancel_button), "clicked", GTK_SIGNAL_FUNC (nmi_networks_dialog_cancel_clicked), info);
/* Create data store for our networks list */
info->networks_list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN);
if (!info->networks_list_store)
return (-1);
/* Tell the list to use our data store */
list_view = glade_xml_get_widget (info->networks_dialog, "networks_list");
gtk_tree_view_set_model (GTK_TREE_VIEW (list_view), GTK_TREE_MODEL (info->networks_list_store));
/* Set up the columns and renderers for our list */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (column, TRUE);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer, "markup", TEXT_COLUMN, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (list_view), column);
info->padlock_pixbuf = gdk_pixbuf_new_from_file_at_size (GLADEDIR"/keyring.png", 16, 16, &error);
if (!info->padlock_pixbuf)
fprintf (stderr, "nmi_new_networks_dialog_init(): could not load padlock image\n");
#endif
return (0);
}