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
Roman Alifanov
eepm-play-gui
Commits
46883aaf
Commit
46883aaf
authored
Sep 26, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
label to spinner
parent
8b67a237
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
eepm-play-gui
eepm-play-gui
+17
-13
No files found.
eepm-play-gui
View file @
46883aaf
...
...
@@ -183,23 +183,27 @@ class MainWindow(Adw.ApplicationWindow):
self
.
toolbar
.
add_bottom_bar
(
bottom_clamp
)
# Создание и добавление сообщения о загрузке
self
.
loading_label
=
Gtk
.
Label
(
label
=
"Загрузка, пожалуйста подождите..."
)
self
.
content_box
.
append
(
self
.
loading_label
)
self
.
loading_label
.
set_visible
(
False
)
# Изначально скрыта
self
.
loading_spinner
=
Adw
.
Spinner
(
halign
=
"center"
,
valign
=
"center"
,
width_request
=
48
,
height_request
=
48
)
self
.
content_box
.
append
(
self
.
loading_spinner
)
self
.
loading_spinner
.
set_visible
(
False
)
# Изначально скрыта
def
show_loading_
message
(
self
):
self
.
loading_
label
.
set_visible
(
True
)
def
show_loading_
spinner
(
self
):
self
.
loading_
spinner
.
set_visible
(
True
)
self
.
preferences_group
.
set_visible
(
False
)
# Скрыть группу настроек во время загрузки
self
.
loading_count
+=
1
# Increment loading counter
def
hide_loading_
message
(
self
):
def
hide_loading_
spinner
(
self
):
self
.
loading_count
-=
1
# Decrement loading counter
if
self
.
loading_count
==
0
:
self
.
loading_
label
.
set_visible
(
False
)
self
.
loading_
spinner
.
set_visible
(
False
)
self
.
preferences_group
.
set_visible
(
True
)
def
load_applications
(
self
):
self
.
show_loading_
message
()
self
.
show_loading_
spinner
()
ApplicationManager
.
get_available_applications
(
self
.
on_applications_loaded
)
def
on_applications_loaded
(
self
,
applications
,
error
=
None
):
...
...
@@ -208,10 +212,10 @@ class MainWindow(Adw.ApplicationWindow):
else
:
self
.
applications
=
applications
self
.
update_ui
()
self
.
hide_loading_
message
()
# Move this to ensure it waits for installation loading too
self
.
hide_loading_
spinner
()
# Move this to ensure it waits for installation loading too
def
update_ui
(
self
):
self
.
show_loading_
message
()
# Show loading again for installed apps
self
.
show_loading_
spinner
()
# Show loading again for installed apps
ApplicationManager
.
get_installed_applications
(
self
.
on_installed_apps_loaded
)
def
on_installed_apps_loaded
(
self
,
installed_apps
,
error
=
None
):
...
...
@@ -225,7 +229,7 @@ class MainWindow(Adw.ApplicationWindow):
for
app
in
self
.
applications
:
self
.
add_application_row
(
app
)
self
.
hide_loading_
message
()
# Now only hides after both loads are done
self
.
hide_loading_
spinner
()
# Now only hides after both loads are done
def
clear_preferences_group
(
self
):
self
.
content_box
.
remove
(
self
.
preferences_group
)
...
...
@@ -254,7 +258,7 @@ class MainWindow(Adw.ApplicationWindow):
print
(
f
"{app_name} {'установлен' if active else 'снят'}"
)
def
on_apply_clicked
(
self
,
button
):
self
.
show_loading_
message
()
# Показать сообщение о загрузке перед выполнением команды
self
.
show_loading_
spinner
()
# Показать сообщение о загрузке перед выполнением команды
to_install
,
to_remove
=
self
.
get_install_remove_lists
()
commands
=
self
.
build_commands
(
to_install
,
to_remove
)
...
...
@@ -310,7 +314,7 @@ class MainWindow(Adw.ApplicationWindow):
def
update_ui_after_log
(
self
):
self
.
update_ui
()
# Обновление UI после закрытия диалога
self
.
hide_loading_
message
()
# Скрыть сообщение о загрузке после закрытия диалога
self
.
hide_loading_
spinner
()
# Скрыть сообщение о загрузке после закрытия диалога
class
MyApp
(
Adw
.
Application
):
...
...
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