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
eff479f8
Unverified
Commit
eff479f8
authored
Oct 08, 2024
by
Vladimir Vaskov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ui
parent
9d857475
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
window.ui
data/ui/window.ui
+0
-0
window.py
src/window.py
+20
-13
No files found.
data/ui/window.ui
View file @
eff479f8
This diff is collapsed.
Click to expand it.
src/window.py
View file @
eff479f8
...
...
@@ -17,7 +17,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-or-later
from
gi.repository
import
Gtk
,
Adw
from
gi.repository
import
Gtk
,
Adw
,
GObject
import
gettext
gettext
.
textdomain
(
'eepm-play-gui'
)
...
...
@@ -83,10 +83,15 @@ class LogDialog(Adw.Dialog):
@Gtk.Template
(
resource_path
=
'/ru/eepm/PlayGUI/ui/window.ui'
)
class
EepmPlayGuiWindow
(
Adw
.
ApplicationWindow
):
__gtype_name__
=
'EepmPlayGuiWindow'
is_loading
=
GObject
.
Property
(
type
=
bool
,
default
=
True
)
search_entry
=
Gtk
.
Template
.
Child
()
search_toggle_button
=
Gtk
.
Template
.
Child
()
main_stack
=
Gtk
.
Template
.
Child
()
search_dropdown
=
Gtk
.
Template
.
Child
()
loading_spinner
=
Gtk
.
Template
.
Child
()
choice_listbox
=
Gtk
.
Template
.
Child
()
apply_button
=
Gtk
.
Template
.
Child
()
...
...
@@ -96,6 +101,9 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
checkboxes
=
None
self
.
apply_button
.
connect
(
"activated"
,
self
.
on_apply_clicked
)
self
.
connect
(
"notify::is-loading"
,
self
.
on_is_loading_changed
)
self
.
search_toggle_button
.
connect
(
"notify::active"
,
self
.
on_search_toggle_button_clicked
)
self
.
search_entry
.
connect
(
"search-changed"
,
self
.
on_search_changed
)
self
.
search_dropdown
.
connect
(
"notify::selected"
,
self
.
on_filter_changed
)
...
...
@@ -105,14 +113,13 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
dialog
=
LogDialog
(
win
=
self
)
self
.
update_ui
()
def
show_loading_spinner
(
self
):
self
.
loading_spinner
.
set_visible
(
True
)
self
.
choice_listbox
.
set_visible
(
False
)
# Скрыть группу настроек во время загрузки
def
hide_loading_spinner
(
self
):
self
.
loading_spinner
.
set_visible
(
False
)
self
.
choice_listbox
.
set_visible
(
True
)
def
on_search_toggle_button_clicked
(
self
,
obj
,
_pspec
):
if
not
self
.
search_toggle_button
.
props
.
active
:
self
.
search_entry
.
props
.
text
=
""
def
on_is_loading_changed
(
self
,
obj
,
_pspec
):
self
.
main_stack
.
props
.
visible_child_name
=
"loading"
if
self
.
props
.
is_loading
else
"main"
def
on_applications_loaded
(
self
,
applications
,
error
=
None
):
if
error
:
...
...
@@ -124,7 +131,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
installed_apps
=
None
self
.
applications
=
None
self
.
show_loading_spinner
()
# Show loading again for installed apps
self
.
props
.
is_loading
=
True
self
.
update_button_status
()
...
...
@@ -143,7 +150,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
self
.
add_application_row
(
app
)
self
.
choice_listbox
.
invalidate_filter
()
self
.
hide_loading_spinner
()
self
.
props
.
is_loading
=
False
def
clear_choice_listbox
(
self
):
self
.
choice_listbox
.
remove_all
()
...
...
@@ -218,7 +225,7 @@ class EepmPlayGuiWindow(Adw.ApplicationWindow):
def
on_apply_clicked
(
self
,
button
):
commands
=
None
self
.
show_loading_spinner
()
# Показать сообщение о загрузке перед выполнением команды
self
.
props
.
is_loading
=
True
# Показать сообщение о загрузке перед выполнением команды
to_install
,
to_remove
=
self
.
get_install_remove_lists
()
commands
=
self
.
build_commands
(
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