[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_misc.nw
User: werner
Date: 05/03/07 13:45:41
Modified: . o_misc.nw x_dialog.nw
Log:
added error handling off missing source pages for autonumber_text functions
Revision Changes Path
1.35 +22 -8 eda/geda/devel/gschem/noweb/o_misc.nw
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_misc.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/o_misc.nw,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- o_misc.nw 6 Mar 2005 16:48:29 -0000 1.34
+++ o_misc.nw 7 Mar 2005 18:45:40 -0000 1.35
@@ -1226,11 +1226,18 @@
parent,
page_control,
HIERARCHY_NORMAL_LOAD);
-
+ if (page_control != -1) {
autonumber_find(w_current, w_current->page_current->object_head,
stext, used_numbers, AUTONUMBER_SKIP_NOT);
s_hierarchy_up(w_current, w_current->page_current->up);
}
+ else {
+ s_log_message(_("Cannot find source [%s]\n"),
+ current_filename);
+ fprintf(stderr,
+ _("Cannot find source [%s]\n"), current_filename);
+ }
+ }
}
}
}
@@ -1261,6 +1268,7 @@
PAGE *parent = NULL;
char *current_filename = NULL;
int page_control = 0;
+ int save_page_control = 0;
int pcount = 0;
unsigned char *ss;
@@ -1353,17 +1361,23 @@
pcount = 0;
current_filename = u_basic_breakup_string(attrib, ',', pcount);
if (current_filename != NULL) {
+ save_page_control = page_control;
page_control =
s_hierarchy_down_schematic_single(w_current,
current_filename,
parent,
page_control,
HIERARCHY_NORMAL_LOAD);
+ if (page_control != -1) {
autonumber_text(w_current, stext, used, currentnumber,
unnumbered, searchfocus, sortorder);
-
s_hierarchy_up(w_current, w_current->page_current->up);
}
+ else {
+ /* restore if we failed to load the page */
+ page_control = save_page_control;
+ }
+ }
}
}
}
1.32 +5 -6 eda/geda/devel/gschem/noweb/x_dialog.nw
(In the diff below, changes in quantity of whitespace are not shown.)
Index: x_dialog.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_dialog.nw,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- x_dialog.nw 6 Mar 2005 16:48:28 -0000 1.31
+++ x_dialog.nw 7 Mar 2005 18:45:40 -0000 1.32
@@ -4817,12 +4817,6 @@
/* Why is the entry attached to w_current ?? (Werner) */
w_current->tsentry = combo_entry1;
- buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
- gtk_box_pack_start(GTK_BOX(action_area), buttoncancel, TRUE, TRUE, 0);
- gtk_signal_connect(GTK_OBJECT(buttoncancel), "clicked",
- GTK_SIGNAL_FUNC(autonumber_text_done), w_current);
- gtk_widget_show(buttoncancel);
-
buttonok = gtk_button_new_from_stock (GTK_STOCK_APPLY);
GTK_WIDGET_SET_FLAGS(buttonok, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(action_area), buttonok, TRUE, TRUE, 0);
@@ -4831,6 +4825,11 @@
gtk_widget_show(buttonok);
gtk_widget_grab_default(buttonok);
+ buttoncancel = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
+ gtk_box_pack_start(GTK_BOX(action_area), buttoncancel, TRUE, TRUE, 0);
+ gtk_signal_connect(GTK_OBJECT(buttoncancel), "clicked",
+ GTK_SIGNAL_FUNC(autonumber_text_done), w_current);
+ gtk_widget_show(buttoncancel);
}
if (!GTK_WIDGET_VISIBLE(w_current->tswindow)) {