Commit bc0abee0 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow

some cleanup

parent 55be42f8
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/analysis-tools.h : add `warning' to GENERIC_TOOL_STATE
and some clean-up
2002-01-31 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_focus_cur_scg) : warning
......
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/analysis-tools.h : add `warning' to GENERIC_TOOL_STATE
and some clean-up
2002-01-31 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_focus_cur_scg) : warning
......
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/analysis-tools.h : add `warning' to GENERIC_TOOL_STATE
and some clean-up
2002-01-31 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_focus_cur_scg) : warning
......
2002-01-26 Andreas Guelzow <aguelzow@taliesin.ca>
* POTFILES.in : added src/dialogs/dialog-sheet-name.c
2002-01-31 Christophe Merlet <redfox@eikonex.org>
* fr.po: Updated French translation from work of
......
......@@ -94,6 +94,7 @@ src/dialogs/dialog-plugin-manager.c
src/dialogs/dialog-printer-setup.c
src/dialogs/dialog-search-replace.c
src/dialogs/dialog-search.c
src/dialogs/dialog-sheet-name.c
src/dialogs/dialog-sheet-order.c
src/dialogs/dialog-simple-input.c
src/dialogs/dialog-solver.c
......
......@@ -15,20 +15,13 @@ typedef enum {
GROUPED_BY_BIN = 3
} group_by_t;
static const char *grouped_by_group[] = {
"grouped_by_row",
"grouped_by_col",
"grouped_by_area",
0
};
static const char *output_group[] = {
"newsheet-button",
"newworkbook-button",
"outputrange-button",
"inplace-button", /* only in advanced filter */
0
#define ANALYSISTOOLS_OUTPUT_GROUP static const char *output_group[] = {\
"newsheet-button",\
"newworkbook-button",\
"outputrange-button",\
"inplace-button", /* only in advanced filter */\
0\
};
typedef struct {
......@@ -192,6 +185,7 @@ Value *gnumeric_expr_entry_parse_to_value (GnumericExprEntry *ee, Sheet *sheet);
gboolean tool_destroy (GtkObject *w, GenericToolState *state);
void tool_set_focus (GtkWidget *window, GtkWidget *focus_widget, GenericToolState *state);
void dialog_tool_init_outputs (GenericToolState *state, GtkSignalFunc sensitivity_cb);
void dialog_tool_init_buttons (GenericToolState *state, GtkSignalFunc ok_function);
void error_in_entry (GenericToolState *state, GtkWidget *entry, const char *err_str);
int parse_output (GenericToolState *state, data_analysis_output_t *dao);
......
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* Makefile.am : add dialog-sheet-name.c
* dialog-sheet-name.c : extracted from dialog-simple-input.c
* dialog-advanced-filter.c : clean-up
* dialog-analysis-tools.c : clean-up
* dialog-autosave.c : clean-up
* dialog-consolidate.c : clean-up
* dialog-simple-input.c : clean-up
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* advanced-filter.glade : add padding to warnings
* dialog-advanced-filter.c (advanced_filter_ok_clicked_cb) :
provide information dialog if no records are found
(advanced_filter) : ditto
(advanced_filter_update_sensitivity_cb) : provide information
messages in warning label
* dialog-sheet-order.c (populate_sheet_list) : disable drag
starts in sheet list and desensitize column header
2002-01-31 Andreas J. Guelzow <aguelzow@taliesin.ca>
* advanced-filter.glade : port to gnome2 and redesign
......
......@@ -45,6 +45,7 @@ base_files = \
dialog-printer-setup.c \
dialog-search.c \
dialog-search-replace.c \
dialog-sheet-name.c \
dialog-sheet-order.c \
dialog-simple-input.c \
dialog-solver.c \
......
......@@ -20,6 +20,7 @@
#include <gui-util.h>
#include <analysis-tools.h>
#include <value.h>
#include <workbook-edit.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
......@@ -32,6 +33,8 @@
#define ADVANCED_FILTER_KEY "advanced-filter-dialog"
ANALYSISTOOLS_OUTPUT_GROUP /* defined in analysis-tools.h */
typedef struct {
GENERIC_TOOL_STATE
} AdvancedFilterState;
......
......@@ -57,6 +57,14 @@
#define ANOVA_SINGLE_KEY "analysistools-anova-single-factor-dialog"
#define RANDOM_KEY "analysistools-random-dialog"
ANALYSISTOOLS_OUTPUT_GROUP /* defined in analysis-tools.h */
static const char *grouped_by_group[] = {
"grouped_by_row",
"grouped_by_col",
"grouped_by_area",
0
};
typedef struct {
GENERIC_TOOL_STATE
......
......@@ -197,6 +197,8 @@ dialog_autosave (WorkbookControlGUI *wbcg)
GTK_SIGNAL_FUNC (cb_autosave_cancel), state);
gtk_signal_connect (GTK_OBJECT (state->help_button), "clicked",
GTK_SIGNAL_FUNC (cb_autosave_help), state);
gtk_signal_connect (GTK_OBJECT (state->dialog), "destroy",
GTK_SIGNAL_FUNC (dialog_autosave_destroy), state);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->autosave_on_off),
wbcg->autosave);
......
......@@ -101,7 +101,6 @@ construct_consolidate (ConsolidateState *state)
Consolidate *cs = consolidate_new ();
ConsolidateMode mode = 0;
char *func;
Range r;
Value *range_value;
int i;
......@@ -370,6 +369,7 @@ cb_delete_clicked (GtkButton *button, ConsolidateState *state)
dialog_set_button_sensitivity (NULL, state);
}
static void
cb_help_clicked (GtkButton *button, ConsolidateState *state)
{
gnumeric_help_display (CONSOLIDATE_HELP);
......
/*
* dialog-simple-input.c: Implements various dialogs for simple
* input values
*
* Authors:
* Andreas J. Guelzow <aguelzow@taliesin.ca>
*
* Copyright (c) 2002 Andreas J. Guelzow <aguelzow@taliesin.ca>
*
* 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 "dialogs.h"
#include <sheet.h>
#include <workbook-edit.h>
#include <gui-util.h>
#include <workbook.h>
#include <commands.h>
#include <math.h>
#include <glade/glade.h>
#include <libgnome/gnome-i18n.h>
#define SHEET_NAME_CHANGE_DIALOG_KEY "sheet-name-change-dialog"
typedef struct {
WorkbookControlGUI *wbcg;
GtkWidget *dialog;
GtkWidget *entry;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GladeXML *gui;
} SheetNameChangeState;
/**
* sheet_name_destroy:
* @window:
* @state:
*
* Destroy the dialog and associated data structures.
*
**/
static gboolean
sheet_name_destroy (GtkObject *w, SheetNameChangeState *state)
{
g_return_val_if_fail (w != NULL, FALSE);
g_return_val_if_fail (state != NULL, FALSE);
wbcg_edit_detach_guru (state->wbcg);
if (state->gui != NULL) {
g_object_unref (G_OBJECT (state->gui));
state->gui = NULL;
}
state->dialog = NULL;
g_free (state);
return FALSE;
}
static void
cb_sheet_name_ok_clicked (GtkWidget *button, SheetNameChangeState *state)
{
WorkbookControl *wbc = WORKBOOK_CONTROL (state->wbcg);
Sheet *sheet = wb_control_cur_sheet (wbc);
char const *new_name;
new_name = gtk_entry_get_text (GTK_ENTRY (state->entry));
cmd_rename_sheet (wbc, sheet->name_unquoted, new_name);
gtk_widget_destroy (state->dialog);
return;
}
static void
cb_sheet_name_cancel_clicked (GtkWidget *button, SheetNameChangeState *state)
{
gtk_widget_destroy (state->dialog);
return;
}
void
dialog_sheet_name (WorkbookControlGUI *wbcg)
{
SheetNameChangeState *state;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
Sheet *sheet = wb_control_cur_sheet (wbc);
g_return_if_fail (wbcg != NULL);
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_NAME_CHANGE_DIALOG_KEY))
return;
state = g_new (SheetNameChangeState, 1);
state->wbcg = wbcg;
state->gui = gnumeric_glade_xml_new (wbcg, "sheet-rename.glade");
g_return_if_fail (state->gui != NULL);
state->dialog = glade_xml_get_widget (state->gui, "dialog");
if (state->dialog == NULL) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Sheet Name Change dialog."));
g_free (state);
return ;
}
state->ok_button = glade_xml_get_widget (state->gui, "okbutton");
gtk_signal_connect (GTK_OBJECT (state->ok_button), "clicked",
GTK_SIGNAL_FUNC (cb_sheet_name_ok_clicked),
state);
state->cancel_button = glade_xml_get_widget (state->gui, "cancelbutton");
gtk_signal_connect (GTK_OBJECT (state->cancel_button), "clicked",
GTK_SIGNAL_FUNC (cb_sheet_name_cancel_clicked),
state);
state->entry = glade_xml_get_widget (state->gui, "entry");
gtk_entry_set_text (GTK_ENTRY (state->entry), sheet->name_unquoted);
gtk_editable_select_region (GTK_EDITABLE (state->entry), 0, -1);
gnumeric_editable_enters (GTK_WINDOW (state->dialog), GTK_EDITABLE (state->entry));
gtk_signal_connect (GTK_OBJECT (state->dialog), "destroy",
GTK_SIGNAL_FUNC (sheet_name_destroy), state);
wbcg_edit_attach_guru (state->wbcg, state->dialog);
gnumeric_keyed_dialog (wbcg, GTK_WINDOW (state->dialog),
SHEET_NAME_CHANGE_DIALOG_KEY);
gtk_widget_show (state->dialog);
gtk_widget_grab_focus (state->entry);
}
......@@ -9,14 +9,13 @@
#include <gnumeric-config.h>
#include <gnumeric.h>
#include "dialogs.h"
#include <sheet.h>
#include <gui-util.h>
#include <workbook.h>
#include <math.h>
#include <glade/glade.h>
#include <libgnome/gnome-i18n.h>
#include <sheet.h>
gboolean
dialog_choose_cols_vs_rows (WorkbookControlGUI *wbcg, const char *title,
......@@ -108,114 +107,6 @@ dialog_get_number (WorkbookControlGUI *wbcg,
return res;
}
#define SHEET_NAME_CHANGE_DIALOG_KEY "sheet-name-change-dialog"
typedef struct {
WorkbookControlGUI *wbcg;
GtkWidget *dialog;
GtkWidget *entry;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GladeXML *gui;
} SheetNameChangeState;
/**
* sheet_name_destroy:
* @window:
* @state:
*
* Destroy the dialog and associated data structures.
*
**/
static gboolean
sheet_name_destroy (GtkObject *w, SheetNameChangeState *state)
{
g_return_val_if_fail (w != NULL, FALSE);
g_return_val_if_fail (state != NULL, FALSE);
wbcg_edit_detach_guru (state->wbcg);
if (state->gui != NULL) {
g_object_unref (G_OBJECT (state->gui));
state->gui = NULL;
}
state->dialog = NULL;
g_free (state);
return FALSE;
}
static void
cb_sheet_name_ok_clicked (GtkWidget *button, SheetNameChangeState *state)
{
WorkbookControl *wbc = WORKBOOK_CONTROL (state->wbcg);
Sheet *sheet = wb_control_cur_sheet (wbc);
char const *new_name;
new_name = gtk_entry_get_text (GTK_ENTRY (state->entry));
cmd_rename_sheet (wbc, sheet->name_unquoted, new_name);
gtk_widget_destroy (state->dialog);
return;
}
static void
cb_sheet_name_cancel_clicked (GtkWidget *button, SheetNameChangeState *state)
{
gtk_widget_destroy (state->dialog);
return;
}
void
dialog_sheet_name (WorkbookControlGUI *wbcg)
{
SheetNameChangeState *state;
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
Sheet *sheet = wb_control_cur_sheet (wbc);
g_return_if_fail (wbcg != NULL);
if (gnumeric_dialog_raise_if_exists (wbcg, SHEET_NAME_CHANGE_DIALOG_KEY))
return;
state = g_new (SheetNameChangeState, 1);
state->wbcg = wbcg;
state->gui = gnumeric_glade_xml_new (wbcg, "sheet-rename.glade");
g_return_if_fail (state->gui != NULL);
state->dialog = glade_xml_get_widget (state->gui, "dialog");
if (state->dialog == NULL) {
gnumeric_notice (wbcg, GTK_MESSAGE_ERROR,
_("Could not create the Sheet Name Change dialog."));
g_free (state);
return ;
}
state->ok_button = glade_xml_get_widget (state->gui, "okbutton");
gtk_signal_connect (GTK_OBJECT (state->ok_button), "clicked",
GTK_SIGNAL_FUNC (cb_sheet_name_ok_clicked),
state);
state->cancel_button = glade_xml_get_widget (state->gui, "cancelbutton");
gtk_signal_connect (GTK_OBJECT (state->cancel_button), "clicked",
GTK_SIGNAL_FUNC (cb_sheet_name_cancel_clicked),
state);
state->entry = glade_xml_get_widget (state->gui, "entry");
gtk_entry_set_text (GTK_ENTRY (state->entry), sheet->name_unquoted);
gtk_editable_select_region (GTK_EDITABLE (state->entry), 0, -1);
gnumeric_editable_enters (GTK_WINDOW (state->dialog), GTK_EDITABLE (state->entry));
gtk_signal_connect (GTK_OBJECT (state->dialog), "destroy",
GTK_SIGNAL_FUNC (sheet_name_destroy), state);
wbcg_edit_attach_guru (state->wbcg, state->dialog);
gnumeric_keyed_dialog (wbcg, GTK_WINDOW (state->dialog),
SHEET_NAME_CHANGE_DIALOG_KEY);
gtk_widget_show (state->dialog);
gtk_widget_grab_focus (state->entry);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment