Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SGS18-READEX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Ondrej Vysocky
SGS18-READEX
Commits
ca9fe301
Commit
ca9fe301
authored
6 years ago
by
Ivo Peterek
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Message boxes for errors and informations
#2
parent
b3d093a0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
radarGUI.py
+21
-11
21 additions, 11 deletions
radarGUI.py
with
21 additions
and
11 deletions
radarGUI.py
+
21
−
11
View file @
ca9fe301
...
...
@@ -301,7 +301,7 @@ class Ui_TabWidget(object):
head_label1
=
QtWidgets
.
QLabel
()
head_label1
.
setFixedWidth
(
150
)
head_label1
.
setFont
(
font
)
head_label2
=
QtWidgets
.
QLabel
()
head_label2
=
QtWidgets
.
QLabel
(
'
Role
'
)
head_label2
.
setFixedWidth
(
100
)
head_label2
.
setFont
(
font
)
head_label3
=
QtWidgets
.
QLabel
(
'
Default value
'
)
...
...
@@ -588,6 +588,14 @@ class Ui_TabWidget(object):
msg
.
setStandardButtons
(
QtWidgets
.
QMessageBox
.
Close
)
msg
.
exec_
()
def
__print_success_msg
(
self
,
text
):
msg
=
QtWidgets
.
QMessageBox
()
msg
.
setIcon
(
QtWidgets
.
QMessageBox
.
Information
)
msg
.
setText
(
text
)
msg
.
setWindowTitle
(
"
Configure file saved
"
)
msg
.
setStandardButtons
(
QtWidgets
.
QMessageBox
.
Close
)
msg
.
exec_
()
def
__next
(
self
):
self
.
tab_widget
.
setCurrentIndex
(
self
.
tab_widget
.
currentIndex
()
+
1
)
...
...
@@ -605,9 +613,9 @@ class Ui_TabWidget(object):
os
.
system
(
path_to_radar
+
"
printFullReport.py -configFile {}
"
.
format
(
self
.
save_file_path
))
print
()
except
json
.
decoder
.
JSONDecodeError
:
print
(
'
pathToRadar.json file is not in valid format
'
)
self
.
__print_error_msg
(
'
pathToRadar.json file is not in valid format
'
)
else
:
print
(
'
pathToRadar.json not found
'
)
self
.
__print_error_msg
(
'
pathToRadar.json not found
'
)
def
__update_nested_regions
(
self
):
...
...
@@ -809,18 +817,18 @@ class Ui_TabWidget(object):
self
.
__refresh_opt_combos
()
def
__generate_btn
(
self
):
error_string
=
''
user_input_error
=
False
if
not
self
.
current_labels_dic
[
'
xLabel
'
]:
print
(
"
USER INPUT ERROR: xLabel is not specified. One of parameters must be xLabel.
"
)
error_string
+=
'
• xLabel is not specified. One of parameters must be xLabel.
\n
'
user_input_error
=
True
if
not
self
.
current_labels_dic
[
'
funcLabel
'
]:
print
(
"
USER INPUT ERROR:
funcLabel is not specified. One of parameters must be funcLabel.
"
)
error_string
+=
'
•
funcLabel is not specified. One of parameters must be funcLabel.
\n
'
user_input_error
=
True
if
len
(
self
.
selected_y_labels
)
==
0
:
print
(
"
USER INPUT ERROR:
yLabel is not specified. Atleast one yLabel must be checked.
"
)
error_string
+=
'
•
yLabel is not specified. Atleast one yLabel must be checked.
\n
'
user_input_error
=
True
if
self
.
checkBox_GenerateOptSettingFile
.
isChecked
():
...
...
@@ -830,7 +838,7 @@ class Ui_TabWidget(object):
param_selected
=
True
break
if
not
param_selected
:
print
(
"
USER INPUT ERROR:
While generating optimal settings file, atleast one parameter role must be specified.
"
)
error_string
+=
'
•
While generating optimal settings file, atleast one parameter role must be specified.
\n
'
user_input_error
=
True
parameters_name_unique
=
True
...
...
@@ -843,12 +851,13 @@ class Ui_TabWidget(object):
if
parameter
==
other_parameter
:
continue
if
parameter_name
==
other_parameter
.
text
():
print
(
"
USER INPUT ERROR:
Parameter names must be unique. Check parameter names.
"
)
error_string
+=
'
•
Parameter names must be unique. Check parameter names.
\n
'
parameters_name_unique
=
False
break
if
user_input_error
:
print
(
"
Please check USER INPUT ERRORS and try to generate config file again.
"
)
error_string
+=
'
\n
Please fix errors and try to generate config file again.
'
self
.
__print_error_msg
(
error_string
)
return
False
dlg
=
QtWidgets
.
QFileDialog
()
...
...
@@ -858,10 +867,11 @@ class Ui_TabWidget(object):
self
.
save_file_path
=
self
.
save_file_path
+
'
.py
'
if
self
.
save_file_path
:
print
(
'
saved config to file:
'
+
self
.
save_file_path
)
self
.
__print_success_msg
(
'
Saved config to file:
'
+
self
.
save_file_path
)
self
.
__create_config
(
self
.
save_file_path
)
return
True
else
:
print
(
'
Error: You must enter filename!
'
)
return
False
def
__create_config
(
self
,
save_file_path
):
...
...
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