Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
143debdd
Commit
143debdd
authored
Dec 21, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Rework on recovery files menu
parent
bde103f5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
19 deletions
+34
-19
files.cpp
pcbnew/files.cpp
+22
-14
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+8
-3
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-1
pcbnew_id.h
pcbnew/pcbnew_id.h
+2
-1
No files found.
pcbnew/files.cpp
View file @
143debdd
...
...
@@ -85,12 +85,21 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
LoadOnePcbFile
(
GetBoard
()
->
GetFileName
(),
false
,
true
);
break
;
case
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
:
case
ID_MENU_READ_BOARD_BACKUP_FILE
:
case
ID_MENU_RECOVER_BOARD_AUTOSAVE
:
{
wxFileName
currfn
=
GetBoard
()
->
GetFileName
();
wxFileName
fn
=
currfn
;
if
(
id
==
ID_MENU_RECOVER_BOARD_AUTOSAVE
)
{
wxString
rec_name
=
wxT
(
"$"
)
+
fn
.
GetName
();
fn
.
SetName
(
rec_name
);
}
else
{
wxFileName
fn
;
fn
=
GetBoard
()
->
GetFileName
();
wxString
backup_ext
=
fn
.
GetExt
()
+
backupFileExtensionSuffix
;
fn
.
SetExt
(
backup_ext
);
}
if
(
!
fn
.
FileExists
()
)
{
...
...
@@ -99,19 +108,18 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
DisplayInfoMessage
(
this
,
msg
);
break
;
}
else
{
msg
.
Printf
(
_
(
"OK to load recovery file <%s>"
),
GetChars
(
fn
.
GetFullPath
()
)
);
msg
.
Printf
(
_
(
"OK to load recovery or backup file <%s>"
),
GetChars
(
fn
.
GetFullPath
()
)
);
if
(
!
IsOK
(
this
,
msg
)
)
break
;
}
GetScreen
()
->
ClrModify
();
// do not prompt the user for changes
LoadOnePcbFile
(
fn
.
GetFullPath
(),
false
);
fn
.
SetExt
(
PcbFileExtension
);
// Re-set the name since
extension
changed
GetBoard
()
->
SetFileName
(
fn
.
GetFullPath
()
);
// Re-set the name since
name or extension was
changed
GetBoard
()
->
SetFileName
(
curr
fn
.
GetFullPath
()
);
UpdateTitle
();
}
break
;
...
...
pcbnew/menubar_pcbframe.cpp
View file @
143debdd
...
...
@@ -112,9 +112,14 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
filesMenu
->
AppendSeparator
();
// Revert
AddMenuItem
(
filesMenu
,
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
,
_
(
"Revert"
),
_
(
"Clear board and get previous saved version of board"
),
AddMenuItem
(
filesMenu
,
ID_MENU_READ_BOARD_BACKUP_FILE
,
_
(
"Revert to Last"
),
_
(
"Clear board and get previous backup version of board"
),
KiBitmap
(
help_xpm
)
);
// Rescue
AddMenuItem
(
filesMenu
,
ID_MENU_RECOVER_BOARD_AUTOSAVE
,
_
(
"Rescue"
),
_
(
"Clear board and get last rescue file automatically saved by Pcbnew"
),
KiBitmap
(
help_xpm
)
);
filesMenu
->
AppendSeparator
();
...
...
pcbnew/pcbframe.cpp
View file @
143debdd
...
...
@@ -77,7 +77,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_SIZE
(
PCB_EDIT_FRAME
::
OnSize
)
EVT_TOOL
(
ID_LOAD_FILE
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_MENU_READ_BOARD_BACKUP_FILE
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_MENU_RECOVER_BOARD_AUTOSAVE
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_NEW_BOARD
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_SAVE_BOARD
,
PCB_EDIT_FRAME
::
Files_io
)
EVT_TOOL
(
ID_OPEN_MODULE_EDITOR
,
PCB_EDIT_FRAME
::
Process_Special_Functions
)
...
...
pcbnew/pcbnew_id.h
View file @
143debdd
...
...
@@ -231,7 +231,8 @@ enum pcbnew_ids
ID_POPUP_PCB_REORIENT_ALL_MODULES
,
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
,
ID_MENU_READ_BOARD_BACKUP_FILE
,
ID_MENU_RECOVER_BOARD_AUTOSAVE
,
ID_MENU_ARCHIVE_MODULES
,
ID_MENU_ARCHIVE_NEW_MODULES
,
ID_MENU_ARCHIVE_ALL_MODULES
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment