Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f365ef91
Commit
f365ef91
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
minor corrections
parent
69f4f536
No related branches found
No related tags found
1 merge request
!714
Undo/Redo of sample editor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/SampleDesigner/SampleEditorCommands.cpp
+4
-3
4 additions, 3 deletions
GUI/View/SampleDesigner/SampleEditorCommands.cpp
GUI/View/SampleDesigner/SampleEditorCommands.h
+1
-1
1 addition, 1 deletion
GUI/View/SampleDesigner/SampleEditorCommands.h
with
5 additions
and
4 deletions
GUI/View/SampleDesigner/SampleEditorCommands.cpp
+
4
−
3
View file @
f365ef91
...
...
@@ -32,6 +32,7 @@ CommandRemoveLayer::CommandRemoveLayer(SampleEditorController* ec, LayerItem* la
:
QUndoCommand
(
parent
)
,
m_ec
(
ec
)
{
setText
(
"Remove layer"
);
m_indexOfLayer
=
ec
->
multiLayerItem
()
->
layers
().
indexOf
(
layerItem
);
m_layerItemBackup
=
GUI
::
Util
::
createBackup
(
layerItem
);
}
...
...
@@ -55,13 +56,13 @@ void CommandRemoveLayer::undo()
}
CommandChangeValue
::
CommandChangeValue
(
const
QString
&
label
,
SampleEditorController
*
ec
,
double
oldValue
,
double
newValue
,
QString
path
,
double
oldValue
,
double
newValue
,
const
QString
&
path
,
QUndoCommand
*
parent
/*= nullptr*/
)
:
QUndoCommand
(
parent
)
,
m_ec
(
ec
)
,
m_oldValue
(
oldValue
)
,
m_newValue
(
newValue
)
,
m_path
(
std
::
move
(
path
)
)
,
m_path
(
path
)
{
setText
(
"change "
+
label
+
"
\n
"
);
}
...
...
@@ -73,7 +74,7 @@ int CommandChangeValue::id() const
bool
CommandChangeValue
::
mergeWith
(
const
QUndoCommand
*
command
)
{
if
(
command
->
id
()
!=
id
())
// make sure other is also a
n AppendText
command
if
(
command
->
id
()
!=
id
())
// make sure other is also a
changeValue
command
return
false
;
const
auto
*
const
other
=
dynamic_cast
<
const
CommandChangeValue
*>
(
command
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/SampleDesigner/SampleEditorCommands.h
+
1
−
1
View file @
f365ef91
...
...
@@ -24,7 +24,7 @@ class LayerItem;
class
CommandChangeValue
:
public
QUndoCommand
{
public:
CommandChangeValue
(
const
QString
&
label
,
SampleEditorController
*
ec
,
double
oldValue
,
double
newValue
,
QString
path
,
QUndoCommand
*
parent
=
nullptr
);
double
newValue
,
const
QString
&
path
,
QUndoCommand
*
parent
=
nullptr
);
int
id
()
const
override
;
bool
mergeWith
(
const
QUndoCommand
*
command
)
override
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment