[Goodies-commits] r4774 - xfburn/trunk/xfburn
David Mohr
squisher at xfce.org
Sat May 10 18:21:48 CEST 2008
Author: squisher
Date: 2008-05-10 16:21:48 +0000 (Sat, 10 May 2008)
New Revision: 4774
Modified:
xfburn/trunk/xfburn/xfburn-device-box.c
xfburn/trunk/xfburn/xfburn-device-list.c
xfburn/trunk/xfburn/xfburn-device-list.h
Log:
Showing inserted disc type in the device box
Modified: xfburn/trunk/xfburn/xfburn-device-box.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-box.c 2008-05-10 15:15:24 UTC (rev 4773)
+++ xfburn/trunk/xfburn/xfburn-device-box.c 2008-05-10 16:21:48 UTC (rev 4774)
@@ -80,6 +80,9 @@
gboolean blank_mode;
GtkWidget *combo_device;
+
+ GtkWidget *hbox_refresh;
+ GtkWidget *disc_label;
GtkWidget *hbox_speed_selection;
GtkWidget *combo_speed;
@@ -203,7 +206,7 @@
GList *device = NULL;
GtkListStore *store = NULL;
GtkCellRenderer *cell;
- GtkWidget *hbox;
+ //GtkWidget *hbox;
gboolean have_device;
/* devices */
@@ -231,14 +234,37 @@
}
gtk_widget_set_sensitive (priv->combo_device, have_device);
+ /*
hbox = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, BORDER);
+ */
+ /* disc label */
+ priv->hbox_refresh = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (priv->hbox_refresh);
+ gtk_box_pack_start (GTK_BOX (box), priv->hbox_refresh, TRUE, TRUE, BORDER);
+
+ priv->disc_label = gtk_label_new ("");
+ gtk_widget_show (priv->disc_label);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_refresh), priv->disc_label, TRUE, TRUE, BORDER);
+
+ /* refresh */
+ img = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gtk_widget_show (img);
+ button = gtk_button_new ();
+ gtk_container_add (GTK_CONTAINER (button), img);
+ gtk_widget_show (button);
+ //gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->hbox_refresh), button, FALSE, FALSE, BORDER);
+ gtk_widget_set_sensitive (button, have_device);
+
+ g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_speed_refresh_clicked), box);
+
/* speed */
priv->hbox_speed_selection = gtk_hbox_new (FALSE, 0);
gtk_widget_show (priv->hbox_speed_selection);
- gtk_box_pack_start (GTK_BOX (hbox), priv->hbox_speed_selection, TRUE, TRUE, BORDER);
+ gtk_box_pack_start (GTK_BOX (box), priv->hbox_speed_selection, TRUE, TRUE, BORDER);
label = gtk_label_new_with_mnemonic (_("_Speed:"));
gtk_widget_show (label);
@@ -254,18 +280,6 @@
gtk_widget_show (priv->combo_speed);
gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), priv->combo_speed, TRUE, TRUE, BORDER);
- /* refresh */
- img = gtk_image_new_from_stock (GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_widget_show (img);
- button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button), img);
- gtk_widget_show (button);
- //gtk_box_pack_start (GTK_BOX (priv->hbox_speed_selection), button, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
- gtk_widget_set_sensitive (button, have_device);
-
- g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cb_speed_refresh_clicked), box);
-
/* mode */
priv->hbox_mode_selection = gtk_hbox_new (FALSE, 0);
gtk_widget_show (priv->hbox_mode_selection);
@@ -499,6 +513,8 @@
enum burn_disc_status disc_status = xfburn_device_list_get_disc_status ();
int profile_no = xfburn_device_list_get_profile_no ();
gboolean is_erasable = xfburn_device_list_disc_is_erasable ();
+
+ gtk_label_set_text (GTK_LABEL (priv->disc_label), xfburn_device_list_get_profile_name ());
if (!priv->blank_mode) {
priv->valid_disc = (disc_status == BURN_DISC_BLANK) || (disc_status == BURN_DISC_APPENDABLE);
@@ -629,6 +645,7 @@
static void
cb_speed_refresh_clicked (GtkButton *button, XfburnDeviceBox *box)
{
+ //XfburnDeviceBoxPrivate *priv = XFBURN_DEVICE_BOX_GET_PRIVATE (box);
XfburnDevice *device = NULL;
device = xfburn_device_box_get_selected_device (box);
Modified: xfburn/trunk/xfburn/xfburn-device-list.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.c 2008-05-10 15:15:24 UTC (rev 4773)
+++ xfburn/trunk/xfburn/xfburn-device-list.c 2008-05-10 16:21:48 UTC (rev 4774)
@@ -39,6 +39,7 @@
static GList *devices = NULL;
static enum burn_disc_status disc_status;
static int profile_no = 0;
+static char profile_name[80];
static int is_erasable = 0;
#define CAN_BURN_CONDITION device->cdr || device->cdrw || device->dvdr || device->dvdram
@@ -85,7 +86,6 @@
refresh_supported_speeds (XfburnDevice * device, struct burn_drive_info *drive_info)
{
struct burn_speed_descriptor *speed_list = NULL;
- char profile_name[80];
int factor;
gint ret;
/*
@@ -124,6 +124,7 @@
DBG ("work around bug in my drive or libburn: disc is a full DVD-RW sequential");
profile_no = XFBURN_PROFILE_DVD_MINUS_RW_SEQUENTIAL;
disc_status = BURN_DISC_FULL;
+ strcpy (profile_name, "(?) DVD-RW sequiential");
}
/*
@@ -204,6 +205,12 @@
return profile_no;
}
+const char *
+xfburn_device_list_get_profile_name ()
+{
+ return profile_name;
+}
+
gboolean
xfburn_device_list_disc_is_erasable ()
{
@@ -250,6 +257,8 @@
gboolean can_burn;
guint n_drives = 0;
+ *profile_name = '\0';
+
if (!burn_initialize ()) {
g_critical ("Unable to initialize libburn");
return -1;
Modified: xfburn/trunk/xfburn/xfburn-device-list.h
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.h 2008-05-10 15:15:24 UTC (rev 4773)
+++ xfburn/trunk/xfburn/xfburn-device-list.h 2008-05-10 16:21:48 UTC (rev 4774)
@@ -80,6 +80,7 @@
GList * xfburn_device_list_get_list ();
enum burn_disc_status xfburn_device_list_get_disc_status ();
int xfburn_device_list_get_profile_no ();
+const char * xfburn_device_list_get_profile_name ();
gboolean xfburn_device_list_disc_is_erasable ();
void xfburn_device_list_free ();
More information about the Goodies-commits
mailing list