summaryrefslogtreecommitdiff
path: root/scsi.c
diff options
context:
space:
mode:
authorSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:31 -0500
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:31 -0500
commita08438bda21b3e0d7db2db2360d040841970104d (patch)
treef8a13a1e368bfbd14fe2d9492d6d5824eb5712ce /scsi.c
parent8c1612d32c5682a86216adb8c8d11ce715fe5475 (diff)
Import Upstream version 0.3.7pre
Diffstat (limited to 'scsi.c')
-rw-r--r--scsi.c80
1 files changed, 14 insertions, 66 deletions
diff --git a/scsi.c b/scsi.c
index c5d19472..fc1dd40d 100644
--- a/scsi.c
+++ b/scsi.c
@@ -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);
}