/* Finger callbacks */ void on_finger_activate (GtkWidget * widget, gpointer data) { Netinfo *finger = data; GtkEntry *entry_host; gchar *text; g_return_if_fail (finger != NULL); if (finger->running) { finger_stop (finger); } else { entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (finger->host))); text = g_strdup (gtk_entry_get_text (entry_host)); g_strstrip (text); if (strlen(text) > 0) gn_combo_history_add (finger->history, text); g_free (text); entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (finger->user))); text = g_strdup (gtk_entry_get_text (entry_host)); g_strstrip (text); if (strlen(text) > 0) gn_combo_history_add (finger->history_user, text); g_free (text); finger_do (finger); } }
/* Traceroute callbacks */ void on_traceroute_activate (GtkWidget * widget, gpointer data) { Netinfo *tracer = data; GtkEntry *entry_host; gchar *text; g_return_if_fail (tracer != NULL); if (tracer->running) { traceroute_stop (tracer); } else { if (netinfo_validate_host (tracer)) { entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (tracer->host))); text = g_strdup (gtk_entry_get_text (entry_host)); gn_combo_history_add (tracer->history, text); g_free (text); traceroute_do (tracer); } } }
/* Whois callbacks */ void on_whois_activate (GtkWidget * widget, gpointer data) { Netinfo *whois = data; GtkEntry *entry_host; gchar *text; g_return_if_fail (whois != NULL); if (whois->running) { whois_stop (whois); } else { if (netinfo_validate_domain (whois)) { entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (whois->host))); text = g_strdup (gtk_entry_get_text (entry_host)); gn_combo_history_add (whois->history, text); g_free (text); whois_do (whois); } } }
/* Lookup callbacks */ void on_lookup_activate (GtkWidget * widget, gpointer data) { Netinfo *lookup = data; GtkEntry *entry_host; gchar *text; g_return_if_fail (lookup != NULL); if (lookup->running) { lookup_stop (lookup); } else { if (netinfo_validate_domain (lookup)) { entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (lookup->host))); text = g_strdup (gtk_entry_get_text (entry_host)); gn_combo_history_add (lookup->history, text); g_free (text); lookup_do (lookup); } } }
/* Scan callbacks */ void on_scan_activate (GtkWidget * widget, gpointer data) { Netinfo *scan = data; GtkEntry *entry_host; gchar *text; g_return_if_fail (scan != NULL); if (scan->running) { scan_stop (scan); } else { if (netinfo_validate_host (scan)) { entry_host = GTK_ENTRY ( gtk_bin_get_child (GTK_BIN (scan->host))); text = g_strdup (gtk_entry_get_text (entry_host)); gn_combo_history_add (scan->history, text); g_free (text); scan_do (scan); } } }
void netinfo_set_host (Netinfo * netinfo, const gchar *host) { g_return_if_fail (netinfo != NULL); g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history)); gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history), host); }
void netinfo_set_user (Netinfo * netinfo, const gchar *user) { g_return_if_fail (netinfo != NULL); g_return_if_fail (GN_IS_COMBO_HISTORY (netinfo->history_user)); gn_combo_history_add (GN_COMBO_HISTORY (netinfo->history_user), user); }