Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tuneit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladimir Vaskov
tuneit
Commits
5aa47741
Commit
5aa47741
authored
Jan 14, 2025
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opportunity created: refresh the settings page with signal
parent
16755ec6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
__init__.py
src/settings/__init__.py
+8
-0
window.py
src/window.py
+13
-1
No files found.
src/settings/__init__.py
View file @
5aa47741
...
...
@@ -171,6 +171,14 @@ def init_settings_stack(stack, listbox, split_view):
merged_data
=
merge_categories_by_name
(
yaml_data
)
section_factory
=
SectionFactory
()
if
stack
.
get_pages
():
print
(
"Clear pages..."
)
listbox
.
remove_all
()
for
page
in
stack
.
get_pages
():
stack
.
remove
(
page
)
else
:
print
(
"First init..."
)
categories
=
[
Category
(
c
,
section_factory
)
for
c
in
merged_data
]
for
category
in
categories
:
...
...
src/window.py
View file @
5aa47741
...
...
@@ -17,7 +17,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
from
gi.repository
import
Adw
,
Gtk
from
gi.repository
import
GObject
,
Adw
,
Gtk
from
.settings
import
init_settings_stack
...
...
@@ -29,7 +29,19 @@ class TuneitWindow(Adw.ApplicationWindow):
settings_listbox
=
Gtk
.
Template
.
Child
()
settings_split_view
=
Gtk
.
Template
.
Child
()
@GObject.Signal
def
settings_page_update
(
self
):
pass
def
__init__
(
self
,
**
kwargs
):
super
()
.
__init__
(
**
kwargs
)
self
.
connect
(
'settings_page_update'
,
self
.
update_settings_page
)
self
.
update_settings_page
()
def
update_settings_page
(
self
,
*
args
):
"""
Можно вызвать вот так, благодаря сигналу:
self.settings_pagestack.get_root().emit("settings_page_update")
"""
init_settings_stack
(
self
.
settings_pagestack
,
self
.
settings_listbox
,
self
.
settings_split_view
)
print
(
"Stack cleared and initialized!"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment