Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm-play-gui
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
eepm-play-gui
Commits
914216a3
Commit
914216a3
authored
Oct 02, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unnecessary function removed
parent
3dfa9d39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
window.py
src/window.py
+7
-21
No files found.
src/window.py
View file @
914216a3
...
...
@@ -41,35 +41,26 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
search_dropdown
.
connect
(
"notify::selected"
,
self
.
on_filter_changed
)
self
.
choice_listbox
.
set_filter_func
(
self
.
listbox_filter_func
)
self
.
loading_count
=
0
# Track loading operations
self
.
load_applications
()
self
.
update_ui
()
def
show_loading_spinner
(
self
):
self
.
loading_spinner
.
set_visible
(
True
)
self
.
choice_listbox
.
set_visible
(
False
)
# Скрыть группу настроек во время загрузки
self
.
loading_count
+=
1
# Increment loading counter
def
hide_loading_spinner
(
self
):
self
.
loading_count
-=
1
# Decrement loading counter
if
self
.
loading_count
==
0
:
self
.
loading_spinner
.
set_visible
(
False
)
self
.
choice_listbox
.
set_visible
(
True
)
def
load_applications
(
self
):
self
.
show_loading_spinner
()
ApplicationManager
.
get_available_applications
(
self
.
on_applications_loaded
)
self
.
loading_spinner
.
set_visible
(
False
)
self
.
choice_listbox
.
set_visible
(
True
)
def
on_applications_loaded
(
self
,
applications
,
error
=
None
):
if
error
:
print
(
f
"Error: {error}"
)
else
:
self
.
applications
=
applications
self
.
update_ui
()
self
.
hide_loading_spinner
()
# Move this to ensure it waits for installation loading too
def
update_ui
(
self
):
self
.
show_loading_spinner
()
# Show loading again for installed apps
ApplicationManager
.
get_available_applications
(
self
.
on_applications_loaded
)
ApplicationManager
.
get_installed_applications
(
self
.
on_installed_apps_loaded
)
self
.
choice_listbox
.
invalidate_filter
()
...
...
@@ -83,8 +74,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
checkboxes
=
{}
for
app
in
self
.
applications
:
self
.
add_application_row
(
app
)
self
.
hide_loading_spinner
()
# Now only hides after both loads are done
self
.
hide_loading_spinner
()
def
clear_choice_listbox
(
self
):
self
.
choice_listbox
.
remove_all
()
...
...
@@ -191,10 +181,6 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
dialog
.
present
(
self
)
# Создание и передача функции обратного вызова для обновления UI
runner
=
CommandRunner
(
on_done
=
self
.
update_ui
_after_log
)
runner
=
CommandRunner
(
on_done
=
self
.
update_ui
)
runner
.
run_command
(
command
,
dialog
)
def
update_ui_after_log
(
self
):
self
.
update_ui
()
# Обновление UI после закрытия диалога
self
.
hide_loading_spinner
()
# Скрыть сообщение о загрузке после закрытия диалога
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