[gnumeric] Get rid of new-sized-sheet dialog.



commit 5fb172e8d2f5599f8ffa45d67444de254a314606
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 20 09:54:19 2009 -0400

    Get rid of new-sized-sheet dialog.
---
 src/GNOME_Gnumeric-gtk.xml.in  |    1 -
 src/dialogs/Makefile.am        |    7 +-
 src/dialogs/dialog-new-sheet.c |   87 -----------------
 src/dialogs/dialog-new-sheet.h |   31 ------
 src/dialogs/new-sheet.glade    |  208 ----------------------------------------
 src/wbc-gtk-actions.c          |    3 -
 src/wbc-gtk-impl.h             |    1 -
 src/wbc-gtk.c                  |   50 ----------
 8 files changed, 2 insertions(+), 386 deletions(-)

diff --git a/src/GNOME_Gnumeric-gtk.xml.in b/src/GNOME_Gnumeric-gtk.xml.in
index 2b0be89..eb0500c 100644
--- a/src/GNOME_Gnumeric-gtk.xml.in
+++ b/src/GNOME_Gnumeric-gtk.xml.in
@@ -97,7 +97,6 @@
       <menuitem action="InsertColumns"/>
       <menuitem action="InsertRows"/>
       <menuitem action="SheetInsert"/>
-      <menuitem action="SheetSizedInsert"/>
       <separator/>
       <menuitem action="ChartGuru"/>
 <!-- These don't work yet for Gnome 2 
diff --git a/src/dialogs/Makefile.am b/src/dialogs/Makefile.am
index 511fd8b..304c050 100644
--- a/src/dialogs/Makefile.am
+++ b/src/dialogs/Makefile.am
@@ -83,9 +83,7 @@ base_files =					\
 	dialog-zoom.c				\
 	dialogs.h				\
 	tool-dialogs.h				\
-	dialog-printer-setup.c	\
-	dialog-new-sheet.c	\
-	dialog-new-sheet.h
+	dialog-printer-setup.c
 
 gladedir   = $(gnumeric_datadir)/glade
 glade_DATA = 				\
@@ -156,7 +154,6 @@ glade_DATA = 				\
 	variance-tests.glade		\
 	view.glade			\
 	workbook-attr.glade		\
-	print.glade	\
-	new-sheet.glade
+	print.glade
 
 EXTRA_DIST = $(glade_DATA)
