Commit 9a1127a7 authored by Jody Goldberg's avatar Jody Goldberg

People pointed out that auto-close would destroy the dialog before I

could get the state.
parent 967902d6
......@@ -61,7 +61,7 @@ dialog_zoom_impl (Workbook *wb, Sheet *cur_sheet, GladeXML *gui)
GtkSpinButton *zoom;
GList *l, *sheets;
gboolean is_custom = TRUE;
int i;
int i, res;
list = GTK_CLIST (glade_xml_get_widget (gui, "sheet_list"));
g_return_if_fail (list);
......@@ -104,6 +104,8 @@ dialog_zoom_impl (Workbook *wb, Sheet *cur_sheet, GladeXML *gui)
if (sheet == cur_sheet) {
gtk_clist_select_row (list, row, 0);
/* FIXME : Why is this not working */
gtk_clist_moveto (list, row, 0, .5, 0.);
}
}
......@@ -116,15 +118,17 @@ dialog_zoom_impl (Workbook *wb, Sheet *cur_sheet, GladeXML *gui)
return;
}
/* TODO : Apply vs Ok ? do we need both ? */
if (gnome_dialog_run (GNOME_DIALOG (dialog)) > 0)
res = gnome_dialog_run (GNOME_DIALOG (dialog));
if (gnome_dialog_run (GNOME_DIALOG (dialog)) == 0) {
float const new_zoom = gtk_spin_button_get_value_as_int(zoom) / 100.;
for (l = list->selection; l != NULL ; l = l->next) {
Sheet * s = gtk_clist_get_row_data (list, GPOINTER_TO_INT(l->data));
printf ("%s\n", s->name);
#if 0
sheet_set_zoom_factor (sheet, zoom);
#endif
sheet_set_zoom_factor (s, new_zoom);
}
}
if (res >= 0)
gnome_dialog_close (GNOME_DIALOG (dialog));
}
/* Wrapper to ensure the libglade object gets removed on error */
......
......@@ -35,7 +35,7 @@
<allow_shrink>False</allow_shrink>
<allow_grow>False</allow_grow>
<auto_shrink>False</auto_shrink>
<auto_close>True</auto_close>
<auto_close>False</auto_close>
<hide_on_close>False</hide_on_close>
<widget>
......
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