rpms/gnomebaker/FC-6 gnomebaker-0.6.0-device.patch, NONE, 1.1 gnomebaker.spec, 1.6, 1.7

Brian Pepple (bpepple) fedora-extras-commits at redhat.com
Fri Dec 8 19:37:35 UTC 2006


Author: bpepple

Update of /cvs/extras/rpms/gnomebaker/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18786

Modified Files:
	gnomebaker.spec 
Added Files:
	gnomebaker-0.6.0-device.patch 
Log Message:
* Tue Dec  5 2006 Brian Pepple <bpepple at fedoraproject.org> - 0.6.0-2
- Add patch to fix device selection with multiple devices present.
- Drop X-Fedora category from desktop file.


gnomebaker-0.6.0-device.patch:

--- NEW FILE gnomebaker-0.6.0-device.patch ---
diff -Naur gnomebaker-0.6.0.old/src/devices.c gnomebaker-0.6.0/src/devices.c
--- gnomebaker-0.6.0.old/src/devices.c	2006-05-29 12:20:49.000000000 -0400
+++ gnomebaker-0.6.0/src/devices.c	2006-10-12 19:07:32.000000000 -0400
@@ -230,16 +230,47 @@
 
 
 void
-devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key)
+devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key, const gboolean writers_only)
 {
 	GB_LOG_FUNC
 	g_return_if_fail(option_menu != NULL);
 	g_return_if_fail(device_key != NULL);
 
-	gint index = gtk_option_menu_get_history(option_menu);
-	gchar *device = g_strdup_printf(GB_DEVICE_FORMAT, index + 1);
-	preferences_set_string(device_key, device);
-	g_free(device);
+	gint menuindex = gtk_option_menu_get_history(option_menu);
+
+	gint index = 0, count = 0, device = 0;
+	GSList *devices = preferences_get_key_subkeys(GB_DEVICES_KEY);
+	GSList *item = devices;
+
+	for(; device == 0; item = item->next)
+	{
+		gchar *device_key = (gchar*)item->data;
+
+	        gchar *device_capabilities_key = g_strconcat(device_key, GB_DEVICE_CAPABILITIES_LABEL, NULL);
+	        const gint capabilities = preferences_get_int(device_capabilities_key);
+	        /* Check the capabilities of the device and make sure that, if only writers were added
+                 * to the options menu, the device can actually write disks */
+		if(!writers_only || (capabilities & DC_WRITE_CDR || capabilities & DC_WRITE_CDRW ||
+                capabilities & DC_WRITE_DVDR || capabilities & DC_WRITE_DVDRAM))
+		{
+			if(index == menuindex)
+			{
+				device = count + 1;
+			}
+			++index;
+		}
+
+	        g_free(device_capabilities_key);
+		g_free(device_key);
+		++count;
+	
+	}
+
+	g_slist_free(devices);
+
+	gchar *devicename = g_strdup_printf(GB_DEVICE_FORMAT, device);
+	preferences_set_string(device_key, devicename);
+	g_free(devicename);
 }
 
 
diff -Naur gnomebaker-0.6.0.old/src/devices.h gnomebaker-0.6.0/src/devices.h
--- gnomebaker-0.6.0.old/src/devices.h	2006-05-29 12:20:49.000000000 -0400
+++ gnomebaker-0.6.0/src/devices.h	2006-10-15 20:52:16.000000000 -0400
@@ -45,7 +45,7 @@
 	const gint capabilities);
 gboolean devices_mount_device(const gchar *device_key, gchar* *mount_point);
 void devices_unmount_device(const gchar *device_key);
-void devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key);
+void devices_save_optionmenu(GtkOptionMenu *option_menu, const gchar *device_key, const gboolean writers_only);
 gboolean devices_eject_disk(const gchar *device_key);
 gint devices_prompt_for_disk(GtkWindow *parent, const gchar *device_key);
 gint devices_prompt_for_blank_disk(GtkWindow *parent, const gchar *device_key);
diff -Naur gnomebaker-0.6.0.old/src/selectdevicedlg.c gnomebaker-0.6.0/src/selectdevicedlg.c
--- gnomebaker-0.6.0.old/src/selectdevicedlg.c	2006-05-29 12:20:49.000000000 -0400
+++ gnomebaker-0.6.0/src/selectdevicedlg.c	2006-10-12 19:08:59.000000000 -0400
@@ -66,5 +66,5 @@
 	g_return_if_fail(selectdevicedlgdlg_xml != NULL);
 
 	GtkWidget *option_menu = glade_xml_get_widget(selectdevicedlgdlg_xml, widget_select_writer);
-	devices_save_optionmenu(GTK_OPTION_MENU(option_menu), GB_WRITER);
+	devices_save_optionmenu(GTK_OPTION_MENU(option_menu), GB_WRITER, TRUE);
 }
diff -Naur gnomebaker-0.6.0.old/src/startdlg.c gnomebaker-0.6.0/src/startdlg.c
--- gnomebaker-0.6.0.old/src/startdlg.c	2006-08-30 19:41:15.000000000 -0400
+++ gnomebaker-0.6.0/src/startdlg.c	2006-10-12 19:07:51.000000000 -0400
@@ -69,8 +69,8 @@
     g_return_if_fail(user_data != NULL);
 
     StartDlg *start_dlg = (StartDlg*)user_data;
-    devices_save_optionmenu(start_dlg->reader, GB_READER);
-    devices_save_optionmenu(start_dlg->writer, GB_WRITER);
+    devices_save_optionmenu(start_dlg->reader, GB_READER, FALSE);
+    devices_save_optionmenu(start_dlg->writer, GB_WRITER, TRUE);
     const gint index = gtk_option_menu_get_history(start_dlg->write_speed);
     if(index == 0)
         preferences_set_int(start_dlg->dvdmode ? GB_DVDWRITE_SPEED : GB_CDWRITE_SPEED, 0);


Index: gnomebaker.spec
===================================================================
RCS file: /cvs/extras/rpms/gnomebaker/FC-6/gnomebaker.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- gnomebaker.spec	17 Sep 2006 01:21:05 -0000	1.6
+++ gnomebaker.spec	8 Dec 2006 19:37:05 -0000	1.7
@@ -1,12 +1,13 @@
 Name:           gnomebaker
 Version:        0.6.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        GNOME CD/DVD burner
 
 Group:          Applications/Multimedia
 License:        GPL
 URL:		http://%{name}.sourceforge.net/v2/ 
 Source0:        http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Patch0:		%{name}-%{version}-device.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libgnomeui-devel >= 2.10.0
@@ -33,6 +34,7 @@
 
 %prep
 %setup -q
+%patch0 -p1 -b .device
 chmod 644 AUTHORS TODO
 
 
@@ -51,7 +53,6 @@
 
 desktop-file-install --vendor fedora --delete-original	\
   --dir $RPM_BUILD_ROOT%{_datadir}/applications   	\
-  --add-category X-Fedora			        \
   $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
 
 
@@ -83,6 +84,10 @@
 
 
 %changelog
+* Tue Dec  5 2006 Brian Pepple <bpepple at fedoraproject.org> - 0.6.0-2
+- Add patch to fix device selection with multiple devices present.
+- Drop X-Fedora category from desktop file.
+
 * Sat Sep 16 2006 Brian Pepple <bpepple at fedoraproject.org> - 0.6.0-1
 - Update to 0.6.0.
 - Drop BR on libglade2-devel.




More information about the fedora-extras-commits mailing list