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
cb09107a
Commit
cb09107a
authored
Oct 13, 2024
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repository structure redesigned
parent
de1649a0
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
63 deletions
+78
-63
eepm-play-gui.gresource.xml
src/eepm-play-gui.gresource.xml
+1
-1
meson.build
src/meson.build
+15
-5
__init__.py
src/tools/__init__.py
+0
-0
appsmanager.py
src/tools/appsmanager.py
+0
-0
command_runner.py
src/tools/command_runner.py
+0
-0
__init__.py
src/widgets/__init__.py
+0
-0
applicationrow.py
src/widgets/applicationrow.py
+39
-0
logdialog.cmb
src/widgets/logdialog.cmb
+0
-0
logdialog.py
src/widgets/logdialog.py
+18
-0
logdialog.ui
src/widgets/logdialog.ui
+0
-0
window.py
src/window.py
+5
-57
No files found.
src/eepm-play-gui.gresource.xml
View file @
cb09107a
...
...
@@ -3,7 +3,7 @@
<gresource
prefix=
"/ru/eepm/PlayGUI"
>
<file>
style.css
</file>
<file
preprocess=
"xml-stripblanks"
>
window.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
logdialog.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
widgets/
logdialog.ui
</file>
<file
preprocess=
"xml-stripblanks"
>
gtk/help-overlay.ui
</file>
</gresource>
</gresources>
src/meson.build
View file @
cb09107a
...
...
@@ -20,12 +20,22 @@ gnome.compile_resources('eepm-play-gui',
install_dir: pkgdatadir,
)
eepm_play_gui_
sources
= [
eepm_play_gui_
main
= [
'__init__.py',
'main.py',
'window.py',
'command_runner.py',
'appsmanager.py',
]
]
eepm_play_gui_widgets = [
'__init__.py',
'widgets/logdialog.py',
'widgets/applicationrow.py',
]
eepm_play_gui_tools = [
'__init__.py',
'tools/command_runner.py',
'tools/appsmanager.py',
]
install_data(eepm_play_gui_sources, install_dir: moduledir)
install_data(eepm_play_gui_main, install_dir: moduledir)
install_data(eepm_play_gui_widgets, install_dir: moduledir / 'widgets')
install_data(eepm_play_gui_tools, install_dir: moduledir / 'tools')
src/tools/__init__.py
0 → 100644
View file @
cb09107a
src/appsmanager.py
→
src/
tools/
appsmanager.py
View file @
cb09107a
File moved
src/command_runner.py
→
src/
tools/
command_runner.py
View file @
cb09107a
File moved
src/widgets/__init__.py
0 → 100644
View file @
cb09107a
src/widgets/applicationrow.py
0 → 100644
View file @
cb09107a
from
gi.repository
import
Adw
,
Gtk
class
ApplicationRow
(
Adw
.
ActionRow
):
def
__init__
(
self
,
app
,
is_installed
,
on_toggle
):
super
()
.
__init__
(
title
=
app
[
'name'
],
subtitle
=
app
[
'dscr'
])
self
.
app
=
app
self
.
is_installed
=
is_installed
self
.
checkbox
=
Gtk
.
CheckButton
()
self
.
checkbox
.
add_css_class
(
"selection-mode"
)
self
.
checkbox
.
set_active
(
is_installed
)
self
.
checkbox
.
connect
(
"toggled"
,
self
.
on_checkbox_toggled
)
self
.
add_suffix
(
self
.
checkbox
)
self
.
on_toggle
=
on_toggle
# Callback for when the checkbox is toggled
def
on_checkbox_toggled
(
self
,
checkbox
):
self
.
on_toggle
(
self
.
app
[
'name'
],
checkbox
.
get_active
())
self
.
update_row_css
()
# Update the row's style when toggled
def
is_changed
(
self
):
"""Determine if the checkbox state has changed compared to the installed state."""
return
self
.
checkbox
.
get_active
()
!=
self
.
is_installed
def
update_row_css
(
self
):
"""Update the CSS classes for the row based on the checkbox state."""
for
css
in
[
"marked-for-install"
,
"marked-for-removal"
,
"unchanged"
]:
self
.
remove_css_class
(
css
)
# Add the appropriate class based on the current checkbox state
if
self
.
is_changed
():
if
self
.
checkbox
.
get_active
():
self
.
add_css_class
(
"marked-for-install"
)
print
(
"marked-for-install"
)
else
:
self
.
add_css_class
(
"marked-for-removal"
)
print
(
"marked-for-removal"
)
else
:
# self.add_css_class("unchanged")
print
(
"marked-unchanged"
)
src/logdialog.cmb
→
src/
widgets/
logdialog.cmb
View file @
cb09107a
File moved
src/widgets/logdialog.py
0 → 100644
View file @
cb09107a
from
gi.repository
import
Gtk
,
Adw
from
..tools.command_runner
import
CommandRunner
@Gtk.Template
(
resource_path
=
'/ru/eepm/PlayGUI/widgets/logdialog.ui'
)
class
LogDialog
(
Adw
.
Dialog
):
__gtype_name__
=
'LogDialog'
logdialog_textview
=
Gtk
.
Template
.
Child
()
def
__init__
(
self
,
win
,
**
kwargs
):
super
()
.
__init__
(
**
kwargs
)
self
.
win
=
win
def
run
(
self
,
command
,
on_done
):
self
.
present
(
self
.
win
)
# Создание и передача функции обратного вызова для обновления UI
runner
=
CommandRunner
(
on_done
=
on_done
)
runner
.
run_command
(
command
,
self
)
src/logdialog.ui
→
src/
widgets/
logdialog.ui
View file @
cb09107a
File moved
src/window.py
View file @
cb09107a
...
...
@@ -20,66 +20,14 @@
from
gi.repository
import
Gtk
,
Adw
,
GObject
import
gettext
gettext
.
textdomain
(
'eepm-play-gui'
)
_
=
gettext
.
gettext
from
.appsmanager
import
ApplicationManager
from
.command_runner
import
CommandRunner
class
ApplicationRow
(
Adw
.
ActionRow
):
def
__init__
(
self
,
app
,
is_installed
,
on_toggle
):
super
()
.
__init__
(
title
=
app
[
'name'
],
subtitle
=
app
[
'dscr'
])
self
.
app
=
app
self
.
is_installed
=
is_installed
self
.
checkbox
=
Gtk
.
CheckButton
()
self
.
checkbox
.
add_css_class
(
"selection-mode"
)
self
.
checkbox
.
set_active
(
is_installed
)
self
.
checkbox
.
connect
(
"toggled"
,
self
.
on_checkbox_toggled
)
self
.
add_suffix
(
self
.
checkbox
)
self
.
on_toggle
=
on_toggle
# Callback for when the checkbox is toggled
def
on_checkbox_toggled
(
self
,
checkbox
):
self
.
on_toggle
(
self
.
app
[
'name'
],
checkbox
.
get_active
())
self
.
update_row_css
()
# Update the row's style when toggled
def
is_changed
(
self
):
"""Determine if the checkbox state has changed compared to the installed state."""
return
self
.
checkbox
.
get_active
()
!=
self
.
is_installed
def
update_row_css
(
self
):
"""Update the CSS classes for the row based on the checkbox state."""
for
css
in
[
"marked-for-install"
,
"marked-for-removal"
,
"unchanged"
]:
self
.
remove_css_class
(
css
)
# Add the appropriate class based on the current checkbox state
if
self
.
is_changed
():
if
self
.
checkbox
.
get_active
():
self
.
add_css_class
(
"marked-for-install"
)
print
(
"marked-for-install"
)
else
:
self
.
add_css_class
(
"marked-for-removal"
)
print
(
"marked-for-removal"
)
else
:
# self.add_css_class("unchanged")
print
(
"marked-unchanged"
)
from
.widgets.applicationrow
import
ApplicationRow
from
.widgets.logdialog
import
LogDialog
@Gtk.Template
(
resource_path
=
'/ru/eepm/PlayGUI/logdialog.ui'
)
class
LogDialog
(
Adw
.
Dialog
):
__gtype_name__
=
'LogDialog'
logdialog_textview
=
Gtk
.
Template
.
Child
()
def
__init__
(
self
,
win
,
**
kwargs
):
super
()
.
__init__
(
**
kwargs
)
self
.
win
=
win
def
run
(
self
,
command
,
on_done
):
self
.
present
(
self
.
win
)
# Создание и передача функции обратного вызова для обновления UI
runner
=
CommandRunner
(
on_done
=
on_done
)
runner
.
run_command
(
command
,
self
)
gettext
.
textdomain
(
'eepm-play-gui'
)
_
=
gettext
.
gettext
from
.tools.appsmanager
import
ApplicationManager
@Gtk.Template
(
resource_path
=
'/ru/eepm/PlayGUI/window.ui'
)
class
EepmPlayGuiWindow
(
Adw
.
ApplicationWindow
):
...
...
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