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
d8f56d10
Commit
d8f56d10
authored
May 23, 2008
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reopening and closing of unfinished action
parent
c21a24bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
14 deletions
+66
-14
xtt/lib/ge/src/ge_graph_journal.cpp
xtt/lib/ge/src/ge_graph_journal.cpp
+63
-12
xtt/lib/ge/src/ge_graph_journal.h
xtt/lib/ge/src/ge_graph_journal.h
+3
-2
No files found.
xtt/lib/ge/src/ge_graph_journal.cpp
View file @
d8f56d10
/*
* Proview $Id: ge_graph_journal.cpp,v 1.
2 2008-05-14 06:51:51
claes Exp $
* Proview $Id: ge_graph_journal.cpp,v 1.
3 2008-05-23 07:48:16
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -194,14 +194,6 @@ int GraphJournal::store( journal_eAction action, grow_tObject o)
{
static
grow_tObject
lock_object
=
0
;
if
(
status
==
journal_eStatus_AnteProperties
&&
!
((
action
==
journal_eAction_PostPropertiesObject
||
action
==
journal_eAction_PostPropertiesSelect
)
&&
o
==
lock_object
))
{
printf
(
"Journalfile blocked
\n
"
);
return
0
;
}
switch
(
action
)
{
case
journal_eAction_AntePropertiesSelect
:
case
journal_eAction_PostPropertiesSelect
:
...
...
@@ -213,13 +205,64 @@ int GraphJournal::store( journal_eAction action, grow_tObject o)
int
sel_count
;
grow_GetSelectList
(
graph
->
grow
->
ctx
,
&
sel_list
,
&
sel_count
);
if
(
sel_count
==
0
)
if
(
sel_count
==
0
)
{
return
GE__SUCCESS
;
}
break
;
}
default:
;
}
if
(
status
==
journal_eStatus_AnteProperties
&&
!
((
action
==
journal_eAction_PostPropertiesObject
||
action
==
journal_eAction_PostPropertiesSelect
)
&&
o
==
lock_object
))
{
if
(
debug
)
printf
(
"Unfinished action, forced close
\n
"
);
// Close prevoius action
poslist
[
current_idx
].
redo_pos
=
fp
.
tellp
();
fp
<<
journal_cTag_Redo
<<
" "
<<
journal_eAction_No
<<
" "
<<
status
<<
" "
<<
current_idx
<<
endl
;
current_idx
++
;
status
=
journal_eStatus_Stored
;
lock_object
=
0
;
if
(
debug
)
printf
(
"Store(F)x: %3d list: %3d undo: %10d redo: %10d
\n
"
,
current_idx
-
1
,
poslist
.
size
()
-
1
,
(
int
)
poslist
[
poslist
.
size
()
-
1
].
undo_pos
,
(
int
)
poslist
[
poslist
.
size
()
-
1
].
redo_pos
);
}
if
(
(
status
!=
journal_eStatus_AnteProperties
||
(
status
==
journal_eStatus_AnteProperties
&&
lock_object
!=
o
))
&&
(
action
==
journal_eAction_PostPropertiesObject
||
action
==
journal_eAction_PostPropertiesSelect
))
{
if
(
debug
)
printf
(
"Interrupted action, reopening
\n
"
);
// Open prevoius action
JournalPos
up
;
switch
(
status
)
{
case
journal_eStatus_Stored
:
case
journal_eStatus_Redo
:
case
journal_eStatus_Undo
:
fp
.
seekp
(
poslist
[
current_idx
-
1
].
end_pos
);
break
;
default:
;
}
while
(
(
int
)
poslist
.
size
()
>
current_idx
)
{
if
(
debug
)
printf
(
"Remove %d
\n
"
,
poslist
.
size
()
-
1
);
poslist
.
pop_back
();
}
up
.
undo_pos
=
fp
.
tellp
();
poslist
.
push_back
(
up
);
fp
<<
journal_cTag_Undo
<<
" "
<<
journal_eAction_No
<<
" "
<<
status
<<
" "
<<
current_idx
<<
endl
;
status
=
journal_eStatus_AnteProperties
;
}
if
(
action
==
journal_eAction_AntePropertiesSelect
||
action
==
journal_eAction_AntePropertiesObject
||
action
==
journal_eAction_AnteGroupSelect
||
...
...
@@ -490,6 +533,8 @@ int GraphJournal::undo()
case
journal_eAction_PostRename
:
undo_rename
();
break
;
case
journal_eAction_No
:
break
;
default:
;
}
...
...
@@ -565,6 +610,8 @@ int GraphJournal::redo()
case
journal_eAction_PostRename
:
redo_rename
();
break
;
case
journal_eAction_No
:
break
;
default:
;
}
...
...
@@ -835,8 +882,10 @@ int GraphJournal::undo_properties_object()
fp
.
getline
(
name
,
sizeof
(
name
));
sts
=
grow_FindObjectByName
(
graph
->
grow
->
ctx
,
name
,
&
o
);
if
(
ODD
(
sts
))
grow_ObjectOpen
(
o
,
(
ifstream
&
)
fp
);
if
(
EVEN
(
sts
))
return
GE__SUCCESS
;
grow_ObjectOpen
(
o
,
(
ifstream
&
)
fp
);
fp
.
get
();
fp
.
getline
(
line
,
sizeof
(
line
));
...
...
@@ -1658,6 +1707,8 @@ int GraphJournal::restore( char *fname)
case
journal_eAction_PostRename
:
redo_rename
();
break
;
case
journal_eAction_No
:
break
;
default:
;
}
nr
=
0
;
...
...
xtt/lib/ge/src/ge_graph_journal.h
View file @
d8f56d10
/*
* Proview $Id: ge_graph_journal.h,v 1.
1 2008-05-13 13:59:02
claes Exp $
* Proview $Id: ge_graph_journal.h,v 1.
2 2008-05-23 07:48:16
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -55,7 +55,8 @@ typedef enum {
journal_eAction_AntePaste
,
journal_eAction_PostPaste
,
journal_eAction_AnteRename
,
journal_eAction_PostRename
journal_eAction_PostRename
,
journal_eAction_No
}
journal_eAction
;
typedef
enum
{
...
...
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