Commit 415d4b7c authored by William Jon McCann's avatar William Jon McCann Committed by William Jon McCann

Fix to work with GtkComboBox. Fixes #154070.

2004-11-15  William Jon McCann  <mccann@jhu.edu>

        * src/nettool.c (netinfo_set_user, netinfo_set_host):
        * src/info.c (info_set_nic): Fix to work with GtkComboBox.
        Fixes #154070.

        * src/gn-combo-history.c (gn_on_gconf_history_changed): Don't unset the
        active item when gconf changes.
parent 88a972e8
2004-11-15 William Jon McCann <mccann@jhu.edu>
* src/nettool.c (netinfo_set_user, netinfo_set_host):
* src/info.c (info_set_nic): Fix to work with GtkComboBox.
Fixes #154070.
* src/gn-combo-history.c (gn_on_gconf_history_changed): Don't unset the
active item when gconf changes.
2004-11-03 German Poo-Caamao <gpoo@ubiobio.cl>
* pixmaps/network.png: Resized of network icon to 16x16.
......
This diff is collapsed.
......@@ -73,23 +73,32 @@ info_do (const gchar * nic, Netinfo * info)
void
info_set_nic (Netinfo * netinfo, const gchar *nic)
{
GList *interfaces = NULL, *p;
GtkTreeModel *model;
GtkTreeIter iter;
g_return_if_fail (netinfo != NULL);
if (nic == NULL)
return;
interfaces = info_get_interfaces (netinfo);
for (p = interfaces; p != NULL; p = p->next) {
if (! strcmp (p->data, nic)) {
/* FIXME */
gtk_entry_set_text (GTK_ENTRY (netinfo->nic),
nic);
}
model = gtk_combo_box_get_model (GTK_COMBO_BOX (netinfo->combo));
if (!gtk_tree_model_get_iter_first (model, &iter)) {
g_warning ("No network devices found.");
return;
}
g_list_free (interfaces);
do {
char *text = NULL;
gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, 2, &text, -1);
if (!text)
continue;
if (strcmp (text, nic) == 0) {
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (netinfo->combo), &iter);
return;
}
} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (model), &iter));
}
static void
......
......@@ -67,13 +67,9 @@ void
netinfo_set_host (Netinfo * netinfo, const gchar *host)
{
g_return_if_fail (netinfo != NULL);
g_return_if_fail (GTK_IS_ENTRY
(gtk_bin_get_child
(GTK_BIN (netinfo->host))));
gtk_entry_set_text (GTK_ENTRY
(gtk_bin_get_child
(GTK_BIN (netinfo->host))), host);
g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history));
gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history), host);
}
gboolean
......@@ -115,13 +111,9 @@ void
netinfo_set_user (Netinfo * netinfo, const gchar *user)
{
g_return_if_fail (netinfo != NULL);
g_return_if_fail (GTK_IS_ENTRY
(gnome_entry_gtk_entry
(GNOME_ENTRY (netinfo->user))));
gtk_entry_set_text (GTK_ENTRY
(gnome_entry_gtk_entry
(GNOME_ENTRY (netinfo->user))), user);
g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history_user));
gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history_user), user);
}
gint
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment