Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
hive
clive
Commits
a54cc216
Verified
Commit
a54cc216
authored
1 year ago
by
Mateusz Żebrak
Browse files
Options
Downloads
Patches
Plain Diff
Make use of new TabbedContent.active_pane property
parent
ab630219
No related branches found
No related tags found
2 merge requests
!326
V1.27.5.8 release
,
!301
Bump textual
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clive/__private/ui/operations/governance_operations/governance_operations.py
+5
-9
5 additions, 9 deletions
...operations/governance_operations/governance_operations.py
with
5 additions
and
9 deletions
clive/__private/ui/operations/governance_operations/governance_operations.py
+
5
−
9
View file @
a54cc216
...
...
@@ -14,13 +14,8 @@ from clive.__private.ui.operations.operation_base_screen import OperationBaseScr
from
clive.__private.ui.widgets.clive_tabbed_content
import
CliveTabbedContent
if
TYPE_CHECKING
:
from
typing
import
Final
from
textual.app
import
ComposeResult
WITNESSES_TAB_LABEL
:
Final
[
str
]
=
"
Witnesses
"
PROPOSALS_TAB_NAME
:
Final
[
str
]
=
"
Proposals
"
class
Governance
(
OperationBaseScreen
):
CSS_PATH
=
[
...
...
@@ -31,18 +26,19 @@ class Governance(OperationBaseScreen):
def
create_left_panel
(
self
)
->
ComposeResult
:
with
WitnessesDataProvider
(
paused
=
True
),
ProposalsDataProvider
(
paused
=
True
),
CliveTabbedContent
():
yield
Proxy
(
"
Proxy
"
)
yield
Witnesses
(
WITNESSES_TAB_LABEL
)
yield
Proposals
(
PROPOSALS_TAB_NAME
)
yield
Witnesses
(
"
Witnesses
"
)
yield
Proposals
(
"
Proposals
"
)
@on
(
CliveTabbedContent
.
TabActivated
)
def
change_provider_status
(
self
,
event
:
CliveTabbedContent
.
TabActivated
)
->
None
:
witnesses_provider
=
self
.
query_one
(
WitnessesDataProvider
)
proposals_provider
=
self
.
query_one
(
ProposalsDataProvider
)
if
str
(
event
.
tab
.
label
)
==
PROPOSALS_TAB_NAME
:
active_pane
=
event
.
tabbed_content
.
active_pane
if
isinstance
(
active_pane
,
Proposals
):
witnesses_provider
.
pause
()
proposals_provider
.
restart
()
elif
str
(
event
.
tab
.
label
)
==
WITNESSES_TAB_LABEL
:
elif
isinstance
(
active_pane
,
Witnesses
)
:
proposals_provider
.
pause
()
witnesses_provider
.
restart
()
else
:
...
...
This diff is collapsed.
Click to expand it.
Jakub Ziebinski
@jziebinski
mentioned in commit
d4489330
·
1 year ago
mentioned in commit
d4489330
mentioned in commit d44893308fdffe1397dd2d97bc3244253639337b
Toggle commit list
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