gnumeric r17279 - in trunk: . src src/dialogs



Author: mortenw
Date: Wed Apr  1 23:24:04 2009
New Revision: 17279
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17279&view=rev

Log:
2009-04-01  Morten Welinder  <terra gnome org>

	* src/wbc-gtk.c (wbc_gtk_init): Disabled SheetSizedInsert as
	appropriately.



Modified:
   trunk/ChangeLog
   trunk/src/GNOME_Gnumeric-gtk.xml.in
   trunk/src/dialogs/new-sheet.glade
   trunk/src/main-application.c
   trunk/src/wbc-gtk-actions.c
   trunk/src/wbc-gtk.c

Modified: trunk/src/GNOME_Gnumeric-gtk.xml.in
==============================================================================
--- trunk/src/GNOME_Gnumeric-gtk.xml.in	(original)
+++ trunk/src/GNOME_Gnumeric-gtk.xml.in	Wed Apr  1 23:24:04 2009
@@ -97,7 +97,7 @@
       <menuitem action="InsertColumns"/>
       <menuitem action="InsertRows"/>
       <menuitem action="SheetInsert"/>
-<!--  <menuitem action="SheetSizedInsert"/> -->
+      <menuitem action="SheetSizedInsert"/>
       <separator/>
       <menuitem action="ChartGuru"/>
 <!-- These don't work yet for Gnome 2 

Modified: trunk/src/dialogs/new-sheet.glade
==============================================================================
--- trunk/src/dialogs/new-sheet.glade	(original)
+++ trunk/src/dialogs/new-sheet.glade	Wed Apr  1 23:24:04 2009
@@ -78,7 +78,7 @@
                   <widget class="GtkSpinButton" id="rows">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="adjustment">65536 1 16777216 8192 65536 65536</property>
+                    <property name="adjustment">65536 1 16777216 8192 65536 0</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
@@ -91,7 +91,7 @@
                   <widget class="GtkSpinButton" id="columns">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
-                    <property name="adjustment">256 1 4096 64 256 256</property>
+                    <property name="adjustment">256 1 4096 64 256 0</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>

Modified: trunk/src/main-application.c
==============================================================================
--- trunk/src/main-application.c	(original)
+++ trunk/src/main-application.c	Wed Apr  1 23:24:04 2009
@@ -89,7 +89,7 @@
 		N_("Minimum number of rows"),
 		NULL
 	},
-	{ "cols", 'c', 0, G_OPTION_ARG_INT, &cols,
+	{ "columns", 'c', 0, G_OPTION_ARG_INT, &cols,
 		N_("Minimum number of columns"),
 		NULL
 	},
@@ -396,9 +396,22 @@
 		return gnm_dump_func_defs (func_def_file, 1);
 	if (split_funcdocs)
 		return gnm_dump_func_defs (NULL, 2);
-	while ((gnm_sheet_max_cols < cols) && (gnm_sheet_max_cols < GNM_MAX_COLS))
+
+	if (g_getenv ("GNUMERIC_SHEET_SIZE") == NULL &&
+	    (cols || rows)) {
+		g_printerr ("The \"columns\" and \"rows\" options are not enabled yet.\n");
+		cols = rows = 0;
+	}
+
+	/*
+	 * Increase gnm_sheet_max_(cols|rows) by factors of two until they are
+	 *  big enough to hold the requested number of rows.
+	 */
+	while (gnm_sheet_max_cols < cols &&
+	       gnm_sheet_max_cols <= GNM_MAX_COLS / 2)
 		gnm_sheet_max_cols <<= 1;
-	while ((gnm_sheet_max_rows < rows) && (gnm_sheet_max_rows < GNM_MAX_ROWS))
+	while (gnm_sheet_max_rows < rows &&
+	       gnm_sheet_max_rows <= GNM_MAX_ROWS / 2)
 		gnm_sheet_max_rows <<= 1;
 
 	/* Keep in sync with .desktop file */

Modified: trunk/src/wbc-gtk-actions.c
==============================================================================
--- trunk/src/wbc-gtk-actions.c	(original)
+++ trunk/src/wbc-gtk-actions.c	Wed Apr  1 23:24:04 2009
@@ -1871,12 +1871,9 @@
 	{ "SheetInsert", NULL, N_("_Sheet"),
 		NULL, N_("Insert a new sheet"),
 		G_CALLBACK (wbcg_insert_sheet) },
-#ifdef GNUMERIC_VARIABLE_SHEET_SIZE
-	/* Not yet... */
 	{ "SheetSizedInsert", NULL, N_("Sheet with si_ze..."),
 		NULL, N_("Insert a new sheet with a specific size"),
 		G_CALLBACK (wbcg_insert_sized_sheet) },
-#endif
 	{ "InsertSheetAtEnd", NULL, N_("_Append"),
 		NULL, N_("Append a new sheet"),
 		G_CALLBACK (wbcg_append_sheet) },

Modified: trunk/src/wbc-gtk.c
==============================================================================
--- trunk/src/wbc-gtk.c	(original)
+++ trunk/src/wbc-gtk.c	Wed Apr  1 23:24:04 2009
@@ -4894,6 +4894,9 @@
 	wbc_gtk_set_toggle_action_state (wbcg, "ViewSheets", FALSE);
 	wbc_gtk_set_toggle_action_state (wbcg, "ViewStatusbar", FALSE);
 #endif
+
+	wbc_gtk_set_action_sensitivity (wbcg, "SheetSizedInsert",
+					g_getenv ("GNUMERIC_SHEET_SIZE") != NULL);
 }
 
 GSF_CLASS_FULL (WBCGtk, wbc_gtk, NULL, NULL, wbc_gtk_class_init, NULL,



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