[PATCH] Fix for defect 127371



Hi,

I have fixed the defect 127371, which is about a small usability issue.
When the user doesnt specify a location or specify a non-existing
location, just reporting what he specified is wrong.

Thanks
Srini.

--PATCH--

Index:
gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c
===================================================================
RCS file:
/cvs/gnome/gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c,v
retrieving revision 1.3
diff -u -r1.3 gnome-theme-installer.c
---
gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c	16
Jan 2003 07:40:29 -0000	1.3
+++
gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c	19
Nov 2003 09:02:37 -0000
@@ -116,16 +116,38 @@
 	if (response_id == 0) {
 		icon_theme = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
"icon_theme"));
 		raw = gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry
(GNOME_FILE_ENTRY (WID ("install_theme_picker")))));
-		if (raw == NULL || strlen (raw) <= 0)
+		if (raw == NULL || strlen (raw) <= 0)	{
+	        GtkWidget *dialog;
+
+  	        dialog = gtk_message_dialog_new (NULL,
+			  	       GTK_DIALOG_MODAL,
+				       GTK_MESSAGE_ERROR,
+				       GTK_BUTTONS_OK,
+				       _("No theme file location specified to install"));
+    	    gtk_dialog_run (GTK_DIALOG (dialog));
+      	    gtk_widget_destroy (dialog);			
 			return;
+			
+		}
+
 
 		if (strncmp (raw, "http://";, 7) && strncmp (raw, "ftp://";, 6) && *raw
!= '/')
 			filename = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (WID
("install_theme_picker")), TRUE);
 		else
 			filename = g_strdup (raw);
-		if (filename == NULL)
-			return;
+		if (filename == NULL)	{
+	        GtkWidget *dialog;
 
+  	        dialog = gtk_message_dialog_new (NULL,
+			  	       GTK_DIALOG_MODAL,
+				       GTK_MESSAGE_ERROR,
+				       GTK_BUTTONS_OK,
+				       _("The theme file location specified to install is
invalid"));
+    	    gtk_dialog_run (GTK_DIALOG (dialog));
+      	    gtk_widget_destroy (dialog);			
+			return;
+		}
+			
 		src_uri = gnome_vfs_uri_new (filename);
 		base = gnome_vfs_uri_extract_short_name (src_uri);
 		src = g_list_append (NULL, src_uri);

Index: gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c,v
retrieving revision 1.3
diff -u -r1.3 gnome-theme-installer.c
--- gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c	16 Jan 2003 07:40:29 -0000	1.3
+++ gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c	19 Nov 2003 09:02:37 -0000
@@ -116,16 +116,38 @@
 	if (response_id == 0) {
 		icon_theme = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "icon_theme"));
 		raw = gtk_entry_get_text (GTK_ENTRY (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (WID ("install_theme_picker")))));
-		if (raw == NULL || strlen (raw) <= 0)
+		if (raw == NULL || strlen (raw) <= 0)	{
+	        GtkWidget *dialog;
+
+  	        dialog = gtk_message_dialog_new (NULL,
+			  	       GTK_DIALOG_MODAL,
+				       GTK_MESSAGE_ERROR,
+				       GTK_BUTTONS_OK,
+				       _("No theme file location specified to install"));
+    	    gtk_dialog_run (GTK_DIALOG (dialog));
+      	    gtk_widget_destroy (dialog);			
 			return;
+			
+		}
+
 
 		if (strncmp (raw, "http://";, 7) && strncmp (raw, "ftp://";, 6) && *raw != '/')
 			filename = gnome_file_entry_get_full_path (GNOME_FILE_ENTRY (WID ("install_theme_picker")), TRUE);
 		else
 			filename = g_strdup (raw);
-		if (filename == NULL)
-			return;
+		if (filename == NULL)	{
+	        GtkWidget *dialog;
 
+  	        dialog = gtk_message_dialog_new (NULL,
+			  	       GTK_DIALOG_MODAL,
+				       GTK_MESSAGE_ERROR,
+				       GTK_BUTTONS_OK,
+				       _("The theme file location specified to install is invalid"));
+    	    gtk_dialog_run (GTK_DIALOG (dialog));
+      	    gtk_widget_destroy (dialog);			
+			return;
+		}
+			
 		src_uri = gnome_vfs_uri_new (filename);
 		base = gnome_vfs_uri_extract_short_name (src_uri);
 		src = g_list_append (NULL, src_uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]