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 /parport.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 'parport.c')
| -rw-r--r-- | parport.c | 102 | 
1 files changed, 19 insertions, 83 deletions
| @@ -124,19 +124,15 @@ ParportDevice *hi_scan_parport(void)  void hi_show_parport_info(MainWindow *mainwindow, ParportDevice *device)  { -	GtkWidget *hbox, *vbox, *label;  	gchar *buf;  	static struct {  		gchar *type, *label, *icon;  	} type2icon[] = { -		{"PRINTER",	"Printer",		"lpr.png"}, -		{"MEDIA",	"Multimedia",	"media.png"},		 +		{"PRINTER",	"Printer",		"lpr.png"	}, +		{"MEDIA",	"Multimedia",		"media.png"	},		  		{NULL,		"Legacy Device",	"gen_connector.png"},  	};  	gint i; -#ifdef GTK2 -	GtkWidget *pixmap;		 -#endif  	if(!device) return; @@ -148,87 +144,27 @@ void hi_show_parport_info(MainWindow *mainwindow, ParportDevice *device)  		i = sizeof(type2icon) / sizeof(type2icon[0]) - 1; -#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); +	gtk_window_set_title(GTK_WINDOW(mainwindow->det_window->window), _("Parallel Port")); -	if(mainwindow->framec) -		gtk_widget_destroy(mainwindow->framec); - -	gtk_container_add(GTK_CONTAINER(mainwindow->frame), hbox); -	mainwindow->framec = hbox; +	detail_window_set_dev_name(mainwindow->det_window, device->name); +	detail_window_set_dev_type(mainwindow->det_window, type2icon[i].label); -	gtk_frame_set_label(GTK_FRAME(mainwindow->frame), _("Parallel Port")); -	 -#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); - -#ifdef GTK2 -	buf = g_strdup_printf("<b>%s</b>", device->name); -	label = gtk_label_new(buf); -	gtk_label_set_use_markup(GTK_LABEL(label), TRUE); -	gtk_label_set_selectable(GTK_LABEL(label), TRUE); -	 -	g_free(buf); -#else -	label = gtk_label_new(device->name); -#endif -	gtk_widget_show(label); -	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); - -	if (device->description) { -		buf = g_strdup_printf(_("Description: %s"), device->description); -		label = gtk_label_new(buf); -		gtk_widget_show(label); -		gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); -	 -		g_free(buf); -	} -	 -	if (device->cmdset) { -		buf = g_strdup_printf(_("Command set: %s"), device->cmdset); -		label = gtk_label_new(buf); -		gtk_widget_show(label); -		gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); +	if (device->description) +		detail_window_append_info(mainwindow->det_window, _("Description"), +					  device->description); -		g_free(buf); -	} - -	buf = g_strdup_printf(_("Class: %s"), type2icon[i].label); -	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(_("Base I/O address: 0x%x"), device->port); -	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(_("Modes: %s"), device->modes); -	label = gtk_label_new(buf); -	gtk_widget_show(label); -	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);	 -	g_free(buf);	 - -	if (device->dma) { -		label = gtk_label_new(_("Uses DMA")); -		gtk_widget_show(label); -		gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); -	} - +	if (device->cmdset)  +		detail_window_append_info(mainwindow->det_window, _("Command set"), +					  device->cmdset); + +	detail_window_append_info_int(mainwindow->det_window, _("Base I/O address"), +			              device->port, TRUE); +	detail_window_append_info(mainwindow->det_window, _("Modes"), +			          device->modes); +	detail_window_append_info(mainwindow->det_window, _("Uses DMA"), +			          device->dma ? _("Yes") : _("No"));  } | 
