Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
269d98ec
Commit
269d98ec
authored
Nov 23, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lockfile added to directory and class volumes
parent
5eb657a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
wb/exe/wb/src/wb_main.cpp
wb/exe/wb/src/wb_main.cpp
+29
-0
wb/lib/wb/src/wb_vrepmem.cpp
wb/lib/wb/src/wb_vrepmem.cpp
+9
-2
No files found.
wb/exe/wb/src/wb_main.cpp
View file @
269d98ec
...
...
@@ -56,6 +56,7 @@
#include "wb_vrepdbs.h"
#include "wb_vrepmem.h"
#include "wb_vrepext.h"
#include "wb_dblock.h"
#include "wb_main.h"
using
namespace
std
;
...
...
@@ -320,6 +321,34 @@ void Wb::wtt_open_volume( void *wttctx, wb_eType type, const char *filename, wow
else
if
(
file_type
==
wow_eFileSelType_WblClass
)
{
printf
(
"Wb opening wb_load-file %s...
\n
"
,
filename
);
char
uname
[
80
];
if
(
wb_dblock
::
is_locked
((
char
*
)
filename
,
uname
))
{
char
msg
[
120
];
sprintf
(
msg
,
"Classvolume %s is locked by user %s"
,
filename
,
uname
);
MsgWindow
::
message
(
'E'
,
msg
,
msgw_ePop_No
);
if
(
!
MsgWindow
::
has_window
())
return
;
CoWow
*
wow
=
MsgWindow
::
get_wow
();
int
res
=
wow
->
CreateModalDialog
(
"Classvolume Locked"
,
msg
,
"Cancel"
,
"Remove lock"
,
0
,
"$pwr_exe/wtt_padlock.png"
);
switch
(
res
)
{
case
wow_eModalDialogReturn_Button1
:
case
wow_eModalDialogReturn_Deleted
:
return
;
case
wow_eModalDialogReturn_Button2
:
// Remove lock
wb_dblock
::
dbunlock
((
char
*
)
filename
);
break
;
case
wow_eModalDialogReturn_NYI
:
case
wow_eModalDialogReturn_Button3
:
return
;
}
}
// Load volume and import to vrepmem
wb_erep
*
erep
=
(
wb_erep
*
)(
*
(
wb_env
*
)
wb
->
wbctx
);
wb_vrepmem
*
mem
=
new
wb_vrepmem
(
erep
,
0
);
...
...
wb/lib/wb/src/wb_vrepmem.cpp
View file @
269d98ec
...
...
@@ -42,10 +42,11 @@
#include "co_time.h"
#include "cow_msgwindow.h"
#include "co_dcli.h"
#include "wb_dblock.h"
wb_vrepmem
::
wb_vrepmem
(
wb_erep
*
erep
,
pwr_tVid
vid
)
:
wb_vrep
(
vid
),
m_erep
(
erep
),
m_merep
(
erep
->
merep
()),
root_object
(
0
),
volume_object
(
0
),
wb_vrep
(
vid
),
m_erep
(
erep
),
m_merep
(
erep
->
merep
()),
m_nRef
(
0
),
root_object
(
0
),
volume_object
(
0
),
m_nextOix
(
0
),
m_source_vid
(
0
),
m_classeditor
(
false
),
m_ignore
(
false
)
{
strcpy
(
m_filename
,
""
);
...
...
@@ -108,11 +109,14 @@ void wb_vrepmem::loadWbl( const char *filename, pwr_tStatus *sts, bool reload)
vrep
->
ref
();
m_vid
=
vrep
->
vid
();
strcpy
(
m_filename
,
filename
);
name
(
vrep
->
name
());
importVolume
(
*
vrep
);
vrep
->
unref
();
wb_dblock
::
dblock
(
m_filename
);
*
sts
=
LDH__SUCCESS
;
}
...
...
@@ -342,8 +346,11 @@ mem_object *wb_vrepmem::find( const char *name)
void
wb_vrepmem
::
unref
()
{
if
(
--
m_nRef
==
0
)
if
(
--
m_nRef
==
0
)
{
if
(
strcmp
(
m_filename
,
""
)
!=
0
)
wb_dblock
::
dbunlock
(
m_filename
);
delete
this
;
}
}
wb_vrep
*
wb_vrepmem
::
ref
()
...
...
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