[gnumeric] Improve keyboard navigation of the configurable text importer. [#614939, #614941]



commit cba56fd35c054ba2f595aea2237ac606342536ca
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed May 5 21:56:45 2010 -0600

    Improve keyboard navigation of the configurable text importer. [#614939,#614941]
    
    2010-05-05 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-stf.c (stf_dialog_set_initial_keyboard_focus): use the
    	  finish and forward buttons as default buttons
    	(frob_buttons): keep the finish button visible.
    	* dialog-stf.glade: have only the forward and finish buttons as
    	  possible default buttons.

 NEWS                         |    4 +++-
 src/dialogs/ChangeLog        |    8 ++++++++
 src/dialogs/dialog-stf.c     |   16 ++++++++--------
 src/dialogs/dialog-stf.glade |   13 +++++++------
 4 files changed, 26 insertions(+), 15 deletions(-)
---
diff --git a/NEWS b/NEWS
index d2009a7..0a320fd 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Andreas:
 	* Remove undesired interaction between Advanced Filters and 
 	  Autofilters.
 	* Make the par argument to ACCRINT optional. [#323545]
+	* Improve keyboard navigation of the configurable text
+	  importer. [#614939,#614941]
 
 Jean:
 	* Implement graph only sheets. [#158170]
@@ -34,7 +36,7 @@ Morten:
 	* Improve IMPOWER.
 	* Fix sheet duplicate bugs.  [Part of #617469]
 	* Clean-up handling of pango contexts.
-	* Fix old graph problem.  [#1424112]
+	* Fix old graph problem.  [#142412]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.2
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 493ec93..61315bb 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-05 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* dialog-stf.c (stf_dialog_set_initial_keyboard_focus): use the
+	  finish and forward buttons as default buttons
+	(frob_buttons): keep the finish button visible.
+	* dialog-stf.glade: have only the forward and finish buttons as 
+	  possible default buttons.
+
 2010-05-04 Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* dialog-advanced-filter.c (advanced_filter_ok_clicked_cb): use 
diff --git a/src/dialogs/dialog-stf.c b/src/dialogs/dialog-stf.c
index 3b6d94c..c03cbf9 100644
--- a/src/dialogs/dialog-stf.c
+++ b/src/dialogs/dialog-stf.c
@@ -50,6 +50,7 @@ static void
 stf_dialog_set_initial_keyboard_focus (StfDialogData *pagedata)
 {
 	GtkWidget *focus_widget = NULL;
+	GtkWidget *default_widget = pagedata->next_button;
 
 	switch (gtk_notebook_get_current_page (pagedata->notebook)) {
 	case DPG_MAIN:
@@ -62,7 +63,8 @@ stf_dialog_set_initial_keyboard_focus (StfDialogData *pagedata)
 		focus_widget = GTK_WIDGET (pagedata->fixed.fixed_auto);
 		break;
 	case DPG_FORMAT:
-		go_format_sel_set_focus (pagedata->format.format_selector);
+		focus_widget = pagedata->finish_button;
+		default_widget = pagedata->finish_button;
 		break;
 	default:
 		g_assert_not_reached ();
@@ -70,6 +72,10 @@ stf_dialog_set_initial_keyboard_focus (StfDialogData *pagedata)
 
 	if (focus_widget)
 		gtk_widget_grab_focus (focus_widget);
+
+	if (default_widget)
+		gtk_widget_grab_default (default_widget);
+
 }
 
 static void
@@ -78,14 +84,8 @@ frob_buttons (StfDialogData *pagedata)
 	StfDialogPage pos =
 		gtk_notebook_get_current_page (pagedata->notebook);
 
-	if (pos == DPG_FORMAT) {
-		gtk_widget_show (pagedata->finish_button);
-		gtk_widget_hide (pagedata->next_button);
-	} else {
-		gtk_widget_hide (pagedata->finish_button);
-		gtk_widget_show (pagedata->next_button);
-	}
 	gtk_widget_set_sensitive (pagedata->back_button, pos != DPG_MAIN);
+	gtk_widget_set_sensitive (pagedata->next_button, pos != DPG_FORMAT);
 }
 
 static void
diff --git a/src/dialogs/dialog-stf.glade b/src/dialogs/dialog-stf.glade
index 2331e03..fe565c0 100644
--- a/src/dialogs/dialog-stf.glade
+++ b/src/dialogs/dialog-stf.glade
@@ -31,7 +31,7 @@
 	  <child>
 	    <widget class="GtkButton" id="help_button">
 	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
+	      <property name="can_default">False</property>
 	      <property name="can_focus">True</property>
 	      <property name="label">gtk-help</property>
 	      <property name="use_stock">True</property>
@@ -44,7 +44,7 @@
 	  <child>
 	    <widget class="GtkButton" id="cancel_button">
 	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
+	      <property name="can_default">False</property>
 	      <property name="can_focus">True</property>
 	      <property name="label">gtk-cancel</property>
 	      <property name="use_stock">True</property>
@@ -57,7 +57,7 @@
 	  <child>
 	    <widget class="GtkButton" id="back_button">
 	      <property name="visible">True</property>
-	      <property name="can_default">True</property>
+	      <property name="can_default">False</property>
 	      <property name="can_focus">True</property>
 	      <property name="label">gtk-go-back</property>
 	      <property name="use_stock">True</property>
@@ -71,6 +71,7 @@
 	    <widget class="GtkButton" id="forward_button">
 	      <property name="visible">True</property>
 	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
 	      <property name="can_focus">True</property>
 	      <property name="label">gtk-go-forward</property>
 	      <property name="use_stock">True</property>
@@ -1310,7 +1311,7 @@
 			    <widget class="GtkButton" id="fixed_auto">
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Attempt to recognize columns in the text automatically.</property>
-			      <property name="can_default">True</property>
+			      <property name="can_default">False</property>
 			      <property name="can_focus">True</property>
 			      <property name="label" translatable="yes">_Auto Column Discovery</property>
 			      <property name="use_underline">True</property>
@@ -1323,7 +1324,7 @@
 			    <widget class="GtkButton" id="fixed_clear">
 			      <property name="visible">True</property>
 			      <property name="tooltip" translatable="yes">Clear list of columns</property>
-			      <property name="can_default">True</property>
+			      <property name="can_default">False</property>
 			      <property name="can_focus">True</property>
 			      <property name="label" translatable="yes">_Clear</property>
 			      <property name="use_underline">True</property>
@@ -1500,7 +1501,6 @@
 
 			  <child>
 			    <widget class="GtkComboBox" id="format_trim">
-			      <property name="border_width">6</property>
 			      <property name="visible">True</property>
 			      <property name="items" translatable="yes">Both sides
 Neither side
@@ -1512,6 +1512,7 @@ On right side only</property>
 			      <property name="right_attach">2</property>
 			      <property name="top_attach">0</property>
 			      <property name="bottom_attach">1</property>
+			      <property name="y_padding">6</property>
 			      <property name="x_options">fill</property>
 			      <property name="y_options"></property>
 			    </packing>



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