Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
i2MassChroQ
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
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
PAPPSO
i2MassChroQ
Commits
c7d95ee0
Commit
c7d95ee0
authored
7 years ago
by
Langella Olivier
Browse files
Options
Downloads
Patches
Plain Diff
WIP: load combo box
parent
0dd1e4ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
+30
-10
30 additions, 10 deletions
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.h
+2
-1
2 additions, 1 deletion
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.h
with
32 additions
and
11 deletions
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.cpp
+
30
−
10
View file @
c7d95ee0
...
...
@@ -33,6 +33,7 @@
#include
"ui_edit_tandem_preset_dialog.h"
#include
<QSettings>
#include
<QDir>
EditTandemPresetDialog
::
EditTandemPresetDialog
(
QWidget
*
parent
)
:
...
...
@@ -70,6 +71,7 @@ void EditTandemPresetDialog::setTandemParametersFiles(const TandemParametersFile
}
_tandem_params
=
_p_tandem_preset_file
->
getTandemParameters
();
fillPresetComboBox
();
populate
();
}
...
...
@@ -95,17 +97,13 @@ void EditTandemPresetDialog::doSave() {
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"_p_tandem_preset_file == nullptr"
));
}
_p_tandem_preset_file
->
setTandemParameters
(
_tandem_params
);
fillPresetComboBox
();
}
void
EditTandemPresetDialog
::
doLoad
()
{
int
index
=
ui
->
preset_combobox
->
currentIndex
();
int
index
=
ui
->
preset_combo
_
box
->
currentIndex
();
if
(
index
!=
-
1
)
{
// -1 for not found
ui
->
preset_combobox
->
itemData
(
index
).
value
<
QString
>
();
QSettings
settings
;
QString
default_preset_location
=
settings
.
value
(
"path/tandemrun_preset_directory"
,
""
).
toString
();
if
(
_p_tandem_preset_file
==
nullptr
)
{
throw
pappso
::
PappsoException
(
QObject
::
tr
(
"_p_tandem_preset_file == nullptr"
));
}
else
{
...
...
@@ -113,16 +111,38 @@ if (_p_tandem_preset_file == nullptr) {
}
QSettings
settings
;
QString
default_preset_location
=
settings
.
value
(
"path/tandemrun_preset_directory"
,
""
).
toString
();
u
_p_tandem_preset_file
=
new
TandemParametersFile
(
QString
(
"%1/%2.xml"
).
arg
(
default_preset_location
).
arg
(
ui
->
preset_combobox
));
_p_tandem_preset_file
=
new
TandemParametersFile
(
ui
->
preset_combo_box
->
itemData
(
index
).
value
<
QString
>
());
_tandem_params
=
_p_tandem_preset_file
->
getTandemParameters
();
populate
();
}
}
void
EditTandemPresetDialog
::
doEdit
()
{
void
EditTandemPresetDialog
::
fillPresetComboBox
()
{
ui
->
preset_combo_box
->
clear
();
QSettings
settings
;
QString
default_preset_location
=
settings
.
value
(
"path/tandemrun_preset_directory"
,
""
).
toString
();
QString
default_preset_name
=
_tandem_params
.
getMethodName
();
QDir
preset_dir
(
default_preset_location
);
QStringList
filters
;
filters
<<
"*.xml"
;
preset_dir
.
setNameFilters
(
filters
);
for
(
QFileInfo
file_info
:
preset_dir
.
entryInfoList
()
)
{
ui
->
preset_combo_box
->
addItem
(
file_info
.
baseName
(),
QVariant
(
file_info
.
absoluteFilePath
()));
}
int
index
=
ui
->
preset_combo_box
->
findText
(
default_preset_name
);
if
(
index
!=
-
1
)
{
// -1 for not found
ui
->
preset_combo_box
->
setCurrentIndex
(
index
);
}
}
void
EditTandemPresetDialog
::
doEdit
(
QString
value
)
{
QObject
*
senderObj
=
sender
();
QString
senderObjName
=
senderObj
->
objectName
();
qDebug
()
<<
"EditTandemPresetDialog::doEdit begin "
<<
senderObjName
;
qDebug
()
<<
"EditTandemPresetDialog::doEdit begin "
<<
senderObjName
<<
" "
<<
value
;
qDebug
()
<<
"EditTandemPresetDialog::doEdit end "
<<
senderObjName
;
}
void
EditTandemPresetDialog
::
doHelp
()
{
...
...
This diff is collapsed.
Click to expand it.
src/gui/edit_tandem_preset_dialog/edittandempresetdialog.h
+
2
−
1
View file @
c7d95ee0
...
...
@@ -51,9 +51,10 @@ public slots:
void
doHelp
();
void
doSave
();
void
doCopy
();
void
doEdit
();
void
doEdit
(
QString
value
);
void
doLoad
();
private:
void
fillPresetComboBox
();
void
populate
();
void
readUi
();
...
...
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