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
4832e107
Commit
4832e107
authored
3 years ago
by
Matthias Puchner
Committed by
Wuttke, Joachim
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
remove outdated sub-dialog for editing name and description of an instrument
parent
4d6b9cca
No related branches found
No related tags found
1 merge request
!708
Refactor and simplify UI
Pipeline
#57777
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Instrument/InstrumentLibraryEditor.cpp
+1
-54
1 addition, 54 deletions
GUI/View/Instrument/InstrumentLibraryEditor.cpp
GUI/View/Instrument/InstrumentLibraryEditor.h
+0
-1
0 additions, 1 deletion
GUI/View/Instrument/InstrumentLibraryEditor.h
with
1 addition
and
55 deletions
GUI/View/Instrument/InstrumentLibraryEditor.cpp
+
1
−
54
View file @
4832e107
...
...
@@ -139,9 +139,6 @@ void InstrumentLibraryEditor::execAdd(const InstrumentItem& instrumentToAdd)
m_ui
->
treeView
->
setCurrentIndex
(
index
);
m_ui
->
treeView
->
scrollTo
(
index
,
QAbstractItemView
::
PositionAtTop
);
createWidgetsForCurrentInstrument
();
setModal
(
true
);
show
();
editNameAndDescription
(
addedInstrument
);
exec
();
}
...
...
@@ -172,13 +169,6 @@ QList<QAction*> InstrumentLibraryEditor::getOverlayActions(const QModelIndex& in
if
(
item
==
nullptr
)
return
{};
auto
*
editAction
=
new
QAction
(
this
);
editAction
->
setText
(
"Edit name and description"
);
editAction
->
setIcon
(
QIcon
(
":/images/edit.svg"
));
editAction
->
setIconText
(
"Edit"
);
editAction
->
setToolTip
(
"Edit name and description"
);
connect
(
editAction
,
&
QAction
::
triggered
,
[
=
]()
{
editNameAndDescription
(
item
);
});
auto
*
removeAction
=
new
QAction
(
this
);
removeAction
->
setText
(
"Remove"
);
removeAction
->
setIcon
(
QIcon
(
":/images/delete.svg"
));
...
...
@@ -186,50 +176,7 @@ QList<QAction*> InstrumentLibraryEditor::getOverlayActions(const QModelIndex& in
removeAction
->
setToolTip
(
"Remove this instrument"
);
connect
(
removeAction
,
&
QAction
::
triggered
,
[
=
]()
{
m_treeModel
->
removeItem
(
item
);
});
return
{
editAction
,
removeAction
};
}
void
InstrumentLibraryEditor
::
editNameAndDescription
(
InstrumentItem
*
item
)
{
QDialog
dlg
(
this
);
dlg
.
setObjectName
(
"NameAndDescriptionDialog"
);
dlg
.
setWindowTitle
(
"Edit name and description of instrument"
);
dlg
.
setWindowIcon
(
windowIcon
());
dlg
.
setWindowFlag
(
Qt
::
WindowContextHelpButtonHint
,
false
);
dlg
.
setProperty
(
"stylable"
,
true
);
// for stylesheet addressing
auto
*
layout
=
new
QFormLayout
(
&
dlg
);
auto
*
nameEdit
=
new
QLineEdit
(
&
dlg
);
nameEdit
->
setText
(
item
->
instrumentName
());
nameEdit
->
selectAll
();
auto
*
descriptionEdit
=
new
QTextEdit
(
&
dlg
);
descriptionEdit
->
setMinimumWidth
(
200
);
descriptionEdit
->
setAcceptRichText
(
false
);
descriptionEdit
->
setTabChangesFocus
(
true
);
descriptionEdit
->
setPlainText
(
item
->
description
());
auto
*
buttonBox
=
new
QDialogButtonBox
(
&
dlg
);
buttonBox
->
addButton
(
QDialogButtonBox
::
Ok
);
buttonBox
->
addButton
(
QDialogButtonBox
::
Cancel
);
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setAutoDefault
(
true
);
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setDefault
(
true
);
layout
->
addRow
(
"Name:"
,
nameEdit
);
layout
->
addRow
(
"Description:"
,
descriptionEdit
);
layout
->
addWidget
(
buttonBox
);
dlg
.
setLayout
(
layout
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
accepted
,
&
dlg
,
&
QDialog
::
accept
);
connect
(
buttonBox
,
&
QDialogButtonBox
::
rejected
,
&
dlg
,
&
QDialog
::
reject
);
appSettings
->
loadWindowSizeAndPos
(
&
dlg
);
if
(
dlg
.
exec
()
==
QDialog
::
Accepted
)
{
QModelIndex
index
=
m_treeModel
->
indexForItem
(
item
);
m_treeModel
->
setData
(
index
,
nameEdit
->
text
(),
Qt
::
EditRole
);
m_treeModel
->
setData
(
index
,
descriptionEdit
->
toPlainText
(),
Qt
::
ToolTipRole
);
}
appSettings
->
saveWindowSizeAndPos
(
&
dlg
);
return
{
removeAction
};
}
void
InstrumentLibraryEditor
::
createWidgetsForCurrentInstrument
()
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Instrument/InstrumentLibraryEditor.h
+
0
−
1
View file @
4832e107
...
...
@@ -48,7 +48,6 @@ private:
void
onItemDoubleClickedForChoose
(
const
QModelIndex
&
index
);
void
onCurrentChangedForChoose
();
QList
<
QAction
*>
getOverlayActions
(
const
QModelIndex
&
index
,
bool
asHover
);
void
editNameAndDescription
(
InstrumentItem
*
item
);
void
createWidgetsForCurrentInstrument
();
void
onInstrumentNameEdited
(
const
QString
&
newName
);
...
...
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