diff --git a/src/dialogs/dialog-new-sheet.c b/src/dialogs/dialog-new-sheet.c
deleted file mode 100644
index 93cd20d..0000000
--- a/src/dialogs/dialog-new-sheet.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * dialog-new-sheet.c:
- *
- * Author: Jean Brefort <jean brefort normalesup org>
- *
- * (C) Copyright 2008 by Jean Brefort <jean brefort normalesup org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **/
-#include <gnumeric-config.h>
-#include <gnumeric.h>
-#include "dialog-new-sheet.h"
-#include <wbc-gtk.h>
-#include <gui-util.h>
-
-static void
-cb_columns_changed (GtkSpinButton *btn, struct NewSheetState *state)
-{
-	state->columns = gtk_spin_button_get_value_as_int (btn);
-}
-
-static void
-cb_rows_changed (GtkSpinButton *btn, struct NewSheetState *state)
-{
-	state->rows = gtk_spin_button_get_value_as_int (btn);
-}
-
-static void
-cb_position_changed (GtkComboBox *box, struct NewSheetState *state)
-{
-	state->position = gtk_combo_box_get_active (box);
-}
-
-static void
-cb_name_changed (GtkEntry *entry, struct NewSheetState *state)
-{
-	g_free (state->name);
-	state->name = g_strdup (gtk_entry_get_text (entry));
-}
-
-static void
-cb_activation_changed (GtkToggleButton *btn, struct NewSheetState *state)
-{
-	state->activate = gtk_toggle_button_get_active (btn);
-}
-
-GtkWidget *
-dialog_new_sheet (WBCGtk *wbcg, struct NewSheetState *state)
-{
-	GtkWidget *w;
-	GladeXML *gui;
-
-	g_return_val_if_fail (wbcg != NULL, NULL);
-
-	gui = gnm_glade_xml_new (GO_CMD_CONTEXT (wbcg),
-		"new-sheet.glade", NULL, NULL);
-	w = glade_xml_get_widget (gui, "columns");
-	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), state->columns);
-	g_signal_connect (w, "value-changed", G_CALLBACK (cb_columns_changed), state);
-	w = glade_xml_get_widget (gui, "rows");
-	gtk_spin_button_set_value (GTK_SPIN_BUTTON (w), state->rows);
-	g_signal_connect (w, "value-changed", G_CALLBACK (cb_rows_changed), state);
-	w = glade_xml_get_widget (gui, "position");
-	gtk_combo_box_set_active (GTK_COMBO_BOX (w), state->position);
-	g_signal_connect (w, "changed", G_CALLBACK (cb_position_changed), state);
-	w = glade_xml_get_widget (gui, "name");
-	gtk_entry_set_text (GTK_ENTRY (w), state->name);
-	g_signal_connect (w, "changed", G_CALLBACK (cb_name_changed), state);
-	w = glade_xml_get_widget (gui, "activate");
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), state->activate);
-	g_signal_connect (w, "toggled", G_CALLBACK (cb_activation_changed), state);
-
-        return glade_xml_get_widget (gui, "new_sheet");
-}
diff --git a/src/dialogs/dialog-new-sheet.h b/src/dialogs/dialog-new-sheet.h
deleted file mode 100644
index f053827..0000000
--- a/src/dialogs/dialog-new-sheet.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-#ifndef GNUMERIC_DIALOG_NEW_SHEET_H
-#define GNUMERIC_DIALOG_NEW_SHEET_H
-
-#include "gui-gnumeric.h"
-#include <gtk/gtk.h>
-
-struct NewSheetState
-{
-	int columns, rows, position;
-	char *name;
-	gboolean activate;
-};
-
-GtkWidget* dialog_new_sheet (WBCGtk *wbcg, struct NewSheetState *state);
-
-#endif
diff --git a/src/dialogs/new-sheet.glade b/src/dialogs/new-sheet.glade
deleted file mode 100644
index d93bc33..0000000
--- a/src/dialogs/new-sheet.glade
+++ /dev/null
@@ -1,208 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--*- mode: xml -*-->
-<glade-interface>
-  <widget class="GtkDialog" id="new_sheet">
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes">New sheet</property>
-    <property name="modal">True</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox1">
-        <property name="visible">True</property>
-        <property name="spacing">8</property>
-        <child>
-          <widget class="GtkAlignment" id="alignment1">
-            <property name="visible">True</property>
-            <property name="xscale">0.75</property>
-            <child>
-              <widget class="GtkTable" id="table1">
-                <property name="visible">True</property>
-                <property name="n_rows">6</property>
-                <property name="n_columns">2</property>
-                <property name="column_spacing">15</property>
-                <property name="row_spacing">5</property>
-                <child>
-                  <widget class="GtkEntry" id="name">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">4</property>
-                    <property name="bottom_attach">5</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkCheckButton" id="activate">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="label" translatable="yes">_Activate new sheet</property>
-                    <property name="use_underline">True</property>
-                    <property name="response_id">0</property>
-                    <property name="draw_indicator">True</property>
-                  </widget>
-                  <packing>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">5</property>
-                    <property name="bottom_attach">6</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label5">
-                    <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes">_Name:</property>
-                    <property name="use_underline">True</property>
-                    <property name="wrap_mode">PANGO_WRAP_WORD_CHAR</property>
-                    <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">4</property>
-                    <property name="bottom_attach">5</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">New sheet properties</property>
-                  </widget>
-                  <packing>
-                    <property name="right_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkSpinButton" id="rows">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="adjustment">65536 1 16777216 8192 65536 0</property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkSpinButton" id="columns">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="adjustment">256 1 4096 64 256 0</property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label2">
-                    <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes">_Rows:</property>
-                    <property name="use_underline">True</property>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label1">
-                    <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes">Colu_mns:</property>
-                    <property name="use_underline">True</property>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label4">
-                    <property name="visible">True</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes">_Position:</property>
-                    <property name="use_underline">True</property>
-                    <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
-                    <property name="width_chars">0</property>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkComboBox" id="position">
-                    <property name="visible">True</property>
-                    <property name="items" translatable="yes">Start
-Before current
-After current
-End
-</property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="y_options"></property>
-                  </packing>
-                </child>
-              </widget>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <widget class="GtkButton" id="cancelbutton">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="label">gtk-cancel</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">0</property>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkButton" id="okbutton">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="label">gtk-ok</property>
-                <property name="use_stock">True</property>
-                <property name="response_id">-5</property>
-              </widget>
-              <packing>
-                <property name="position">2</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-</glade-interface>
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index abe0a28..c9bad02 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1873,9 +1873,6 @@ static GtkActionEntry const actions[] = {
 	{ "SheetInsert", NULL, N_("_Sheet"),
 		NULL, N_("Insert a new sheet"),
 		G_CALLBACK (wbcg_insert_sheet) },
-	{ "SheetSizedInsert", NULL, N_("Sheet with si_ze..."),
-		NULL, N_("Insert a new sheet with a specific size"),
-		G_CALLBACK (wbcg_insert_sized_sheet) },
 	{ "InsertSheetAtEnd", NULL, N_("_Append"),
 		NULL, N_("Append a new sheet"),
 		G_CALLBACK (wbcg_append_sheet) },
diff --git a/src/wbc-gtk-impl.h b/src/wbc-gtk-impl.h
index ab15ece..17de7bf 100644
--- a/src/wbc-gtk-impl.h
+++ b/src/wbc-gtk-impl.h
@@ -157,7 +157,6 @@ typedef struct {
 /* Protected functions */
 gboolean wbc_gtk_close		(WBCGtk *wbcg);
 void	 wbcg_insert_sheet	(GtkWidget *ignored, WBCGtk *wbcg);
-void	 wbcg_insert_sized_sheet(GtkWidget *ignored, WBCGtk *wbcg);
 void	 wbcg_append_sheet	(GtkWidget *ignored, WBCGtk *wbcg);
 void	 wbcg_clone_sheet	(GtkWidget *ignored, WBCGtk *wbcg);
 
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 2ef6cd4..d1f7c16 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -55,7 +55,6 @@
 #include "gnm-pane-impl.h"
 #include "graph.h"
 #include "selection.h"
-#include "dialogs/dialog-new-sheet.h"
 
 #include <goffice/graph/gog-data-allocator.h>
 #include <goffice/graph/gog-data-set.h>
@@ -409,52 +408,6 @@ wbcg_insert_sheet (GtkWidget *unused, WBCGtk *wbcg)
 }
 
 void
-wbcg_insert_sized_sheet (GtkWidget *unused, WBCGtk *wbcg)
-{
-	WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
-	Sheet *sheet = wb_control_cur_sheet (wbc);
-	Workbook *wb = sheet->workbook;
-	WorkbookSheetState *old_state;
-	struct NewSheetState state;
-	GtkWidget *w;
-	state.columns = gnm_sheet_get_max_cols (sheet);
-	state.rows = gnm_sheet_get_max_rows (sheet);
-	state.position = 1;
-	state.name = workbook_sheet_get_free_name (wb, _("Sheet"), TRUE, FALSE);
-	state.activate = TRUE;
-	w = dialog_new_sheet (wbcg, &state);
-	if (gtk_dialog_run (GTK_DIALOG (w)) == GTK_RESPONSE_OK) {
-		int index;
-		Sheet *new_sheet;
-		switch (state.position) {
-		case 0:
-			index = 0;
-			break;
-		case 1:
-			index = sheet->index_in_wb;
-			break;
-		case 2:
-			index = sheet->index_in_wb + 1;
-			break;
-		case 3:
-			index = workbook_sheet_count (wb);
-			break;
-		default:
-			index = sheet->index_in_wb;
-			break;
-		}
-		old_state = workbook_sheet_state_new (wb);
-		new_sheet = workbook_sheet_add (wb, index, state.columns, state.rows);
-		cmd_reorganize_sheets (wbc, old_state, sheet);
-		if (state.name && strlen (state.name))
-			g_object_set (new_sheet, "name", state.name, NULL);
-		if (state.activate)
-			wb_control_sheet_focus (wbc, new_sheet);
-	}
-	gtk_widget_destroy (w);
-}
-
-void
 wbcg_append_sheet (GtkWidget *unused, WBCGtk *wbcg)
 {
 	WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
@@ -4902,9 +4855,6 @@ wbc_gtk_init (GObject *obj)
 	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]