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
1
Merge Requests
1
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
Ximper Linux
tuneit
Commits
33157810
Commit
33157810
authored
Jan 19, 2025
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few useful features
parent
1f0981e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
main.py
src/settings/main.py
+24
-0
No files found.
src/settings/main.py
View file @
33157810
...
@@ -63,6 +63,17 @@ class Setting:
...
@@ -63,6 +63,17 @@ class Setting:
return
{}
return
{}
def
create_row
(
self
):
def
create_row
(
self
):
if
self
.
root
is
True
:
print
(
"Root is true"
)
if
dclient
is
not
None
:
widget
=
WidgetFactory
.
create_widget
(
self
)
return
widget
.
create_row
()
if
widget
else
None
else
:
# TODO: Окно с предложением включить сервис
print
(
"The service is unavailable, please enable dbus service"
)
return
None
widget
=
WidgetFactory
.
create_widget
(
self
)
widget
=
WidgetFactory
.
create_widget
(
self
)
return
widget
.
create_row
()
if
widget
else
None
return
widget
.
create_row
()
if
widget
else
None
...
@@ -123,14 +134,20 @@ class SectionStrategy:
...
@@ -123,14 +134,20 @@ class SectionStrategy:
class
ClassicSectionStrategy
(
SectionStrategy
):
class
ClassicSectionStrategy
(
SectionStrategy
):
def
create_preferences_group
(
self
,
section
):
def
create_preferences_group
(
self
,
section
):
group
=
Adw
.
PreferencesGroup
(
title
=
section
.
name
)
group
=
Adw
.
PreferencesGroup
(
title
=
section
.
name
)
not_empty
=
False
for
setting
in
section
.
settings
:
for
setting
in
section
.
settings
:
row
=
setting
.
create_row
()
row
=
setting
.
create_row
()
if
row
:
if
row
:
print
(
f
"Добавление строки для настройки: {setting.name}"
)
print
(
f
"Добавление строки для настройки: {setting.name}"
)
group
.
add
(
row
)
group
.
add
(
row
)
not_empty
=
True
else
:
else
:
print
(
f
"Не удалось создать строку для настройки: {setting.name}"
)
print
(
f
"Не удалось создать строку для настройки: {setting.name}"
)
if
not_empty
:
return
group
return
group
else
:
return
None
class
NewSectionStrategy
(
SectionStrategy
):
class
NewSectionStrategy
(
SectionStrategy
):
...
@@ -171,16 +188,23 @@ class Category:
...
@@ -171,16 +188,23 @@ class Category:
clamp
.
set_child
(
pref_page
)
clamp
.
set_child
(
pref_page
)
box
.
set_child
(
clamp
)
box
.
set_child
(
clamp
)
not_empty
=
False
for
section
in
self
.
sections
:
for
section
in
self
.
sections
:
preferences_group
=
section
.
create_preferences_group
()
preferences_group
=
section
.
create_preferences_group
()
if
preferences_group
:
if
preferences_group
:
pref_page
.
add
(
preferences_group
)
pref_page
.
add
(
preferences_group
)
not_empty
=
True
else
:
else
:
print
(
f
"Секция {section.name} не создала виджетов."
)
print
(
f
"Секция {section.name} не создала виджетов."
)
if
not_empty
:
stack_page
=
stack
.
add_child
(
box
)
stack_page
=
stack
.
add_child
(
box
)
stack_page
.
set_title
(
self
.
name
)
stack_page
.
set_title
(
self
.
name
)
stack_page
.
set_name
(
self
.
name
)
stack_page
.
set_name
(
self
.
name
)
else
:
print
(
f
"the category {self.name} is empty, ignored"
)
def
init_settings_stack
(
stack
,
listbox
,
split_view
):
def
init_settings_stack
(
stack
,
listbox
,
split_view
):
yaml_data
=
load_modules
()
yaml_data
=
load_modules
()
...
...
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