Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Software Public
PASSOFT
SOHViewer
Commits
c3fb309d
Commit
c3fb309d
authored
2 months ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
flake8
parent
6897297d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/db_config/channel_dialog.py
+8
-8
8 additions, 8 deletions
sohstationviewer/view/db_config/channel_dialog.py
with
8 additions
and
8 deletions
sohstationviewer/view/db_config/channel_dialog.py
+
8
−
8
View file @
c3fb309d
...
...
@@ -4,11 +4,9 @@ GUI to add/edit/remove channels
"""
from
typing
import
List
,
Union
from
PIL.ImageOps
import
contain
from
PySide6.QtCore
import
Qt
,
Signal
,
Slot
from
PySide6.QtWidgets
import
(
QMessageBox
,
QCheckBox
,
QWidget
,
QBoxLayout
,
QHBoxLayout
,
QMessageBox
,
QCheckBox
,
QWidget
,
QHBoxLayout
,
)
from
sohstationviewer.view.db_config.db_config_dialog
import
(
...
...
@@ -27,12 +25,13 @@ class CenteredCheckBox(QWidget):
centered QCheckBox. This is simply the standard method to center a widget
without having to use stylesheets. The main bulk of the custom code is to
pass to the internal QCheckBox for processing.
This wrapper is intended to provide a more convenient way to work with a
centered checkbox. Without it, the internal QCheckBox has to be retrieved
every time we want to use it. This can become annoying to do, especially
since there is no convenient method provided to retrieve the checkbox.
"""
def
__init__
(
self
,
parent
=
None
):
super
(
CenteredCheckBox
,
self
).
__init__
(
parent
)
layout
=
QHBoxLayout
()
...
...
@@ -90,15 +89,15 @@ class ChannelDialog(UiDBInfoDialog):
:return the created checkbox widget
"""
row_channel
=
(
self
.
database_rows
[
row_idx
][
0
]
if
row_idx
<
len
(
self
.
database_rows
)
else
''
)
if
row_idx
<
len
(
self
.
database_rows
)
else
''
)
checked
=
(
self
.
database_rows
[
row_idx
][
col_idx
-
1
]
if
row_idx
<
len
(
self
.
database_rows
)
else
False
)
if
row_idx
<
len
(
self
.
database_rows
)
else
False
)
checkbox
=
CenteredCheckBox
(
self
.
data_table_widget
)
checkbox
.
setChecked
(
checked
)
set_widget_color
(
checkbox
)
checkbox
.
checkStateChanged
.
connect
(
lambda
check_state
:
self
.
on_checkbox_toggle
(
bool
(
check_state
.
value
),
checkbox
)
self
.
on_checkbox_toggle
(
bool
(
check_state
.
value
),
checkbox
)
)
if
self
.
data_type
==
'
RT130
'
:
checkbox
.
setDisabled
(
True
)
...
...
@@ -168,7 +167,8 @@ class ChannelDialog(UiDBInfoDialog):
str
(
row_content
[
3
]))
self
.
data_table_widget
.
cellWidget
(
row_idx
,
5
).
setText
(
row_content
[
4
])
self
.
data_table_widget
.
cellWidget
(
row_idx
,
6
).
setValue
(
row_content
[
5
])
self
.
data_table_widget
.
cellWidget
(
row_idx
,
7
).
setChecked
(
row_content
[
6
])
self
.
data_table_widget
.
cellWidget
(
row_idx
,
7
).
setChecked
(
row_content
[
6
])
def
set_row_widgets
(
self
,
row_idx
,
fk
=
False
):
"""
...
...
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