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
3821472a
Commit
3821472a
authored
Jan 04, 2013
by
Jacobo Aragunde Perez
Committed by
jean-pierre charras
Jan 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent Pcbnew from opening the same file twice.
parent
f914cd0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
files.cpp
pcbnew/files.cpp
+7
-0
pcbnew.cpp
pcbnew/pcbnew.cpp
+18
-12
No files found.
pcbnew/files.cpp
View file @
3821472a
...
@@ -241,7 +241,14 @@ the changes?" ) ) )
...
@@ -241,7 +241,14 @@ the changes?" ) ) )
fileName
.
SetExt
(
pi
->
GetFileExtension
()
);
fileName
.
SetExt
(
pi
->
GetFileExtension
()
);
if
(
!
aAppend
)
if
(
!
aAppend
)
{
if
(
!
wxGetApp
().
LockFile
(
fileName
.
GetFullPath
()
)
)
{
DisplayError
(
this
,
_
(
"This file is already open."
)
);
return
false
;
}
Clear_Pcb
(
false
);
// pass false since we prompted above for a modified board
Clear_Pcb
(
false
);
// pass false since we prompted above for a modified board
}
CheckForAutoSaveFile
(
fileName
,
fileName
.
GetExt
()
);
CheckForAutoSaveFile
(
fileName
,
fileName
.
GetExt
()
);
...
...
pcbnew/pcbnew.cpp
View file @
3821472a
...
@@ -117,16 +117,6 @@ bool EDA_APP::OnInit()
...
@@ -117,16 +117,6 @@ bool EDA_APP::OnInit()
InitEDA_Appl
(
wxT
(
"Pcbnew"
),
APP_PCBNEW_T
);
InitEDA_Appl
(
wxT
(
"Pcbnew"
),
APP_PCBNEW_T
);
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
{
if
(
!
IsOK
(
NULL
,
_
(
"Pcbnew is already running, Continue?"
)
)
)
return
false
;
}
// read current setup and reopen last directory if no filename to open in command line
bool
reopenLastUsedDirectory
=
argc
==
1
;
GetSettings
(
reopenLastUsedDirectory
);
if
(
argc
>
1
)
if
(
argc
>
1
)
{
{
fn
=
argv
[
1
];
fn
=
argv
[
1
];
...
@@ -140,10 +130,26 @@ Changing extension to .%s." ), GetChars( fn.GetFullPath() ),
...
@@ -140,10 +130,26 @@ Changing extension to .%s." ), GetChars( fn.GetFullPath() ),
wxMessageBox
(
msg
);
wxMessageBox
(
msg
);
}
}
if
(
fn
.
IsOk
()
&&
fn
.
DirExists
()
)
if
(
!
wxGetApp
().
LockFile
(
fn
.
GetFullPath
()
)
)
wxSetWorkingDirectory
(
fn
.
GetPath
()
);
{
DisplayError
(
NULL
,
_
(
"This file is already open."
)
);
return
false
;
}
}
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
{
if
(
!
IsOK
(
NULL
,
_
(
"Pcbnew is already running, Continue?"
)
)
)
return
false
;
}
}
// read current setup and reopen last directory if no filename to open in command line
bool
reopenLastUsedDirectory
=
argc
==
1
;
GetSettings
(
reopenLastUsedDirectory
);
if
(
fn
.
IsOk
()
&&
fn
.
DirExists
()
)
wxSetWorkingDirectory
(
fn
.
GetPath
()
);
g_DrawBgColor
=
BLACK
;
g_DrawBgColor
=
BLACK
;
/* Must be called before creating the main frame in order to
/* Must be called before creating the main frame in order to
...
...
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