diff options
| -rw-r--r-- | hardinfo2/arch/linux/common/net.h | 30 | ||||
| -rw-r--r-- | hardinfo2/callbacks.c | 2 | ||||
| -rw-r--r-- | hardinfo2/computer.c | 1 | ||||
| -rw-r--r-- | hardinfo2/pixmaps/report-large.png | bin | 0 -> 3071 bytes | |||
| -rw-r--r-- | hardinfo2/report.c | 15 | ||||
| -rw-r--r-- | hardinfo2/shell.c | 11 | 
6 files changed, 47 insertions, 12 deletions
| diff --git a/hardinfo2/arch/linux/common/net.h b/hardinfo2/arch/linux/common/net.h index 1d2e20ea..cd8b8706 100644 --- a/hardinfo2/arch/linux/common/net.h +++ b/hardinfo2/arch/linux/common/net.h @@ -40,6 +40,7 @@ struct _NetInfo {      unsigned char mac[8];      char ip[16];      char mask[16]; +    char broadcast[16];  };  void get_net_info(char *if_name, NetInfo *netinfo) @@ -84,6 +85,15 @@ void get_net_info(char *if_name, NetInfo *netinfo)      } else {          sprintf(netinfo->mask, "%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));      } + +    /* Broadcast Address */ +    strcpy(ifr.ifr_name, if_name); +    if (ioctl(fd, SIOCGIFBRDADDR, &ifr) < 0) { +        netinfo->broadcast[0] = 0; +    } else { +        sprintf(netinfo->broadcast, "%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr)); +    } +      shutdown(fd, 0);  } @@ -205,8 +215,9 @@ scan_net_interfaces_24(void)              detailed = g_strdup_printf("[Network Adapter Properties]\n"                                          "Interface Type=%s\n" -                                        "Hardware Address=%02x:%02x:%02x:%02x:%02x:%02x\n" +                                        "Hardware Address (MAC)=%02x:%02x:%02x:%02x:%02x:%02x\n"                                          "MTU=%d\n" +                                        "[Transfer Details]\n"                                          "Bytes Received=%ld (%.2fMiB)\n"                                          "Bytes Sent=%ld (%.2fMiB)\n",                                          net_get_iface_type(ifacename), @@ -216,12 +227,17 @@ scan_net_interfaces_24(void)                                          ni.mtu,                                          recv_bytes, recv_mb,                                          trans_bytes, trans_mb); -            if (ni.ip[0]) { -                 detailed = g_strconcat(detailed, "IP=", ni.ip, "\n", NULL); -            } -               -            if (ni.mask[0]) { -                 detailed = g_strconcat(detailed, "Mask=", ni.mask, "\n", NULL); +                                         +            if (ni.ip[0] || ni.mask[0] || ni.broadcast[0]) { +                 detailed = g_strdup_printf("%s\n" +                                            "[Internet Protocol (IPv4)]\n" +                                            "IP Address=%s\n" +                                            "Mask=%s\n" +                                            "Broadcast Address=%s\n", +                                            detailed, +                                            ni.ip[0]        ? ni.ip        : "Not set", +                                            ni.mask[0]      ? ni.mask      : "Not set", +                                            ni.broadcast[0] ? ni.broadcast : "Not set");              }              g_hash_table_insert(moreinfo, devid, detailed); diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index 8141a426..bd69e07d 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -70,7 +70,7 @@ void cb_open_web_page()  void cb_open_online_docs()  { -    open_url("http://hardinfo.berlios.de/wiki/Documentation"); +    open_url("http://hardinfo.berlios.de/web/Documentation");  }  void cb_report_bug() diff --git a/hardinfo2/computer.c b/hardinfo2/computer.c index d6508aca..817282c0 100644 --- a/hardinfo2/computer.c +++ b/hardinfo2/computer.c @@ -374,7 +374,6 @@ hi_exported_methods(void)      return m;  } -  ModuleEntry *  hi_module_get_entries(void)  { diff --git a/hardinfo2/pixmaps/report-large.png b/hardinfo2/pixmaps/report-large.pngBinary files differ new file mode 100644 index 00000000..1cc693f5 --- /dev/null +++ b/hardinfo2/pixmaps/report-large.png diff --git a/hardinfo2/report.c b/hardinfo2/report.c index 492d35fd..ecd0af3a 100644 --- a/hardinfo2/report.c +++ b/hardinfo2/report.c @@ -20,6 +20,7 @@  #include <stdio.h>  #include <string.h>  #include <shell.h> +#include <iconcache.h>  #include <hardinfo.h>  #include <config.h> @@ -630,10 +631,11 @@ static ReportDialog      GtkWidget *button8;      GtkWidget *button7;      GtkWidget *label; +    GtkWidget *hbox;      GtkTreeViewColumn *column;      GtkCellRenderer *cr_text, *cr_pbuf, *cr_toggle;  - +          rd = g_new0(ReportDialog, 1);      dialog = gtk_dialog_new(); @@ -650,14 +652,21 @@ static ReportDialog      gtk_container_set_border_width(GTK_CONTAINER(dialog1_vbox), 4);      gtk_widget_show(dialog1_vbox); +    hbox = gtk_hbox_new(FALSE, 5); +    gtk_box_pack_start(GTK_BOX(dialog1_vbox), hbox, FALSE, FALSE, 0); +          label = gtk_label_new("<big><b>Generate Report</b></big>\n" \                            "Please choose the information that you wish " \                            "to view in your report:");      gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);      gtk_label_set_use_markup(GTK_LABEL(label), TRUE);      gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); -    gtk_widget_show(label); -    gtk_box_pack_start(GTK_BOX(dialog1_vbox), label, FALSE, FALSE, 0); +     +    gtk_box_pack_start(GTK_BOX(hbox), +                       icon_cache_get_image("report-large.png"), +                       FALSE, FALSE, 0); +    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); +    gtk_widget_show_all(hbox);      scrolledwindow2 = gtk_scrolled_window_new(NULL, NULL);      gtk_widget_show(scrolledwindow2); diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c index ad626ffa..3768d1fd 100644 --- a/hardinfo2/shell.c +++ b/hardinfo2/shell.c @@ -603,6 +603,17 @@ static gboolean update_field(gpointer data)          return TRUE;      } +    if (update_sfusrc) { +        GSList *sfu; +         +        for (sfu = update_sfusrc; sfu; sfu = sfu->next) { +            g_free(sfu->data); +        } +         +        g_slist_free(update_sfusrc); +        update_sfusrc = NULL; +    } +          DEBUG("destroying ShellFieldUpdate for field %s", fu->field_name);      /* otherwise, cleanup and destroy the timeout */ | 
