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
64da4d68
Commit
64da4d68
authored
Jan 28, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings: pause update timer when page is hidden
parent
6a45fc46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
base.py
src/settings/setting/base.py
+18
-2
No files found.
src/settings/setting/base.py
View file @
64da4d68
...
...
@@ -58,8 +58,6 @@ class BaseSetting:
self
.
prepare_map
()
self
.
update_interval
=
setting_data
.
get
(
"update_interval"
,
None
)
if
self
.
update_interval
:
self
.
_start_update_timer
()
# Page reload flags
self
.
reload_page_after_set
=
setting_data
.
get
(
"reload_page_after_set"
,
False
)
...
...
@@ -79,6 +77,10 @@ class BaseSetting:
self
.
_ensure_value_loaded
()
self
.
_update_widget
()
if
self
.
update_interval
and
self
.
widget
and
hasattr
(
self
.
widget
,
'row'
):
self
.
widget
.
row
.
connect
(
'map'
,
self
.
_on_row_map
)
self
.
widget
.
row
.
connect
(
'unmap'
,
self
.
_on_row_unmap
)
def
_sync_busy
(
self
):
if
self
.
widget
and
self
.
_widget_ready
:
if
self
.
type
.
startswith
(
'info_'
):
...
...
@@ -382,7 +384,16 @@ class BaseSetting:
self
.
_load_map_async
()
return
self
.
map
def
_on_row_map
(
self
,
widget
):
self
.
_start_update_timer
()
def
_on_row_unmap
(
self
,
widget
):
self
.
_stop_update_timer
()
def
_start_update_timer
(
self
):
if
self
.
_timer_id
is
not
None
:
return
try
:
interval
=
float
(
self
.
update_interval
)
except
(
TypeError
,
ValueError
):
...
...
@@ -396,6 +407,11 @@ class BaseSetting:
self
.
_timer_id
=
GLib
.
timeout_add
(
int
(
interval
*
1000
),
_poll
)
def
_stop_update_timer
(
self
):
if
self
.
_timer_id
is
not
None
:
GLib
.
source_remove
(
self
.
_timer_id
)
self
.
_timer_id
=
None
def
_submit_task
(
self
,
func
,
on_success
=
None
,
on_error
=
None
,
on_done
=
None
):
def
_wrapped_done
():
if
future
in
self
.
_pending_futures
:
...
...
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