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
2387bd91
Commit
2387bd91
authored
Oct 07, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resetting the button status and lists immediately after command running
parent
112e365d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
window.py
src/window.py
+8
-3
No files found.
src/window.py
View file @
2387bd91
...
...
@@ -121,6 +121,9 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
applications
=
applications
def
update_ui
(
self
):
self
.
installed_apps
=
None
self
.
applications
=
None
self
.
show_loading_spinner
()
# Show loading again for installed apps
self
.
update_button_status
()
...
...
@@ -128,8 +131,6 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
ApplicationManager
.
get_available_applications
(
self
.
on_applications_loaded
)
ApplicationManager
.
get_installed_applications
(
self
.
on_installed_apps_loaded
)
self
.
choice_listbox
.
invalidate_filter
()
def
on_installed_apps_loaded
(
self
,
installed_apps
,
error
=
None
):
if
error
:
print
(
f
"Error: {error}"
)
...
...
@@ -140,6 +141,8 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
checkboxes
=
{}
for
app
in
self
.
applications
:
self
.
add_application_row
(
app
)
self
.
choice_listbox
.
invalidate_filter
()
self
.
hide_loading_spinner
()
def
clear_choice_listbox
(
self
):
...
...
@@ -213,6 +216,8 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
return
matches_search
# All
def
on_apply_clicked
(
self
,
button
):
commands
=
None
self
.
show_loading_spinner
()
# Показать сообщение о загрузке перед выполнением команды
to_install
,
to_remove
=
self
.
get_install_remove_lists
()
commands
=
self
.
build_commands
(
to_install
,
to_remove
)
...
...
@@ -225,7 +230,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
dialog
.
run
(
"pkexec epm play --update all"
,
on_done
=
self
.
update_ui
)
def
get_install_remove_lists
(
self
):
if
self
.
checkboxes
:
if
self
.
installed_apps
and
self
.
checkboxes
:
to_install
=
[
app_name
for
app_name
,
row
in
self
.
checkboxes
.
items
()
if
row
.
checkbox
.
get_active
()
and
app_name
not
in
self
.
installed_apps
]
to_remove
=
[
app_name
for
app_name
,
row
in
self
.
checkboxes
.
items
()
if
not
row
.
checkbox
.
get_active
()
and
app_name
in
self
.
installed_apps
]
return
to_install
,
to_remove
...
...
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