Commit 394125c5 authored by Andreas J. Guelzow's avatar Andreas J. Guelzow Committed by Andreas J. Guelzow
Browse files

make gnome2 compatible and add apply button state->glade is not a gtk

2002-01-26  Andreas J. Guelzow <aguelzow@taliesin.ca>

	* autocorrect.glade : make gnome2 compatible and add apply button
	* dialog-autocorrect.c (cb_autocorrect_destroy) : state->glade
	  is not a gtk object
	(cb_cancel_button_clicked) : new
	(cb_button_clicked) : renamed to cb_apply_button_clicked, do not
	  destroy dialog
	(cb_ok_button_clicked) : new
	(dialog_init) : set-up apply button, this dialog need not be a
	  guru but can be non-modal, transient on worksheet
parent 0d057310
......@@ -5,6 +5,7 @@ Andreas:
* Fix #63485
* Make the autosave dialog non-modal, port to gnome2
* Make the analysis tools warnings non-modal
* Make the autocorrect dialog non-modal, port to gnome2
Jody:
* Initial port to gnome2.
......
2002-01-26 Andreas J. Guelzow <aguelzow@taliesin.ca>
* autocorrect.glade : make gnome2 compatible and add apply button
* dialog-autocorrect.c (cb_autocorrect_destroy) : state->glade
is not a gtk object
(cb_cancel_button_clicked) : new
(cb_button_clicked) : renamed to cb_apply_button_clicked, do not
destroy dialog
(cb_ok_button_clicked) : new
(dialog_init) : set-up apply button, this dialog need not be a
guru but can be non-modal, transient on worksheet
2002-01-26 Andreas J. Guelzow <aguelzow@taliesin.ca>
* autosave-prompt.glade : removed
......
......@@ -24,12 +24,6 @@
<property name="spacing">5</property>
<property name="visible">yes</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="spacing">30</property>
<property name="visible">yes</property>
<child>
<widget class="GtkButton" id="ok_button">
<property name="can_default">yes</property>
......@@ -44,6 +38,18 @@
</child>
<child>
<widget class="GtkButton" id="apply_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property>
<property name="label" translatable="yes">gtk-apply</property>
<property name="use_stock">yes</property>
<property name="use_underline">yes</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="cancel_button">
<property name="can_default">yes</property>
<property name="can_focus">yes</property>
......@@ -66,13 +72,6 @@
<property name="use_underline">yes</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......@@ -258,24 +257,12 @@
<child>
<widget class="GtkCList" id="clist1">
<property name="can_focus">yes</property>
<property name="columns">2</property>
<property name="n-columns">2</property>
<property name="column_widths">80,80</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="show_titles">no</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="visible">yes</property>
<child>
<widget class="Placeholder" id="None">
<property name="visible">yes</property>
</widget>
</child>
<child>
<widget class="Placeholder" id="None">
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
......@@ -426,18 +413,12 @@
<child>
<widget class="GtkCList" id="init_caps_list">
<property name="can_focus">yes</property>
<property name="columns">1</property>
<property name="n-columns">1</property>
<property name="column_widths">80</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="show_titles">no</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="visible">yes</property>
<child>
<widget class="Placeholder" id="None">
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
......@@ -634,18 +615,12 @@
<child>
<widget class="GtkCList" id="first_letter_list">
<property name="can_focus">yes</property>
<property name="columns">1</property>
<property name="n-columns">1</property>
<property name="column_widths">80</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="show_titles">no</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="visible">yes</property>
<child>
<widget class="Placeholder" id="None">
<property name="visible">yes</property>
</widget>
</child>
</widget>
</child>
......
......@@ -30,7 +30,6 @@ typedef struct {
typedef struct {
GladeXML *glade;
GtkWidget *dialog;
GtkWidget *cancel_button;
Workbook *wb;
WorkbookControlGUI *wbcg;
......@@ -155,12 +154,10 @@ static gboolean
cb_autocorrect_destroy (GtkObject *w, AutoCorrectState *state)
{
if (state->glade != NULL) {
gtk_object_unref (GTK_OBJECT (state->glade));
g_object_unref (G_OBJECT (state->glade));
state->glade = NULL;
}
if (state->wbcg != NULL)
wbcg_edit_detach_guru (state->wbcg);
state->dialog = NULL;
g_free (state);
......@@ -185,23 +182,34 @@ cb_dialog_help (GtkWidget *button, gchar *link)
}
static void
cb_button_clicked (GtkWidget *button, AutoCorrectState *state)
cb_cancel_button_clicked (GtkWidget *button, AutoCorrectState *state)
{
if (state->cancel_button != button) {
int i;
if (state->init_caps.changed)
autocorrect_set_exceptions (AC_INIT_CAPS,
state->init_caps.exceptions);
if (state->first_letter.changed)
autocorrect_set_exceptions (AC_FIRST_LETTER,
state->first_letter.exceptions);
for (i = 0 ; i < AC_MAX_FEATURE ; i++)
autocorrect_set_feature (i, state->features [i]);
autocorrect_store_config ();
}
gtk_object_destroy (GTK_OBJECT (state->dialog));
}
static void
cb_apply_button_clicked (GtkWidget *button, AutoCorrectState *state)
{
int i;
if (state->init_caps.changed)
autocorrect_set_exceptions (AC_INIT_CAPS,
state->init_caps.exceptions);
if (state->first_letter.changed)
autocorrect_set_exceptions (AC_FIRST_LETTER,
state->first_letter.exceptions);
for (i = 0 ; i < AC_MAX_FEATURE ; i++)
autocorrect_set_feature (i, state->features [i]);
autocorrect_store_config ();
}
static void
cb_ok_button_clicked (GtkWidget *button, AutoCorrectState *state)
{
cb_apply_button_clicked (button, state);
gtk_object_destroy (GTK_OBJECT (state->dialog));
}
static gboolean
dialog_init (AutoCorrectState *state)
{
......@@ -228,11 +236,13 @@ dialog_init (AutoCorrectState *state)
GTK_SIGNAL_FUNC (cb_dialog_help), "autocorrect-tool.html");
button = glade_xml_get_widget (state->glade, "ok_button");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (cb_button_clicked), state);
GTK_SIGNAL_FUNC (cb_ok_button_clicked), state);
button = glade_xml_get_widget (state->glade, "apply_button");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (cb_apply_button_clicked), state);
button = glade_xml_get_widget (state->glade, "cancel_button");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (cb_button_clicked), state);
state->cancel_button = button;
GTK_SIGNAL_FUNC (cb_cancel_button_clicked), state);
/* Make <Ret> in entry fields invoke default */
entry = glade_xml_get_widget (state->glade, "entry1");
......@@ -259,7 +269,6 @@ dialog_init (AutoCorrectState *state)
gtk_signal_connect (GTK_OBJECT (state->dialog),
"key_press_event",
GTK_SIGNAL_FUNC (cb_autocorrect_key_press), state);
wbcg_edit_attach_guru (state->wbcg, state->dialog);
return FALSE;
}
......
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