interface.c (usbview-2.0) | : | interface.c (usbview-2.1) | ||
---|---|---|---|---|
/************************************************************************* | // SPDX-License-Identifier: GPL-2.0-only | |||
** interface.c for USBView - a USB device viewer | /* | |||
** Copyright (c) 1999, 2000, 2009 by Greg Kroah-Hartman, <greg@kroah.com> | * interface.c for USBView - a USB device viewer | |||
** | * Copyright (c) 1999, 2000, 2009 by Greg Kroah-Hartman, <greg@kroah.com> | |||
** This program is free software; you can redistribute it and/or modify | */ | |||
** it under the terms of the GNU General Public License as published by | ||||
** the Free Software Foundation; version 2 of the License. | ||||
** | ||||
** This program is distributed in the hope that it will be useful, | ||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
** GNU General Public License for more details. | ||||
** | ||||
** (See the included file COPYING) | ||||
*************************************************************************/ | ||||
#ifdef HAVE_CONFIG_H | #ifdef HAVE_CONFIG_H | |||
#include <config.h> | #include <config.h> | |||
#endif | #endif | |||
#include <sys/stat.h> | #include <sys/stat.h> | |||
#include <unistd.h> | #include <unistd.h> | |||
#include <string.h> | #include <string.h> | |||
#include <gtk/gtk.h> | #include <gtk/gtk.h> | |||
#include "usbtree.h" | #include "usbtree.h" | |||
#include "usb_icon.xpm" | #include "hicolor/64x64/apps/usbview_icon.xpm" | |||
GtkWidget *treeUSB; | GtkWidget *treeUSB; | |||
GtkTreeStore *treeStore; | GtkTreeStore *treeStore; | |||
GtkTextBuffer *textDescriptionBuffer; | GtkTextBuffer *textDescriptionBuffer; | |||
GtkWidget *textDescriptionView; | GtkWidget *textDescriptionView; | |||
GtkWidget *windowMain; | GtkWidget *windowMain; | |||
int timer; | int timer; | |||
GtkWidget* | GtkWidget* | |||
skipping to change at line 57 | skipping to change at line 46 | |||
GtkWidget *buttonAbout; | GtkWidget *buttonAbout; | |||
GdkPixbuf *icon; | GdkPixbuf *icon; | |||
GtkCellRenderer *treeRenderer; | GtkCellRenderer *treeRenderer; | |||
GtkTreeViewColumn *treeColumn; | GtkTreeViewColumn *treeColumn; | |||
windowMain = gtk_window_new (GTK_WINDOW_TOPLEVEL); | windowMain = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |||
gtk_widget_set_name (windowMain, "windowMain"); | gtk_widget_set_name (windowMain, "windowMain"); | |||
gtk_window_set_title (GTK_WINDOW (windowMain), "USB Viewer"); | gtk_window_set_title (GTK_WINDOW (windowMain), "USB Viewer"); | |||
gtk_window_set_default_size (GTK_WINDOW (windowMain), 600, 300); | gtk_window_set_default_size (GTK_WINDOW (windowMain), 600, 300); | |||
icon = gdk_pixbuf_new_from_xpm_data((const char **)usb_icon_xpm); | icon = gdk_pixbuf_new_from_xpm_data((const char **)usbview_icon); | |||
gtk_window_set_icon(GTK_WINDOW(windowMain), icon); | gtk_window_set_icon(GTK_WINDOW(windowMain), icon); | |||
vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); | vbox1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); | |||
gtk_widget_set_name (vbox1, "vbox1"); | gtk_widget_set_name (vbox1, "vbox1"); | |||
gtk_widget_show (vbox1); | gtk_widget_show (vbox1); | |||
gtk_container_add (GTK_CONTAINER (windowMain), vbox1); | gtk_container_add (GTK_CONTAINER (windowMain), vbox1); | |||
hpaned1 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); | hpaned1 = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); | |||
gtk_widget_set_name (hpaned1, "hpaned1"); | gtk_widget_set_name (hpaned1, "hpaned1"); | |||
gtk_widget_show (hpaned1); | gtk_widget_show (hpaned1); | |||
skipping to change at line 110 | skipping to change at line 99 | |||
gtk_container_add (GTK_CONTAINER (scrolledwindow1), textDescriptionView); | gtk_container_add (GTK_CONTAINER (scrolledwindow1), textDescriptionView); | |||
hbuttonbox1 = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); | hbuttonbox1 = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); | |||
gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); | gtk_widget_set_name (hbuttonbox1, "hbuttonbox1"); | |||
gtk_widget_show (hbuttonbox1); | gtk_widget_show (hbuttonbox1); | |||
gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 5); | gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox1, FALSE, FALSE, 5); | |||
//gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10); | //gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 10); | |||
//gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox1), 50, 25); | //gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox1), 50, 25); | |||
//gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox1), 25, 10 ); | //gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox1), 25, 10 ); | |||
buttonRefresh = gtk_button_new_from_stock(GTK_STOCK_REFRESH); | buttonRefresh = gtk_button_new_with_label("Refresh"); | |||
gtk_widget_set_name (buttonRefresh, "buttonRefresh"); | gtk_widget_set_name (buttonRefresh, "buttonRefresh"); | |||
gtk_widget_show (buttonRefresh); | gtk_widget_show (buttonRefresh); | |||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonRefresh); | gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonRefresh); | |||
gtk_container_set_border_width (GTK_CONTAINER (buttonRefresh), 4); | gtk_container_set_border_width (GTK_CONTAINER (buttonRefresh), 4); | |||
gtk_widget_set_can_default (buttonRefresh, TRUE); | gtk_widget_set_can_default (buttonRefresh, TRUE); | |||
buttonConfigure = gtk_button_new_with_label ("Configure..."); | buttonConfigure = gtk_button_new_with_label ("Configure..."); | |||
gtk_widget_set_name (buttonConfigure, "buttonConfigure"); | gtk_widget_set_name (buttonConfigure, "buttonConfigure"); | |||
gtk_widget_show (buttonConfigure); | gtk_widget_show (buttonConfigure); | |||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonConfigure); | gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonConfigure); | |||
gtk_container_set_border_width (GTK_CONTAINER (buttonConfigure), 4); | gtk_container_set_border_width (GTK_CONTAINER (buttonConfigure), 4); | |||
gtk_widget_set_can_default (buttonConfigure, TRUE); | gtk_widget_set_can_default (buttonConfigure, TRUE); | |||
buttonAbout = gtk_button_new_from_stock(GTK_STOCK_ABOUT); | buttonAbout = gtk_button_new_with_label("About"); | |||
gtk_widget_set_name (buttonAbout, "buttonAbout"); | gtk_widget_set_name (buttonAbout, "buttonAbout"); | |||
gtk_widget_show (buttonAbout); | gtk_widget_show (buttonAbout); | |||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonAbout); | gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonAbout); | |||
gtk_container_set_border_width (GTK_CONTAINER (buttonAbout), 4); | gtk_container_set_border_width (GTK_CONTAINER (buttonAbout), 4); | |||
gtk_widget_set_can_default (buttonAbout, TRUE); | gtk_widget_set_can_default (buttonAbout, TRUE); | |||
buttonClose = gtk_button_new_from_stock(GTK_STOCK_QUIT); | buttonClose = gtk_button_new_with_label("Quit"); | |||
gtk_widget_set_name (buttonClose, "buttonClose"); | gtk_widget_set_name (buttonClose, "buttonClose"); | |||
gtk_widget_show (buttonClose); | gtk_widget_show (buttonClose); | |||
gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonClose); | gtk_container_add (GTK_CONTAINER (hbuttonbox1), buttonClose); | |||
gtk_container_set_border_width (GTK_CONTAINER (buttonClose), 4); | gtk_container_set_border_width (GTK_CONTAINER (buttonClose), 4); | |||
gtk_widget_set_can_default (buttonClose, TRUE); | gtk_widget_set_can_default (buttonClose, TRUE); | |||
g_signal_connect (G_OBJECT (windowMain), "delete_event", | g_signal_connect (G_OBJECT (windowMain), "delete_event", | |||
G_CALLBACK (on_window1_delete_event), | G_CALLBACK (on_window1_delete_event), | |||
NULL); | NULL); | |||
g_signal_connect (G_OBJECT (buttonRefresh), "clicked", | g_signal_connect (G_OBJECT (buttonRefresh), "clicked", | |||
End of changes. 6 change blocks. | ||||
21 lines changed or deleted | 10 lines changed or added |