diff options
author | Agney Lopes Roth Ferraz <agney@users.sourceforge.net> | 2005-06-13 18:34:20 -0300 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:31 -0500 |
commit | 61dfceab1e3e9d77aa2900a6e333961f89c4ef45 (patch) | |
tree | 673b0f2f59b4b9ed4c2595a5690aa63480190103 /scsi.c | |
parent | 7d65a12d6431f72e601ea1d0c3ef5d09af8bfb96 (diff) | |
parent | a08438bda21b3e0d7db2db2360d040841970104d (diff) |
Import Debian changes 0.3.7pre-1
hardinfo (0.3.7pre-1) unstable; urgency=low
* New upstream release. (Closes: #280694, #300114, #233033)
Diffstat (limited to 'scsi.c')
-rw-r--r-- | scsi.c | 80 |
1 files changed, 14 insertions, 66 deletions
@@ -1,13 +1,9 @@ /* * Hardware Information, version 0.3 * Copyright (C) 2003 Leandro Pereira <leandro@linuxmag.com.br> + * SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> * * May be modified and/or distributed under the terms of GNU GPL version 2. - * - */ - -/* - * SCSI support by Pascal F.Martin <pascalmartin@earthlink.net> */ #include "hardinfo.h" @@ -18,7 +14,7 @@ SCSIDevice *hi_scan_scsi(void) FILE *proc_scsi; gchar buffer[256], *buf; gint n=0; - SCSIDevice *scsi_dev, *scsi; + SCSIDevice *scsi_dev = NULL, *scsi; struct stat st; scsi = NULL; @@ -117,11 +113,7 @@ void hi_show_scsi_info(MainWindow *mainwindow, SCSIDevice *device) }; int i; - GtkWidget *hbox, *vbox, *label; gchar *buf; -#ifdef GTK2 - GtkWidget *pixmap; -#endif if(!device) return; @@ -129,69 +121,25 @@ void hi_show_scsi_info(MainWindow *mainwindow, SCSIDevice *device) if (!strcmp(device->type, type2icon[i].type)) break; } -#ifdef GTK2 buf = g_strdup_printf("%s%s", IMG_PREFIX, type2icon[i].icon); - pixmap = gtk_image_new_from_file(buf); - gtk_widget_show(pixmap); - + detail_window_set_icon(mainwindow->det_window, buf); g_free(buf); -#endif - hbox = gtk_hbox_new(FALSE, 2); - gtk_container_set_border_width(GTK_CONTAINER(hbox), 4); - gtk_widget_show(hbox); - - if(mainwindow->framec) - gtk_widget_destroy(mainwindow->framec); - - gtk_container_add(GTK_CONTAINER(mainwindow->frame), hbox); - mainwindow->framec = hbox; + buf = g_strdup_printf(_("SCSI %s Device"), type2icon[i].label); - gtk_frame_set_label(GTK_FRAME(mainwindow->frame), buf); + gtk_window_set_title(GTK_WINDOW(mainwindow->det_window->window), buf); + detail_window_set_dev_type(mainwindow->det_window, buf); g_free(buf); - -#ifdef GTK2 - gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, FALSE, 0); -#endif - vbox = gtk_vbox_new(FALSE, 2); - gtk_widget_show(vbox); - gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); + detail_window_set_dev_name(mainwindow->det_window, device->model); -#ifdef GTK2 - buf = g_strdup_printf("<b>%s</b>", device->model); - label = gtk_label_new(buf); - gtk_label_set_use_markup(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); + detail_window_append_info(mainwindow->det_window, _("Revision"), device->revision); + detail_window_append_info(mainwindow->det_window, _("Type"), device->type); - g_free(buf); -#else - label = gtk_label_new(device->model); -#endif - - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - - buf = g_strdup_printf(_("Revision: %s"), device->revision); - label = gtk_label_new(buf); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - g_free(buf); + detail_window_append_separator(mainwindow->det_window); - buf = g_strdup_printf(_("Type: %s"), device->type); - label = gtk_label_new(buf); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - g_free(buf); - - buf = g_strdup_printf - (_("Controller: %d, Bus: %d, ID: %d, LUN: %d"), - device->controller, - device->channel, - device->id, - device->lun); - label = gtk_label_new(buf); - gtk_widget_show(label); - gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - g_free(buf); + detail_window_append_info_int(mainwindow->det_window, _("Controller"), device->controller, FALSE); + detail_window_append_info_int(mainwindow->det_window, _("Channel"), device->channel, FALSE); + detail_window_append_info_int(mainwindow->det_window, _("ID"), device->id, FALSE); + detail_window_append_info_int(mainwindow->det_window, _("LUN"), device->lun, FALSE); } |