Patch to improve usability of applet's Progress Dialog



Now that the Log (message_area) window is working again (thanks Matt!) in the applet's Progress
Dialog, I thought it'd be a good idea to make it a little more usable.

I've attached a patch that does the following for the Progress Dialog:
- always scroll to the bottom of the Log window after text was added to it
- Log window was made bigger so that it's possible to see more lines of the Log at once (8 lines
of log info now)

I made the window size 153 pixels. 150 made the window look good, and the extra 3 pixels made it
so that exactly 9 lines are shown (9th line is blank and has the cursor). This prevents lines
above the window from being partially shown.

Let me know how you like it.

On a different topic: does anyone know why the Cancel button doesn't work during sync? Should we
try to enable it? PalmOS can cancel HotSync, and we should be able to as well (palm's official
HotSync app can). If it's only enabled when viewing the last log, I'd suggest renaming it and only
showing it when viewing the last log.

Another thing I'd like to try with the window is to leave it up at the end and allow the user to
dismiss it manually (or at least give them the option to leave it up at the end). As I'm trying to
make sure that it sync'd properly with my PDA, I like to read the log without having to go to the
"last log" option in the applet. Comments?

Thanks,
Nathan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Index: pilot-applet.glade
===================================================================
RCS file: /cvs/gnome/gnome-pilot/applet/pilot-applet.glade,v
retrieving revision 1.14
diff -u -r1.14 pilot-applet.glade
--- pilot-applet.glade	27 Mar 2005 04:31:35 -0000	1.14
+++ pilot-applet.glade	21 Aug 2006 04:14:29 -0000
@@ -208,32 +208,26 @@
 	      <property name="visible">True</property>
 	      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 	      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-	      <property name="shadow_type">GTK_SHADOW_NONE</property>
+	      <property name="shadow_type">GTK_SHADOW_IN</property>
 	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	      <child>
-		<widget class="GtkViewport" id="viewport">
+	        <widget class="GtkTextView" id="message_area">
+		  <property name="height_request">153</property>
 		  <property name="visible">True</property>
-		  <property name="shadow_type">GTK_SHADOW_IN</property>
-
-		  <child>
-		    <widget class="GtkTextView" id="message_area">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="editable">False</property>
-		      <property name="justification">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap_mode">GTK_WRAP_WORD</property>
-		      <property name="cursor_visible">True</property>
-		      <property name="pixels_above_lines">0</property>
-		      <property name="pixels_below_lines">0</property>
-		      <property name="pixels_inside_wrap">0</property>
-		      <property name="left_margin">0</property>
-		      <property name="right_margin">0</property>
-		      <property name="indent">0</property>
-		      <property name="text" translatable="yes"></property>
-		    </widget>
-		  </child>
-		</widget>
+		  <property name="can_focus">True</property>
+		  <property name="editable">False</property>
+		  <property name="justification">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap_mode">GTK_WRAP_WORD</property>
+		  <property name="cursor_visible">True</property>
+		  <property name="pixels_above_lines">0</property>
+		  <property name="pixels_below_lines">0</property>
+		  <property name="pixels_inside_wrap">0</property>
+		  <property name="left_margin">0</property>
+		  <property name="right_margin">0</property>
+		  <property name="indent">0</property>
+		  <property name="text" translatable="yes"></property>
+                </widget>
 	      </child>
 	    </widget>
 	    <packing>
Index: pilot.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/applet/pilot.c,v
retrieving revision 1.95
diff -u -r1.95 pilot.c
--- pilot.c	14 Aug 2006 20:32:21 -0000	1.95
+++ pilot.c	21 Aug 2006 04:14:29 -0000
@@ -241,6 +241,17 @@
 
 }
 
+static void gpilotd_scroll_to_insert_mark(PilotApplet *applet)
+{
+	gtk_text_view_scroll_to_mark(
+			GTK_TEXT_VIEW(applet->message_area),
+       			gtk_text_buffer_get_insert(applet->message_buffer),
+			0.2,
+			FALSE,
+			0.0,
+			0.0);
+}
+
 static void 
 gpilotd_request_completed (GnomePilotClient *client,
 			   const gchar *id,
@@ -255,6 +266,7 @@
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
 
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 
 /*	show_message_dialog ("Pilot %s has completed request %ld",
@@ -280,6 +292,7 @@
 		txt=g_strdup_printf (_("%s: Started\n"),conduit);
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 }
 
@@ -300,6 +313,7 @@
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
 		gtk_progress_set_format_string (GTK_PROGRESS (applet->conduit_progress_bar), "");
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 }
 
@@ -359,6 +373,7 @@
 		gchar *txt=g_strdup_printf ("%s: %s\n",conduit,message);
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 	g_main_iteration (FALSE);
 }
@@ -375,6 +390,7 @@
 		gchar *txt=g_strdup_printf ("%s\n", message);
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 	g_main_iteration (FALSE);
 }
@@ -390,6 +406,7 @@
 		gchar *txt=g_strdup_printf ("Error: %s\n", message);
 		gtk_text_buffer_insert_at_cursor (applet->message_buffer,txt,-1);
 		g_free (txt);
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 }
 
@@ -858,6 +875,7 @@
 							  NULL);
 		g_free (txt);
 		gtk_text_iter_free (iter);
+		gpilotd_scroll_to_insert_mark(applet);
 	}
 }
 


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