Commit 39d5acca authored by Almer. S. Tigelaar's avatar Almer. S. Tigelaar Committed by Almer S. Tigelaar

: csv_page_custom_toggled was called twice, removed one.

2000-02-21 Almer. S. Tigelaar.  <almer1@dds.nl>

	* src/dialogs/dialog-stf-csv-page.c :
	(csv_page_prepare) : csv_page_custom_toggled was called twice, removed one.

	* src/stf.c, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf-main-page.c,
	* src/dialogs/dialog-stf-csv-page.c, src/dialogs/dialog-stf-fixed-page.c,
	* src/dialogs/dialog-stf-format-page.c, src/dialogs/dialog-stf-preview.c
	Fixed incorrect comments and added function comment headers where they
	didn't exist. Also moved some includes.

	* src/dialogs/dialog-stf.h
	Removed TEXT_VOFFSET, because it is no langer required.

	* src/dialogs/dialog-stf-preview.h
	Changed the colours to match the current gnumeric sheet selection color

	* src/dialogs/dialog-stf-format-page.c
	(format_page_collist_select_row) : Makes selected row visible
	(format_page_prepare) : Corrected minor error which caused the format entry to stay empty

	* src/dialogs/dialog-stf.glade, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf.h
	Completely removed the "finish" page of the druid.

	* src/dialogs/dialog-stf.glade, src/stf-parse.h, src/stf-parse.c
	Fixed support for colon and added support for new separator
	symbols : semicolon, pipe, slash, hyphen, bang.
	separators are now also displayed on the csv page.

	* src/stf-parse.c
	(stf_parse_get_colcount) : last line wasn't counted
	(stf_parse_get_colwidth) : idem

	* src/stf.h :
	Removed obsoleted FileSource_t struct type definition.

	* src/stf.c :
	(stf_read_workbook) : Detach sheet on parse error.
