|
|
| version 1.1.1.2, 2021/03/17 00:07:30 | version 1.1.1.3, 2023/09/27 11:18:58 |
|---|---|
| Line 4 | Line 4 |
| Changes/additions Copyright (C) 1998 R.E.Wolff@BitWizard.nl | Changes/additions Copyright (C) 1998 R.E.Wolff@BitWizard.nl |
| This program is free software; you can redistribute it and/or modify | This program is free software; you can redistribute it and/or modify |
| it under the terms of the GNU General Public License version 2 as | it under the terms of the GNU General Public License version 2 as |
| published by the Free Software Foundation. | published by the Free Software Foundation. |
| This program is distributed in the hope that it will be useful, | This program is distributed in the hope that it will be useful, |
| Line 94 int gtk_detect( | Line 94 int gtk_detect( |
| { | { |
| if (getenv("DISPLAY") != NULL) { | if (getenv("DISPLAY") != NULL) { |
| /* If we do this here, gtk_init exits on an error. This happens | /* If we do this here, gtk_init exits on an error. This happens |
| BEFORE the user has had a chance to tell us not to use the | BEFORE the user has had a chance to tell us not to use the |
| display... */ | display... */ |
| return TRUE; | return TRUE; |
| } else { | } else { |
| Line 244 static gint Host_activate( | Line 244 static gint Host_activate( |
| gpointer data) | gpointer data) |
| { | { |
| struct mtr_ctl *ctl = (struct mtr_ctl *) data; | struct mtr_ctl *ctl = (struct mtr_ctl *) data; |
| struct hostent *addr; | struct addrinfo *res = NULL; |
| addr = dns_forward(gtk_entry_get_text(GTK_ENTRY(entry))); | ctl->af = DEFAULT_AF; // should this obey the cmd line option? |
| if (addr) { | ctl->Hostname = gtk_entry_get_text(GTK_ENTRY(entry)); |
| net_reopen(ctl, addr); | if (get_addrinfo_from_name(ctl, &res, ctl->Hostname) == 0) { |
| net_reopen(ctl, res); | |
| freeaddrinfo(res); | |
| net_send_batch(ctl); | |
| /* If we are "Paused" at this point it is usually because someone | /* If we are "Paused" at this point it is usually because someone |
| entered a non-existing host. Therefore do the go-ahead... */ | entered a non-existing host. Therefore do the go-ahead... */ |
| gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Pause_Button), 0); | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Pause_Button), 0); |
| Line 511 static void update_tree_row( | Line 514 static void update_tree_row( |
| if ((name = dns_lookup(ctl, addr))) { | if ((name = dns_lookup(ctl, addr))) { |
| if (ctl->show_ips) { | if (ctl->show_ips) { |
| snprintf(str, sizeof(str), "%s (%s)", name, | snprintf(str, sizeof(str), "%s (%s)", name, |
| strlongip(ctl, addr)); | strlongip(ctl->af, addr)); |
| name = str; | name = str; |
| } | } |
| } else | } else |
| name = strlongip(ctl, addr); | name = strlongip(ctl->af, addr); |
| } | } |
| gtk_list_store_set(ReportStore, iter, | gtk_list_store_set(ReportStore, iter, |
| Line 565 void gtk_redraw( | Line 568 void gtk_redraw( |
| } | } |
| // GTK 3 has changed the interface a bit. Here a few defines so that we can | // GTK 3 has changed the interface a bit. Here a few defines so that we can |
| // work with GTK2 or GTK3 as required. | // work with GTK2 or GTK3 as required. |
| #ifdef HAVE_GTK3 | #ifdef HAVE_GTK3 |
| #define gtk_vbox_new_(orientation,sz) gtk_box_new(orientation, sz) | #define gtk_vbox_new_(orientation,sz) gtk_box_new(orientation, sz) |
| #define gtk_hbox_new_(orientation,sz) gtk_box_new(orientation, sz) | #define gtk_hbox_new_(orientation,sz) gtk_box_new(orientation, sz) |