Please find attached my File-Revert implementation for the current PCB in sourceforge CVS. This is an output of cvs diff -C 3 -p Levente -- E-Mail: lekovacs@xxxxxxxxxxxx AIM: ha5ogl ICQ: 48710903 MSN: ha5ogl@xxxxxxxxxxx Yahoo!: kieg_tk16 Home Page: http://web.interware.hu/lekovacs Public key: http://web.interware.hu/lekovacs/cuccok/public_key ________________________________________ /"\ \ / ASCII Ribbon Campaign X against HTML email & vCards / \ http://arc.pasp.de/ Have Fun, & Linux! 73 for all by HA5OGL. This message was generated by Sylpheed.
? Makefile
? config.h
? config.log
? config.status
? diff_out.txt
? stamp-h1
? lib/CreateLibrary.sh
? lib/CreateLibraryContents.sh
? lib/ListLibraryContents.sh
? lib/Makefile
? lib/QueryLibrary.sh
? lib/amp.list
? lib/amp.m4
? lib/bourns.list
? lib/bourns.m4
? lib/cts.list
? lib/cts.m4
? lib/geda.list
? lib/geda.m4
? lib/johnstech.list
? lib/johnstech.m4
? lib/minicircuits.list
? lib/minicircuits.m4
? lib/panasonic.list
? lib/panasonic.m4
? lib/pcblib
? lib/pcblib.contents
? lib/qfp-ui
? newlib/Makefile
? newlib/2_pin_thru-hole_packages/Makefile
? newlib/analog-devices/Makefile
? newlib/burr-brown/Makefile
? newlib/connectors/Makefile
? newlib/crystal/Makefile
? newlib/cypress/Makefile
? newlib/electro-optics/Makefile
? newlib/generic_SMD_packages/Makefile
? newlib/headers/Makefile
? newlib/msp430/Makefile
? newlib/not_vetted_ingo/Makefile
? newlib/sockets/Makefile
? newlib/tests/Makefile
? newlib/toko/Makefile
? src/.deps
? src/.test
? src/Makefile
? src/Pcb
? src/core_lists.h
? src/parse_l.c
? src/parse_y.c
? src/parse_y.h
? src/pcb-menu.h
? src/pcbtest.sh
? src/res_lex.c
? src/res_parse.c
? src/res_parse.h
? src/hid/bom/.deps
? src/hid/bom/.dirstamp
? src/hid/common/.deps
? src/hid/common/.dirstamp
? src/hid/common/hidlist.h
? src/hid/gerber/.deps
? src/hid/gerber/.dirstamp
? src/hid/gtk/.deps
? src/hid/gtk/.dirstamp
? src/hid/gtk/gtk_lists.h
? src/hid/lesstif/.deps
? src/hid/lesstif/.dirstamp
? src/hid/lesstif/lesstif_lists.h
? src/hid/lpr/.deps
? src/hid/lpr/.dirstamp
? src/hid/png/.deps
? src/hid/png/.dirstamp
? src/hid/png/png_lists.h
? src/hid/ps/.deps
? src/hid/ps/.dirstamp
? src/hid/ps/ps_lists.h
? src/icons/Makefile
? src/script/Makefile
? src/script/pcb
Index: src/action.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/action.c,v
retrieving revision 1.69
diff -C3 -p -r1.69 action.c
*** src/action.c 23 Mar 2006 02:19:16 -0000 1.69
--- src/action.c 25 Mar 2006 14:33:51 -0000
*************** typedef enum
*** 133,138 ****
--- 133,139 ----
F_Rectangle,
F_Redraw,
F_Release,
+ F_Revert,
F_Remove,
F_RemoveSelected,
F_Report,
*************** static FunctionType Functions[] = {
*** 290,295 ****
--- 291,297 ----
{"ResetLinesAndPolygons", F_ResetLinesAndPolygons},
{"ResetPinsViasAndPads", F_ResetPinsViasAndPads},
{"Restore", F_Restore},
+ {"Revert", F_Revert},
{"Rotate", F_Rotate},
{"Save", F_Save},
{"Scroll", F_Scroll},
*************** ActionSaveTo (int argc, char **argv, int
*** 4020,4032 ****
/* ---------------------------------------------------------------------------
* load data
! * syntax: Load(ElementToBuffer|Layout|LayoutToBuffer|Netlist)
*/
static int
ActionLoadFrom (int argc, char **argv, int x, int y)
{
char *function;
char *name;
if (argc < 2)
{
--- 4022,4035 ----
/* ---------------------------------------------------------------------------
* load data
! * syntax: Load(ElementToBuffer|Layout|LayoutToBuffer|Netlist|Revert)
*/
static int
ActionLoadFrom (int argc, char **argv, int x, int y)
{
char *function;
char *name;
+ char fname[256];
if (argc < 2)
{
*************** ActionLoadFrom (int argc, char **argv, i
*** 4066,4071 ****
--- 4069,4080 ----
if (!ReadNetlist (PCB->Netlistname))
hid_action ("NetlistChanged");
}
+ else if (strcasecmp (function, "Revert") == 0 && PCB->Filename && (!PCB->Changed || gui->confirm_dialog(_("OK to override changes?"), 0)))
+ {
+ strcpy(fname,PCB->Filename); /*Calling LoadPCB(PCB->Filename) changes the content of PCB->Filename.*/
+ LoadPCB(fname);
+ }
+
RestoreCrosshair (True);
return 0;
}
Index: src/pcb-menu.res
===================================================================
RCS file: /cvsroot/pcb/pcb/src/pcb-menu.res,v
retrieving revision 1.19
diff -C3 -p -r1.19 pcb-menu.res
*** src/pcb-menu.res 21 Mar 2006 17:34:59 -0000 1.19
--- src/pcb-menu.res 25 Mar 2006 14:33:53 -0000
*************** MainMenu =
*** 8,13 ****
--- 8,14 ----
{"About..." About()}
{"Save layout" Save(Layout)}
{"Save layout as..." Save(LayoutAs)}
+ {"Revert" Load(Revert,none)}
{"Load layout" Load(Layout)}
{"Load element data to paste-buffer" PasteBuffer(Clear) Load(ElementTobuffer)}
{"Load layout data to paste-buffer" PasteBuffer(Clear) Load(LayoutTobuffer)}
Index: src/hid/gtk/gui-top-window.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gui-top-window.c,v
retrieving revision 1.8
diff -C3 -p -r1.8 gui-top-window.c
*** src/hid/gtk/gui-top-window.c 25 Mar 2006 04:53:06 -0000 1.8
--- src/hid/gtk/gui-top-window.c 25 Mar 2006 14:34:08 -0000
*************** save_layout_as_cb (GtkAction * action, G
*** 237,242 ****
--- 237,249 ----
hid_actionl ("Save", "LayoutAs", 0);
}
+ static void revert_cb(GtkAction *action, GHidPort *port)
+ {
+ hid_actionl ("LoadFrom", "Revert", "none", 0);
+ }
+
+
+
static void
load_layout_cb (GtkAction * action, GHidPort * port)
{
*************** static GtkActionEntry entries[] = {
*** 1152,1157 ****
--- 1159,1165 ----
G_CALLBACK (save_layout_cb)},
{"SaveLayoutAs", NULL, N_("Save layout as"), NULL, NULL,
G_CALLBACK (save_layout_as_cb)},
+ { "Revert", NULL, N_("Revert"), NULL, NULL, G_CALLBACK(revert_cb)},
{"LoadLayout", NULL, N_("Load layout"), NULL, NULL,
G_CALLBACK (load_layout_cb)},
{"LoadElementData", NULL, N_("Load element data to paste-buffer"),
*************** static const gchar *ui_info =
*** 1605,1610 ****
--- 1613,1620 ----
" <menuitem action='SaveLayout'/>"
" <menuitem action='SaveLayoutAs'/>"
" <separator/>"
+ " <menuitem action='Revert'/>"
+ " <separator/>"
" <menuitem action='LoadLayout'/>"
" <menuitem action='LoadElementData'/>"
" <menuitem action='LoadLayoutData'/>"
Attachment:
pgpkTavjvOL4z.pgp
Description: PGP signature