[Xfce4-commits] [apps/xfburn] 01/02: Bugfix: In the device drowdown preselect the last used burner.

noreply at xfce.org noreply at xfce.org
Mon Apr 7 06:01:54 CEST 2014


This is an automated email from the git hooks/post-receive script.

squisher pushed a commit to branch master
in repository apps/xfburn.

commit 43a2814b71650d90ba78fd4cda934936e1b3bb88
Author: David Mohr <david at mcbf.net>
Date:   Sun Apr 6 21:59:58 2014 -0600

    Bugfix: In the device drowdown preselect the last used burner.
---
 xfburn/xfburn-device-list.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/xfburn/xfburn-device-list.c b/xfburn/xfburn-device-list.c
index 7342900..0cedfd9 100644
--- a/xfburn/xfburn-device-list.c
+++ b/xfburn/xfburn-device-list.c
@@ -413,6 +413,8 @@ xfburn_device_list_get_device_combo (XfburnDeviceList *devlist)
   GtkListStore *store = NULL;
   GtkCellRenderer *cell;
 
+  int i, selected;
+
   store = gtk_list_store_new (DEVICE_N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER);
   combo_device = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
   g_object_unref (store);
@@ -423,6 +425,7 @@ xfburn_device_list_get_device_combo (XfburnDeviceList *devlist)
   gtk_widget_show (combo_device);
 
   device = priv->devices;
+  i = 0;
   while (device) {
     XfburnDevice *device_data = (XfburnDevice *) device->data;
     GtkTreeIter iter;
@@ -433,12 +436,16 @@ xfburn_device_list_get_device_combo (XfburnDeviceList *devlist)
     gtk_list_store_append (store, &iter);
     gtk_list_store_set (store, &iter, DEVICE_NAME_COLUMN, name, DEVICE_POINTER_COLUMN, device_data, -1);
 
+    if (device_data == priv->curr_device)
+        selected = i;
+
     device = g_list_next (device);
+    i++;
   }
   /* FIXME: this might have to change once reading devices need to get selected as well */
   gtk_widget_set_sensitive (combo_device, priv->num_drives > 0);
 
-  gtk_combo_box_set_active (GTK_COMBO_BOX (combo_device), 0);
+  gtk_combo_box_set_active (GTK_COMBO_BOX (combo_device), selected);
 
   g_signal_connect (G_OBJECT (combo_device), "changed", G_CALLBACK (cb_combo_device_changed), devlist);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list