[gnumeric] Add "Don't change formulae" to paste special. [#123326]



commit 599895ae34851a58c858cf799dae10361e96f4b0
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Wed Dec 30 18:56:02 2009 -0700

    Add "Don't change formulae" to paste special. [#123326]
    
    2009-12-30 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* dialog-paste-special.c (dont_change_formulae_set_sensitive):
    	new
    	(dialog_paste_special_type_toggled_cb): connect
    	  dont_change_formulae_set_sensitive
    	(dialog_paste_special_cell_op_toggled_cb): ditto
    	(cb_tool_ok_clicked): check dont-change-formulae
    	* paste-special.glade: add dont-change-formulae check

 NEWS                               |    1 +
 src/dialogs/ChangeLog              |   10 ++++++
 src/dialogs/dialog-paste-special.c |   15 +++++++++
 src/dialogs/paste-special.glade    |   58 ++++++++++++++++++++++++------------
 4 files changed, 65 insertions(+), 19 deletions(-)
---
diff --git a/NEWS b/NEWS
index 869798e..a784102 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,7 @@ Andreas:
 	* Have the formula guru auto-quote unparsable expressions. [#442941]
 	* Create default tip for hyperlinks. [#316974]
 	* Add GET.LINK. [#128534]
+	* Add "Don't change formulae" to paste special. [#123326]
 
 Jean
 	* Fix import export of line type in scatter plots. [#605043]
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 49ad02f..fd1c714 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,15 @@
 2009-12-30 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* dialog-paste-special.c (dont_change_formulae_set_sensitive): 
+	new
+	(dialog_paste_special_type_toggled_cb): connect 
+	  dont_change_formulae_set_sensitive
+	(dialog_paste_special_cell_op_toggled_cb): ditto
+	(cb_tool_ok_clicked): check dont-change-formulae
+	* paste-special.glade: add dont-change-formulae check
+
+2009-12-30 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* dialog-paste-special.c (skip_blanks_set_sensitive): new
 	(dialog_paste_special_type_toggled_cb): connect 
 	  skip_blanks_set_sensitive
diff --git a/src/dialogs/dialog-paste-special.c b/src/dialogs/dialog-paste-special.c
index 708b27d..9f75654 100644
--- a/src/dialogs/dialog-paste-special.c
+++ b/src/dialogs/dialog-paste-special.c
@@ -128,6 +128,16 @@ skip_blanks_set_sensitive (PasteSpecialState *state)
 }
 
 static void
+dont_change_formulae_set_sensitive (PasteSpecialState *state)
+{
+	GtkWidget *button = glade_xml_get_widget (state->gui,"dont-change-formulae");
+	gboolean sensitive =
+		(2 > gnumeric_glade_group_value (state->gui, paste_type_group)
+		 && 0 == gnumeric_glade_group_value (state->gui, cell_operation_group));
+	gtk_widget_set_sensitive (button, sensitive);
+}
+
+static void
 cb_destroy (PasteSpecialState *state)
 {
 	if (state->gui != NULL)
@@ -149,6 +159,7 @@ dialog_paste_special_type_toggled_cb (GtkWidget *button, PasteSpecialState *stat
 						  permit_cell_ops);
 		paste_link_set_sensitive (state);
 		skip_blanks_set_sensitive (state);		
+		dont_change_formulae_set_sensitive (state);		
 	}
 }
 
@@ -158,6 +169,7 @@ dialog_paste_special_cell_op_toggled_cb (GtkWidget *button, PasteSpecialState *s
 	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) {
 		paste_link_set_sensitive (state);		
 		skip_blanks_set_sensitive (state);		
+		dont_change_formulae_set_sensitive (state);		
 	}
 }
 
@@ -201,6 +213,9 @@ cb_tool_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
 	if (gtk_toggle_button_get_active 
 	    (GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui,"skip-blanks"))))
 		result |= PASTE_SKIP_BLANKS;
+	if (gtk_toggle_button_get_active 
+	    (GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->gui,"dont-change-formulae"))))
+		result |= PASTE_EXPR_LOCAL_RELOCATE;
 
 	cmd_paste_to_selection (WORKBOOK_CONTROL (state->wbcg), state->sv, result);
 	gtk_widget_destroy (state->dialog);
diff --git a/src/dialogs/paste-special.glade b/src/dialogs/paste-special.glade
index 077ee30..56c88e3 100644
--- a/src/dialogs/paste-special.glade
+++ b/src/dialogs/paste-special.glade
@@ -1,7 +1,5 @@
 <?xml version="1.0"?>
 <glade-interface>
-  <!-- interface-requires gtk+ 2.6 -->
-  <!-- interface-naming-policy toplevel-contextual -->
   <widget class="GtkDialog" id="paste-special">
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Paste Special</property>
@@ -161,7 +159,6 @@
                           <widget class="GtkRadioButton" id="region-operation-flip-h">
                             <property name="label" translatable="yes">Flip Hori_zontally</property>
                             <property name="visible">True</property>
-                            <property name="sensitive">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
@@ -176,7 +173,6 @@
                           <widget class="GtkRadioButton" id="region-operation-flip-v">
                             <property name="label" translatable="yes">Fli_p Vertically</property>
                             <property name="visible">True</property>
-                            <property name="sensitive">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
@@ -211,21 +207,6 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkCheckButton" id="skip-blanks">
-                <property name="label" translatable="yes">Skip _Blanks</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">False</property>
-                <property name="use_underline">True</property>
-                <property name="draw_indicator">True</property>
-              </widget>
-              <packing>
-                <property name="right_attach">3</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-              </packing>
-            </child>
-            <child>
               <widget class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
                 <property name="label_xalign">0</property>
@@ -327,6 +308,45 @@
                 <property name="right_attach">2</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkCheckButton" id="skip-blanks">
+                    <property name="label" translatable="yes">Skip _Blanks</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkCheckButton" id="dont-change-formulae">
+                    <property name="label" translatable="yes">D_o not change formul&#xE6;</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="right_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="position">1</property>



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