parent 3d6833f4
2000-02-21 Almer. S. Tigelaar. <almer1@dds.nl>
* src/dialogs/dialog-stf-csv-page.c :
(csv_page_prepare) : csv_page_custom_toggled was called twice, removed one.
* src/stf.c, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf-main-page.c,
* src/dialogs/dialog-stf-csv-page.c, src/dialogs/dialog-stf-fixed-page.c,
* src/dialogs/dialog-stf-format-page.c, src/dialogs/dialog-stf-preview.c
Fixed incorrect comments and added function comment headers where they
didn't exist. Also moved some includes.
* src/dialogs/dialog-stf.h
Removed TEXT_VOFFSET, because it is no langer required.
* src/dialogs/dialog-stf-preview.h
Changed the colours to match the current gnumeric sheet selection color
* src/dialogs/dialog-stf-format-page.c
(format_page_collist_select_row) : Makes selected row visible
(format_page_prepare) : Corrected minor error which caused the format entry to stay empty
* src/dialogs/dialog-stf.glade, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf.h
Completely removed the "finish" page of the druid.
* src/dialogs/dialog-stf.glade, src/stf-parse.h, src/stf-parse.c
Fixed support for colon and added support for new separator
symbols : semicolon, pipe, slash, hyphen, bang.
separators are now also displayed on the csv page.
* src/stf-parse.c
(stf_parse_get_colcount) : last line wasn't counted
(stf_parse_get_colwidth) : idem
* src/stf.h :
Removed obsoleted FileSource_t struct type definition.
* src/stf.c :
(stf_read_workbook) : Detach sheet on parse error.
2000-02-21 Jon K Hellan <hellan@acm.org>
......
2000-02-21 Almer. S. Tigelaar. <almer1@dds.nl>
* src/dialogs/dialog-stf-csv-page.c :
(csv_page_prepare) : csv_page_custom_toggled was called twice, removed one.
* src/stf.c, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf-main-page.c,
* src/dialogs/dialog-stf-csv-page.c, src/dialogs/dialog-stf-fixed-page.c,
* src/dialogs/dialog-stf-format-page.c, src/dialogs/dialog-stf-preview.c
Fixed incorrect comments and added function comment headers where they
didn't exist. Also moved some includes.
* src/dialogs/dialog-stf.h
Removed TEXT_VOFFSET, because it is no langer required.
* src/dialogs/dialog-stf-preview.h
Changed the colours to match the current gnumeric sheet selection color
* src/dialogs/dialog-stf-format-page.c
(format_page_collist_select_row) : Makes selected row visible
(format_page_prepare) : Corrected minor error which caused the format entry to stay empty
* src/dialogs/dialog-stf.glade, src/dialogs/dialog-stf.c, src/dialogs/dialog-stf.h
Completely removed the "finish" page of the druid.
* src/dialogs/dialog-stf.glade, src/stf-parse.h, src/stf-parse.c
Fixed support for colon and added support for new separator
symbols : semicolon, pipe, slash, hyphen, bang.
separators are now also displayed on the csv page.
* src/stf-parse.c
(stf_parse_get_colcount) : last line wasn't counted
(stf_parse_get_colwidth) : idem
* src/stf.h :
Removed obsoleted FileSource_t struct type definition.
* src/stf.c :
(stf_read_workbook) : Detach sheet on parse error.
2000-02-21 Jon K Hellan <hellan@acm.org>
......
......@@ -5,10 +5,6 @@
*
*/
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
#include "dialog-stf.h"
/*************************************************************************************************
......@@ -54,6 +50,11 @@ csv_page_global_change (GtkWidget *widget, DruidPageData_t *data)
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_colon)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_comma)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_space)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_semicolon)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_pipe)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_slash)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_hyphen)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_bang)),
customvalid);
textfieldtext = gtk_editable_get_chars (GTK_EDITABLE (info->csv_textfield), 0, -1);
......@@ -173,9 +174,6 @@ csv_page_prepare (GnomeDruidPage *page, GnomeDruid *druid, DruidPageData_t *page
/* Calling this routine will also automatically call global change which updates the preview too */
csv_page_custom_toggled (info->csv_custom, pagedata);
/* Calling this routine will also automatically call global change which updates the preview too */
csv_page_custom_toggled (info->csv_custom, pagedata);
}
/**
......@@ -229,6 +227,11 @@ csv_page_init (GladeXML *gui, DruidPageData_t *pagedata)
info->csv_colon = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_colon"));
info->csv_comma = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_comma"));
info->csv_space = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_space"));
info->csv_semicolon = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_semicolon"));
info->csv_pipe = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_pipe"));
info->csv_slash = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_slash"));
info->csv_hyphen = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_hyphen"));
info->csv_bang = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_bang"));
info->csv_custom = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "csv_custom"));
info->csv_customseparator = GTK_ENTRY (glade_xml_get_widget (gui, "csv_customseparator"));
......@@ -265,6 +268,26 @@ csv_page_init (GladeXML *gui, DruidPageData_t *pagedata)
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_semicolon),
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_pipe),
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_slash),
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_hyphen),
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_bang),
"toggled",
GTK_SIGNAL_FUNC (csv_page_global_change),
pagedata);
gtk_signal_connect (GTK_OBJECT (info->csv_custom),
"toggled",
GTK_SIGNAL_FUNC (csv_page_custom_toggled),
......
......@@ -5,11 +5,6 @@
*
*/
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
#include <stdlib.h>
#include "dialog-stf.h"
/*************************************************************************************************
......@@ -89,6 +84,17 @@ fixed_page_scroll_value_changed (GtkAdjustment *adjustment, DruidPageData_t *dat
fixed_page_update_preview (data);
}
/**
* fixed_page_canvas_motion_notify_event
* @canvas : The gnome canvas that emitted the signal
* @event : a gdk motion event struct
* @data : a mother struct
*
* This event handles the changing of the mouse cursor and
* re-sizing of columns
*
* returns : always TRUE
**/
static gboolean
fixed_page_canvas_motion_notify_event (GnomeCanvas *canvas, GdkEventMotion *event, DruidPageData_t *data)
{
......@@ -170,6 +176,18 @@ fixed_page_canvas_motion_notify_event (GnomeCanvas *canvas, GdkEventMotion *even
return TRUE;
}
/**
* fixed_page_canvas_motion_notify_event
* @canvas : The gnome canvas that emitted the signal
* @event : a gdk event button struct
* @data : a mother struct
*
* This handles single clicking/drag start events :
* 1) start of re-sizing of existing columns
* 2) removal of existing columns
*
* returns : always TRUE
**/
static gboolean
fixed_page_canvas_button_press_event (GnomeCanvas *canvas, GdkEventButton *event, DruidPageData_t *data)
{
......@@ -207,6 +225,16 @@ fixed_page_canvas_button_press_event (GnomeCanvas *canvas, GdkEventButton *event
return TRUE;
}
/**
* fixed_page_canvas_motion_notify_event
* @canvas : The gnome canvas that emitted the signal
* @event : a gdk event button struct
* @data : a mother struct
*
* This signal handler actually handles creating new columns
*
* returns : always TRUE
**/
static gboolean
fixed_page_canvas_button_release_event (GnomeCanvas *canvas, GdkEventButton *event, DruidPageData_t *data)
{
......
/*
* dialog-stf.c : Controls the widget on the format page of the dialog
* dialog-stf.c : Controls the widgets on the format page of the dialog
*
* Almer. S. Tigelaar <almer1@dds.nl>
*
*/
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
#include <string.h>
#include "dialog-stf-preview.h"
#include "dialog-stf.h"
/*************************************************************************************************
......@@ -19,32 +12,14 @@
*************************************************************************************************/
/**
* format_page_set_col_formatting
* @src : a filesource
* @format : A string specifying the cell format
* @column : The column to set the cell format for
* format_page_update_preview
* @pagedata : mother struct
*
* Sets the format of column @column in @sheet
*
* returns : nothing.
* Will simply utilize the preview rendering functions to update
* the preview
*
static void
format_page_set_col_formatting (FileSource_t *src, const char *format, int column)
{
MStyle *style = mstyle_new ();
Range range;
mstyle_set_format (style, format);
range.start.col = column;
range.start.row = 0;
range.end.col = column;
range.end.row = src->rowcount;
sheet_style_attach (src->sheet, range, style);
}*/
* returns : nothing
**/
static void
format_page_update_preview (DruidPageData_t *pagedata)
{
......@@ -144,7 +119,10 @@ format_page_collist_select_row (GtkCList *clist, int row, int column, GdkEventBu
if (!colformat) return;
stf_preview_set_activecolumn (info->format_run_renderdata, row);
if (gtk_clist_row_is_visible (info->format_collist, row) == GTK_VISIBILITY_NONE)
gtk_clist_moveto (info->format_collist, row, 0, 0.5, 0.5);
if (info->format_run_manual_change) {
info->format_run_manual_change = FALSE;
return;
......@@ -207,7 +185,7 @@ format_page_format_changed (GtkEntry *entry, DruidPageData_t *data)
char *format = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
char *t[1];
int i, found;
if (info->format_run_index >= 0) {
listitem = g_slist_nth (info->format_run_list, info->format_run_index);
......@@ -239,7 +217,7 @@ format_page_format_changed (GtkEntry *entry, DruidPageData_t *data)
gtk_clist_moveto (info->format_sublist, found, 0, 0.5, 0.5);
}
format_page_update_preview (data);
}
......@@ -249,7 +227,14 @@ format_page_format_changed (GtkEntry *entry, DruidPageData_t *data)
/**
* format_page_prepare
*
* @page : format page
* @druid : gnome druid hosting @page
* @data : mother struct
*
* This will prepare the widgets on the format page before
* the page gets displayed
*
* returns : nothing
**/
void
format_page_prepare (GnomeDruidPage *page, GnomeDruid *druid, DruidPageData_t *data)
......@@ -280,10 +265,6 @@ format_page_prepare (GnomeDruidPage *page, GnomeDruid *druid, DruidPageData_t *d
gtk_clist_columns_autosize (info->format_collist);
info->format_run_manual_change = TRUE;
gtk_clist_select_row (info->format_collist, 0, 0);
info->format_run_index = 0;
GTK_RANGE (info->format_scroll)->adjustment->upper = data->lines + 1;
stf_preview_colwidths_clear (info->format_run_renderdata);
......@@ -296,8 +277,14 @@ format_page_prepare (GnomeDruidPage *page, GnomeDruid *druid, DruidPageData_t *d
stf_cache_options_set_range (info->format_run_cacheoptions,
info->format_run_renderdata->startrow - 1,
(info->format_run_renderdata->startrow - 1) + stf_preview_get_displayed_rowcount (info->format_run_renderdata));
format_page_update_preview (data);
info->format_run_manual_change = TRUE;
gtk_clist_select_row (info->format_collist, 0, 0);
info->format_run_index = 0;
t[0] = g_slist_nth_data (info->format_run_list, 0);
gtk_entry_set_text (info->format_format, t[0]);
}
/**
......@@ -378,10 +365,6 @@ format_page_init (GladeXML *gui, DruidPageData_t *pagedata)
"changed",
GTK_SIGNAL_FUNC (format_page_format_changed),
pagedata);
/* gtk_signal_emit_by_name (GTK_OBJECT (info->format_format),
"changed",
info->format_format,
pagedata);*/
gtk_signal_connect (GTK_OBJECT (info->format_collist),
"select_row",
GTK_SIGNAL_FUNC (format_page_collist_select_row),
......
......@@ -5,10 +5,6 @@
*
*/
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
#include "dialog-stf.h"
/*************************************************************************************************
......@@ -18,6 +14,7 @@
/**
* main_page_set_spin_button_adjustment
* @spinbutton : the spinbutton to adjust
* @min : the minimum number the user may enter into the spinbutton
* @max : the maximum number the user may enter into the spinbutton
*
* returns : nothing
......@@ -35,15 +32,12 @@ main_page_set_spin_button_adjustment (GtkSpinButton* spinbutton, int min, int ma
/**
* set_center_prevent_rectangle_size
* @canvas : canvas where the @rectangle is located on
* @rectangle : a rectangle on the @canvas which can be used for centering purposes
* @text : The text item from which the height and width will be used to calculate
* the size of the rectangle
* @data : a mother struct
*
* This is merely a hack to prevent the canvas from centering on the text if the text
* width and/or height are smaller than the width and/or height of the GnomeCanvas.
* Warning 1 : Don't remove this, this is necessary!!
* Warning 2 : Be sure that the @canvas has both his width and height set to something other than 0
* Warning 2 : Be sure that the canvas has both his width and height set to something other than 0
*
* returns : nothing
**/
......@@ -184,8 +178,8 @@ main_page_init (GladeXML *gui, DruidPageData_t *pagedata)
/* Warning : The rectangle is vital to prevent auto-centering, DON'T REMOVE IT! */
info->main_run_rect = GNOME_CANVAS_RECT (gnome_canvas_item_new (gnome_canvas_root (info->main_canvas),
gnome_canvas_rect_get_type (),
"x1", 0, "y1", 0,
"x2", 10, "y2", 10,
"x1", 0.0, "y1", 0.0,
"x2", 10.0, "y2", 10.0,
"width_pixels", (int) 0,
"fill_color", NULL,
NULL));
......@@ -224,3 +218,9 @@ main_page_init (GladeXML *gui, DruidPageData_t *pagedata)
#include <config.h>
#include <gnome.h>
/*
* dialog-stf-preview.c : by utilizing the stf-parse engine this unit can
* render sheet previews on the gnomecanvas and offers
* functions for making this preview more interactive.
*
* Almer. S. Tigelaar <almer1@dds.nl>
*
*/
/** This might be necessary later for rendering formatted values
#include "format.h"
......@@ -7,7 +13,6 @@
**/
#include "dialog-stf.h"
#include "dialog-stf-preview.h"
/******************************************************************************************************************
......@@ -172,12 +177,12 @@ stf_preview_get_table_pixel_height (RenderData_t *renderdata, int rowcount)
static void
stf_preview_draw_grid (RenderData_t *renderdata, int rowcount, int colcount)
{
char *color;
double rowheight = renderdata->charheight + CELL_VPAD;
double tableheight = stf_preview_get_table_pixel_height (renderdata, rowcount);
double tablewidth = stf_preview_get_table_pixel_width (renderdata);
double xpos = 0;
double ypos = 0;
char *tempcolor;
int i;
/* Color the first row */
......@@ -201,14 +206,14 @@ stf_preview_draw_grid (RenderData_t *renderdata, int rowcount, int colcount)
stf_preview_draw_box (renderdata->group, ROW_COLOR_ACTIVE, colleft, rowheight, colright, tableheight);
}
color = CAPTION_LINE_COLOR;
tempcolor = CAPTION_LINE_COLOR;
/* horizontal lines */
for (i = 0; i < rowcount + 1; i++) {
if (i == 2)
color = LINE_COLOR;
tempcolor = LINE_COLOR;
stf_preview_draw_line (renderdata->group, color, 0, ypos, tablewidth, ypos);
stf_preview_draw_line (renderdata->group, tempcolor, 0, ypos, tablewidth, ypos);
ypos += rowheight;
}
......@@ -259,7 +264,6 @@ stf_preview_render_row (RenderData_t *renderdata, double rowy, GSList *row, int
for (col = 0; col <= colcount; col++) {
int widthwanted;
char *color;
if (iterator != NULL && iterator->data != NULL) {
......@@ -311,15 +315,19 @@ stf_preview_render_row (RenderData_t *renderdata, double rowy, GSList *row, int
celltext = iterator->data;
}
if (col == renderdata->activecolumn && rowy != 0)
color = TEXT_COLOR_ACTIVE;
else
color = TEXT_COLOR;
/* In case the active color differs from the inactive color
* this code can be activated
*
* if (col == renderdata->activecolumn && rowy != 0)
* color = text_color_active;
* else
* color = text_color;
*/
textwidth = stf_preview_draw_text (renderdata->group,
celltext,
renderdata->font,
color,
TEXT_COLOR,
xpos + (CELL_HPAD / 2),
rowy + (CELL_VPAD / 2));
......@@ -755,7 +763,7 @@ stf_preview_get_displayed_rowcount (RenderData_t *renderdata)
"height", &canvasheight,
NULL);
rowcount = (canvasheight / (gdk_string_height (renderdata->font, "Test") + TEXT_VPADDING)) + 1;
rowcount = (canvasheight / (gdk_string_height (renderdata->font, "Test"))) + 1;
return rowcount;
}
......@@ -879,3 +887,8 @@ stf_preview_get_char_at_x (RenderData_t *renderdata, double x)
#ifndef GNUMERIC_DIALOG_STF_PREVIEW_H
#define GNUMERIC_DIALOG_STF_PREVIEW_H
#include <config.h>
#include <gnome.h>
#include "sheet.h"
#include "stf.h"
......@@ -9,9 +12,9 @@
#define CAPTION_COLOR "silver"
#define CAPTION_COLOR_ACTIVE "gray"
#define ROW_COLOR "white"
#define ROW_COLOR_ACTIVE "black"
#define ROW_COLOR_ACTIVE "lavender"
#define TEXT_COLOR "black"
#define TEXT_COLOR_ACTIVE "white"
#define TEXT_COLOR_ACTIVE "black"
#define COLUMN_CAPTION N_("Column %d")
......
......@@ -41,7 +41,7 @@
*
* This is merely a hack to prevent the canvas from centering on the text if the text
* width and/or height are smaller than the width and/or height of the GnomeCanvas.
* Warning 1 : Don't remove this, this is necessary!!
* Warning 1 : Don't remove this, this is, it's necessary!!
* Warning 2 : Be sure that the @canvas has both his width and height set to something other than 0
*
* returns : nothing
......@@ -126,7 +126,6 @@ dialog_stf_druid_position_to_page (DruidPageData_t *pagedata, DruidPosition_t po
case DPG_CSV : return pagedata->csv_page;
case DPG_FIXED : return pagedata->fixed_page;
case DPG_FORMAT : return pagedata->format_page;
case DPG_STOP : return pagedata->stop_page;
default :
g_warning ("Unknown druid position");
return NULL;
......@@ -175,7 +174,6 @@ dialog_stf_druid_page_next (GnomeDruidPage *page, GnomeDruid *druid, DruidPageDa
data->format_info->format_run_cacheoptions = data->fixed_info->fixed_run_cacheoptions;
data->format_info->format_run_source_hash = data->fixed_info->fixed_run_renderdata;
} break;
case DPG_FORMAT : newpos = DPG_STOP; break;
default :
g_warning ("Page Cycle Error : Unknown page %d", data->position);
return FALSE;
......@@ -190,6 +188,9 @@ dialog_stf_druid_page_next (GnomeDruidPage *page, GnomeDruid *druid, DruidPageDa
gnome_druid_set_page (druid, nextpage);
data->position = newpos;
if (newpos == DPG_FORMAT)
gnome_druid_set_show_finish (data->druid, TRUE);
return TRUE;
}
......@@ -210,7 +211,6 @@ dialog_stf_druid_page_previous (GnomeDruidPage *page, GnomeDruid *druid, DruidPa
GnomeDruidPage *nextpage;
switch (data->position) {
case DPG_STOP : newpos = DPG_FORMAT; break;
case DPG_FORMAT : {
if (data->parsetype == PARSE_TYPE_CSV)
newpos = DPG_CSV;
......@@ -259,7 +259,7 @@ dialog_stf_druid_cancel (GnomeDruid *druid, DruidPageData_t *data)
}
/**
* dialog_stf_stop_page_druid_finish
* dialog_stf_format_page_druid_finish
* @druid : a druid
* @page : a druidpage
* @data : mother struct
......@@ -271,7 +271,7 @@ dialog_stf_druid_cancel (GnomeDruid *druid, DruidPageData_t *data)
* returns : nothing
**/
static void
dialog_stf_druid_stop_page_finish (GnomeDruid *druid, GnomeDruidPage *page, DruidPageData_t *data)
dialog_stf_druid_format_page_finish (GnomeDruid *druid, GnomeDruidPage *page, DruidPageData_t *data)
{
gtk_main_quit ();
}
......@@ -299,7 +299,7 @@ dialog_stf_attach_page_signals (GladeXML *gui, DruidPageData_t *pagedata)
pagedata->csv_page = GNOME_DRUID_PAGE (glade_xml_get_widget (gui, "csv_page"));
pagedata->fixed_page = GNOME_DRUID_PAGE (glade_xml_get_widget (gui, "fixed_page"));
pagedata->format_page = GNOME_DRUID_PAGE (glade_xml_get_widget (gui, "format_page"));
pagedata->stop_page = GNOME_DRUID_PAGE (glade_xml_get_widget (gui, "stop_page"));
/* pagedata->stop_page = GNOME_DRUID_PAGE (glade_xml_get_widget (gui, "stop_page"));*/
pagedata->position = DPG_MAIN;
gnome_druid_set_buttons_sensitive (pagedata->druid, FALSE, TRUE, TRUE);
......@@ -339,10 +339,6 @@ dialog_stf_attach_page_signals (GladeXML *gui, DruidPageData_t *pagedata)
"back",
GTK_SIGNAL_FUNC (dialog_stf_druid_page_previous),
pagedata);
gtk_signal_connect (GTK_OBJECT (pagedata->stop_page),
"back",
GTK_SIGNAL_FUNC (dialog_stf_druid_page_previous),
pagedata);
gtk_signal_connect (GTK_OBJECT (pagedata->main_page),
"cancel",
......@@ -360,9 +356,10 @@ dialog_stf_attach_page_signals (GladeXML *gui, DruidPageData_t *pagedata)
"cancel",
GTK_SIGNAL_FUNC (dialog_stf_druid_page_cancel),
pagedata);
gtk_signal_connect (GTK_OBJECT (pagedata->stop_page),
"cancel",
GTK_SIGNAL_FUNC (dialog_stf_druid_page_cancel),
gtk_signal_connect (GTK_OBJECT (pagedata->format_page),
"finish",
GTK_SIGNAL_FUNC (dialog_stf_druid_format_page_finish),
pagedata);
gtk_signal_connect (GTK_OBJECT (pagedata->csv_page),
......@@ -378,11 +375,6 @@ dialog_stf_attach_page_signals (GladeXML *gui, DruidPageData_t *pagedata)
GTK_SIGNAL_FUNC (format_page_prepare),
pagedata);
gtk_signal_connect (GTK_OBJECT (pagedata->stop_page),
"finish",
GTK_SIGNAL_FUNC (dialog_stf_druid_stop_page_finish),
pagedata);
/* Signals for the druid itself */
gtk_signal_connect (GTK_OBJECT (pagedata->druid),
......@@ -496,6 +488,15 @@ dialog_stf (CommandContext *context, const char *filename, const char *data)
return dialogresult;
}
/**
* dialog_stf_result_free
* @dialogresult : a dialogresult struct
*
* This routine will properly free the members of @dialogresult and
* @dialogresult itself
*
* returns : nothing
**/
void
dialog_stf_result_free (DialogStfResult_t *dialogresult)
{
......
......@@ -10,17 +10,6 @@
<language>C</language>
<gnome_support>True</gnome_support>
<gettext_support>True</gettext_support>
<use_widget_names>False</use_widget_names>
<output_main_file>True</output_main_file>
<output_support_files>True</output_support_files>
<output_build_files>True</output_build_files>
<backup_source_files>True</backup_source_files>
<main_source_file>interface.c</main_source_file>
<main_header_file>interface.h</main_header_file>
<handler_source_file>callbacks.c</handler_source_file>
<handler_header_file>callbacks.h</handler_header_file>
<support_source_file>support.c</support_source_file>
<support_header_file>support.h</support_header_file>
<output_translatable_strings>True</output_translatable_strings>
<translatable_strings_file>dialog-stf.glade.h</translatable_strings_file>
</project>
......@@ -87,7 +76,7 @@
<widget>
<class>GtkLabel</class>
<name>label1</name>
<width>480</width>
<width>505</width>
<label>Select the structure of the text that most closely matches the data. Separated means that the each column is separated by a 'separation' character and fixed width means that you can define the width of each column yourself. You should also select what part of the data you want to import by adjusting the from and to line.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>True</wrap>
......@@ -117,6 +106,7 @@
<widget>
<class>GtkVBox</class>
<name>vbox3</name>
<border_width>5</border_width>
<homogeneous>False</homogeneous>
<spacing>5</spacing>
......@@ -139,7 +129,7 @@
<class>GtkRadioButton</class>
<name>main_fixed</name>
<can_focus>True</can_focus>
<label>_Fixed width</label>
<label>Fixed wi_dth</label>
<active>False</active>
<draw_indicator>True</draw_indicator>
<group>typegroup</group>
......@@ -166,13 +156,14 @@
<widget>
<class>GtkLabel</class>
<name>label2</name>
<label>From line :</label>
<label>Fr_om line :</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<focus_target>main_startrow</focus_target>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -207,13 +198,14 @@
<widget>
<class>GtkLabel</class>
<name>label18</name>
<label>To line : </label>
<label>_To line : </label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0.5</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<focus_target>main_stoprow</focus_target>
<child>
<padding>0</padding>
<expand>False</expand>
......@@ -289,7 +281,7 @@
<widget>
<class>GnomeCanvas</class>
<name>main_canvas</name>
<width>450</width>
<width>473</width>
<height>150</height>
<can_focus>True</can_focus>
<anti_aliased>False</anti_aliased>
......@@ -341,7 +333,7 @@
<widget>
<class>GtkLabel</class>
<name>label4</name>
<width>480</width>
<width>505</width>
<label>Select the separators that appear in the text (you can choose multiple separators if desired and also enter a custom one). You may choose the string indicator and wether you want to see two successive separators as one aswell. Changes will reflect in the example below.</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>True</wrap>
......@@ -383,17 +375,88 @@
<class>GtkTable</class>
<name>table1</name>
<border_width>5</border_width>
<rows>3</rows>
<columns>2</columns>
<rows>4</rows>
<columns>3</columns>