Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
877a4b41
Commit
877a4b41
authored
5 years ago
by
Petter Sagvold
Browse files
Options
Downloads
Patches
Plain Diff
#46 Docstrings ferdig, lagre/avbryt/hent også
parent
f0984f5f
No related branches found
Branches containing commit
No related tags found
1 merge request
!37
#46 Oppsett endrer SOI
Pipeline
#76979
passed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
soitool/setup_settings.py
+8
-5
8 additions, 5 deletions
soitool/setup_settings.py
with
8 additions
and
5 deletions
soitool/setup_settings.py
+
8
−
5
View file @
877a4b41
...
@@ -44,13 +44,13 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -44,13 +44,13 @@ class Setup(QDialog): # pylint: disable = R0902
self
.
group_algorithm_pack
=
QGroupBox
()
self
.
group_algorithm_pack
=
QGroupBox
()
self
.
group_algorithm_sort
=
QGroupBox
()
self
.
group_algorithm_sort
=
QGroupBox
()
# labels for headings
# labels for
main
headings
self
.
label_header
=
QLabel
(
"
Headerdata
"
)
self
.
label_header
=
QLabel
(
"
Headerdata
"
)
self
.
label_paper_orientation
=
QLabel
(
"
Papirretning
"
)
self
.
label_paper_orientation
=
QLabel
(
"
Papirretning
"
)
self
.
label_algorithm
=
QLabel
(
"
Plasseringsalgoritmer
"
)
self
.
label_algorithm
=
QLabel
(
"
Plasseringsalgoritmer
"
)
self
.
label_module_placement
=
QLabel
(
"
Modulplassering
"
)
self
.
label_module_placement
=
QLabel
(
"
Modulplassering
"
)
# headerdata
and edits
# headerdata
self
.
layout_setup
.
addWidget
(
self
.
label_header
)
self
.
layout_setup
.
addWidget
(
self
.
label_header
)
self
.
label_title
=
QLabel
(
"
Tittel:
"
)
self
.
label_title
=
QLabel
(
"
Tittel:
"
)
self
.
label_description
=
QLabel
(
"
Beskrivelse:
"
)
self
.
label_description
=
QLabel
(
"
Beskrivelse:
"
)
...
@@ -135,7 +135,7 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -135,7 +135,7 @@ class Setup(QDialog): # pylint: disable = R0902
self
.
layout_setup
.
addWidget
(
self
.
group_algorithm_pack
)
self
.
layout_setup
.
addWidget
(
self
.
group_algorithm_pack
)
self
.
layout_setup
.
addWidget
(
self
.
group_algorithm_sort
)
self
.
layout_setup
.
addWidget
(
self
.
group_algorithm_sort
)
#
exit-buttons
#
save and cancel
self
.
button_cancel
=
QPushButton
(
"
Avbryt
"
)
self
.
button_cancel
=
QPushButton
(
"
Avbryt
"
)
self
.
button_save
=
QPushButton
(
"
Lagre
"
)
self
.
button_save
=
QPushButton
(
"
Lagre
"
)
self
.
layout_buttons
.
addWidget
(
self
.
button_cancel
)
self
.
layout_buttons
.
addWidget
(
self
.
button_cancel
)
...
@@ -148,10 +148,11 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -148,10 +148,11 @@ class Setup(QDialog): # pylint: disable = R0902
self
.
button_save
.
clicked
.
connect
(
self
.
save
)
# enter-key (default)
self
.
button_save
.
clicked
.
connect
(
self
.
save
)
# enter-key (default)
def
cancel
(
self
):
def
cancel
(
self
):
"""
Close the dialog and nothing is saved.
"""
self
.
reject
()
self
.
reject
()
def
save
(
self
):
def
save
(
self
):
# data sendes fra oppsett og oppdaterer soi
"""
Save and update the SOI with the given changes.
"""
self
.
soi
.
title
=
self
.
edit_title
.
text
()
self
.
soi
.
title
=
self
.
edit_title
.
text
()
self
.
soi
.
description
=
self
.
edit_description
.
text
()
self
.
soi
.
description
=
self
.
edit_description
.
text
()
self
.
soi
.
version
=
self
.
edit_version
.
text
()
self
.
soi
.
version
=
self
.
edit_version
.
text
()
...
@@ -160,6 +161,7 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -160,6 +161,7 @@ class Setup(QDialog): # pylint: disable = R0902
self
.
soi
.
valid_to
=
self
.
edit_valid_to
.
text
()
self
.
soi
.
valid_to
=
self
.
edit_valid_to
.
text
()
self
.
soi
.
classification
=
self
.
edit_classification
.
currentText
()
self
.
soi
.
classification
=
self
.
edit_classification
.
currentText
()
# finds which radiobutton that is checked
if
self
.
rbutton_landscape
.
isChecked
():
if
self
.
rbutton_landscape
.
isChecked
():
self
.
soi
.
orientation
=
"
landscape
"
self
.
soi
.
orientation
=
"
landscape
"
else
:
else
:
...
@@ -170,6 +172,7 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -170,6 +172,7 @@ class Setup(QDialog): # pylint: disable = R0902
else
:
else
:
self
.
soi
.
placement_strategy
=
"
manual
"
self
.
soi
.
placement_strategy
=
"
manual
"
# loops through groupbox to find checked radiobuttons
for
i
in
self
.
group_algorithm_bin
.
findChildren
(
QRadioButton
):
for
i
in
self
.
group_algorithm_bin
.
findChildren
(
QRadioButton
):
if
i
.
isChecked
():
if
i
.
isChecked
():
self
.
soi
.
algorithm_bin
=
i
.
text
()
self
.
soi
.
algorithm_bin
=
i
.
text
()
...
@@ -185,7 +188,7 @@ class Setup(QDialog): # pylint: disable = R0902
...
@@ -185,7 +188,7 @@ class Setup(QDialog): # pylint: disable = R0902
self
.
accept
()
self
.
accept
()
def
get_from_soi
(
self
):
def
get_from_soi
(
self
):
# data hentes fra soi og settes inn i oppsett
"""
Get the data from the SOI and updates the dialog with the data.
"""
self
.
edit_title
.
setText
(
self
.
soi
.
title
)
self
.
edit_title
.
setText
(
self
.
soi
.
title
)
self
.
edit_description
.
setText
(
self
.
soi
.
description
)
self
.
edit_description
.
setText
(
self
.
soi
.
description
)
self
.
edit_version
.
setText
(
self
.
soi
.
version
)
self
.
edit_version
.
setText
(
self
.
soi
.
version
)
...
...
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