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
Ximper Linux
tuneit
Commits
d4392266
Commit
d4392266
authored
Jan 27, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings: add future tracking and fix empty string in map
parent
6728dc0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
base.py
src/settings/setting/base.py
+22
-6
No files found.
src/settings/setting/base.py
View file @
d4392266
...
@@ -43,6 +43,7 @@ class BaseSetting:
...
@@ -43,6 +43,7 @@ class BaseSetting:
self
.
_executor
=
get_executor
()
self
.
_executor
=
get_executor
()
self
.
_timer_id
=
None
self
.
_timer_id
=
None
self
.
_destroyed
=
False
self
.
_destroyed
=
False
self
.
_pending_futures
=
[]
self
.
search_target
=
setting_data
.
get
(
"search_target"
,
None
)
self
.
search_target
=
setting_data
.
get
(
"search_target"
,
None
)
...
@@ -140,9 +141,10 @@ class BaseSetting:
...
@@ -140,9 +141,10 @@ class BaseSetting:
if
"choice"
in
self
.
type
or
"list_dual"
in
self
.
type
:
if
"choice"
in
self
.
type
or
"list_dual"
in
self
.
type
:
map_data
=
{}
map_data
=
{}
for
var
in
range_value
:
for
var
in
range_value
:
key
=
var
if
not
var
:
display_name
=
var
[
0
]
.
upper
()
+
var
[
1
:]
if
var
else
""
continue
map_data
[
key
]
=
display_name
display_name
=
var
[
0
]
.
upper
()
+
var
[
1
:]
map_data
[
var
]
=
display_name
return
map_data
return
map_data
if
self
.
type
==
"number"
:
if
self
.
type
==
"number"
:
...
@@ -202,7 +204,7 @@ class BaseSetting:
...
@@ -202,7 +204,7 @@ class BaseSetting:
self
.
_map_loading
=
False
self
.
_map_loading
=
False
self
.
_set_busy
(
False
)
self
.
_set_busy
(
False
)
self
.
_
executor
.
submit
(
_load
,
on_success
=
_on_success
,
on_error
=
_on_error
,
on_done
=
_on_done
)
self
.
_
submit_task
(
_load
,
on_success
=
_on_success
,
on_error
=
_on_error
,
on_done
=
_on_done
)
def
_notify_map_updated
(
self
):
def
_notify_map_updated
(
self
):
if
self
.
widget
and
self
.
_widget_ready
:
if
self
.
widget
and
self
.
_widget_ready
:
...
@@ -242,7 +244,7 @@ class BaseSetting:
...
@@ -242,7 +244,7 @@ class BaseSetting:
self
.
_value_loading
=
False
self
.
_value_loading
=
False
self
.
_set_busy
(
False
)
self
.
_set_busy
(
False
)
self
.
_
executor
.
submit
(
_load
,
on_success
=
_on_success
,
on_error
=
_on_error
,
on_done
=
_on_done
)
self
.
_
submit_task
(
_load
,
on_success
=
_on_success
,
on_error
=
_on_error
,
on_done
=
_on_done
)
def
_get_backend_value
(
self
,
force
=
False
):
def
_get_backend_value
(
self
,
force
=
False
):
if
self
.
_current_value
is
None
or
force
:
if
self
.
_current_value
is
None
or
force
:
...
@@ -270,7 +272,7 @@ class BaseSetting:
...
@@ -270,7 +272,7 @@ class BaseSetting:
return
return
self
.
_set_busy
(
False
)
self
.
_set_busy
(
False
)
self
.
_
executor
.
submit
(
_save
,
on_error
=
_on_error
,
on_done
=
_on_done
)
self
.
_
submit_task
(
_save
,
on_error
=
_on_error
,
on_done
=
_on_done
)
def
_get_backend_range
(
self
):
def
_get_backend_range
(
self
):
if
not
self
.
_map_ready
:
if
not
self
.
_map_ready
:
...
@@ -291,11 +293,25 @@ class BaseSetting:
...
@@ -291,11 +293,25 @@ class BaseSetting:
self
.
_timer_id
=
GLib
.
timeout_add
(
int
(
interval
*
1000
),
_poll
)
self
.
_timer_id
=
GLib
.
timeout_add
(
int
(
interval
*
1000
),
_poll
)
def
_submit_task
(
self
,
func
,
on_success
=
None
,
on_error
=
None
,
on_done
=
None
):
def
_wrapped_done
():
if
future
in
self
.
_pending_futures
:
self
.
_pending_futures
.
remove
(
future
)
if
on_done
:
on_done
()
future
=
self
.
_executor
.
submit
(
func
,
on_success
=
on_success
,
on_error
=
on_error
,
on_done
=
_wrapped_done
)
self
.
_pending_futures
.
append
(
future
)
return
future
def
destroy
(
self
):
def
destroy
(
self
):
self
.
_destroyed
=
True
self
.
_destroyed
=
True
if
self
.
_timer_id
is
not
None
:
if
self
.
_timer_id
is
not
None
:
GLib
.
source_remove
(
self
.
_timer_id
)
GLib
.
source_remove
(
self
.
_timer_id
)
self
.
_timer_id
=
None
self
.
_timer_id
=
None
for
future
in
self
.
_pending_futures
:
future
.
cancel
()
self
.
_pending_futures
.
clear
()
def
_update_widget
(
self
):
def
_update_widget
(
self
):
if
self
.
widget
and
self
.
_widget_ready
:
if
self
.
widget
and
self
.
_widget_ready
:
...
...
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