[gnumeric] Add paste-names dialog (usable even when editing). [#613325]



commit 84b175509cd23970d92daaf22783aa1d921d7036
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jun 3 13:25:37 2010 -0600

    Add paste-names dialog (usable even when editing). [#613325]
    
    2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/wbc-gtk-actions.c: make PasteNames action permanent
    	* src/wbc-gtk.c (wbcg_menu_state_update): update PasteNames
    
    2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-define-names.c (name_guru_paste): delete the selection
    	  and move the cursor into place

 ChangeLog                         |    5 +++++
 NEWS                              |    2 +-
 src/dialogs/ChangeLog             |    7 ++++++-
 src/dialogs/dialog-define-names.c |    6 ++++++
 src/wbc-gtk-actions.c             |    7 ++++---
 src/wbc-gtk.c                     |    4 +++-
 6 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7e8f5a5..65519a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/wbc-gtk-actions.c: make PasteNames action permanent
+	* src/wbc-gtk.c (wbcg_menu_state_update): update PasteNames
+
+2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* component/Gnumeric-embed.xml.in: add Paste Names
 	* src/GNOME_Gnumeric-gtk.xml.in: ditto
 	* src/HILDON_Gnumeric-gtk.xml.in: ditto
diff --git a/NEWS b/NEWS
index b725573..1c03fb7 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ Andreas:
 	* Add Wilcoxon Signed Rank Test tools for one and two populations.
 	* Fix spin button handling in various tool dialogs. [#619971]
 	* Redesign define-named-expressions dialog. [#465840] 
-	* Add paste-names dialog. 
+	* Add paste-names dialog. [#613325]
 
 Jean:
 	* Do not ungrab a not grabbed item. [#620369]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 9ba3289..c0ce737 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,6 +1,11 @@
 2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
 
-	dialog-define-names.c (name_guru_paste): don't overwrite text
+	* dialog-define-names.c (name_guru_paste): delete the selection
+	  and move the cursor into place
+
+2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* dialog-define-names.c (name_guru_paste): don't overwrite text
 	
 2010-06-03 Andreas J. Guelzow <aguelzow pyrshep ca>
 
diff --git a/src/dialogs/dialog-define-names.c b/src/dialogs/dialog-define-names.c
index a44f157..ed60e3a 100644
--- a/src/dialogs/dialog-define-names.c
+++ b/src/dialogs/dialog-define-names.c
@@ -355,6 +355,11 @@ name_guru_paste (NameGuruState *state, GtkTreeIter *iter)
 		if (position == 0)
 			gtk_editable_insert_text (GTK_EDITABLE (entry), "=",
 					  -1, &position);
+		else {
+			gtk_editable_delete_selection (GTK_EDITABLE (entry));
+			position = gtk_editable_get_position 
+				(GTK_EDITABLE (entry));
+		}
 		if (state->has_pasted) {
 			char sep = go_locale_get_arg_sep ();
 			gtk_editable_insert_text (GTK_EDITABLE (entry), &sep,
@@ -362,6 +367,7 @@ name_guru_paste (NameGuruState *state, GtkTreeIter *iter)
 		}
 		gtk_editable_insert_text (GTK_EDITABLE (entry), name,
 					  -1, &position);
+		gtk_editable_set_position (GTK_EDITABLE (entry), position);
 	}
 
 	g_free (name);
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index abcd0ab..04f3b1f 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1818,6 +1818,10 @@ static GtkActionEntry const permanent_actions[] = {
 		NULL, N_("Redo the undone action"),
 		G_CALLBACK (cb_edit_redo_last) },
 
+	{ "PasteNames", GTK_STOCK_PASTE, N_("_Paste..."),
+	        "F3", N_("Paste the definition of a name or names"),
+	        G_CALLBACK (cb_paste_names) },
+
 	{ "HelpDocs", GTK_STOCK_HELP, N_("_Contents"),
 		"F1", N_("Open a viewer for Gnumeric's documentation"),
 		G_CALLBACK (cb_help_docs) },
@@ -2043,9 +2047,6 @@ static GtkActionEntry const actions[] = {
 	{ "EditNames", NULL, N_("_Define..."),
 		"<control>F3", N_("Edit sheet and workbook names"),
 		G_CALLBACK (cb_define_name) },
-	{ "PasteNames", GTK_STOCK_PASTE, N_("_Paste..."),
-		"F3", N_("Paste the definition of a name or names"),
-		G_CALLBACK (cb_paste_names) },
 #if 0
 	{ "EditGenerateName", NULL,  N_("_Auto generate names..."),
 		NULL, N_("Use the current selection to create names"),
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 7ce4e59..b1dd53d 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -1540,8 +1540,10 @@ wbcg_menu_state_update (WorkbookControl *wbc, int flags)
 		wbc_gtk_set_action_sensitivity (wbcg, "FilePageSetup", !has_guru);
 	if (MS_SEARCH_REPLACE & flags)
 		wbc_gtk_set_action_sensitivity (wbcg, "EditReplace", !has_guru);
-	if (MS_DEFINE_NAME & flags)
+	if (MS_DEFINE_NAME & flags) {
 		wbc_gtk_set_action_sensitivity (wbcg, "EditNames", !has_guru);
+		wbc_gtk_set_action_sensitivity (wbcg, "PasteNames", !has_guru);
+	}
 	if (MS_CONSOLIDATE & flags)
 		wbc_gtk_set_action_sensitivity (wbcg, "DataConsolidate", !has_guru);
 	if (MS_FILTER_STATE_CHANGED & flags)



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