Commit dce5d6e3 authored by Roman Alifanov's avatar Roman Alifanov

Merge branch 'master' into 'master'

Some changes See merge request !1
parents cd15cdba bc42a32c
.idea
\ No newline at end of file
.idea
# vscode
.vscode
# .po
*.mo
*.pot
# flatpak
.flatpak
# meson
_build
[Desktop Entry]
Name=eepm play
Exec=eepm-play-gui
Exec=eepm-play-gui %U
Icon=ru.eepm.PlayGUI
Comment=Install applications from official sites
Comment[ru]=Установка приложений с официальных сайтов
Terminal=false
Type=Application
......
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>ru.eepm.PlayGUI.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>AGPL-3.0-or-later</project_license>
<description>
<p>No description</p>
</description>
<id>ru.eepm.PlayGUI.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>AGPL-3.0-or-later</project_license>
<description>
<p>No description</p>
</description>
</component>
......@@ -6,8 +6,10 @@ project('eepm-play-gui',
i18n = import('i18n')
gnome = import('gnome')
python = import('python')
pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
moduledir = pkgdatadir / 'eepm_play_gui'
subdir('data')
subdir('src')
......
......@@ -2,5 +2,6 @@ data/ru.eepm.PlayGUI.desktop.in
data/ru.eepm.PlayGUI.metainfo.xml.in
data/ru.eepm.PlayGUI.gschema.xml
src/main.py
src/help-overlay.ui
src/window.py
src/window.ui
i18n.gettext('eepm-play-gui', preset: 'glib')
i18n.gettext(meson.project_name(), preset: 'glib')
msgid ""
msgstr ""
"Project-Id-Version: ru.eepm.PlayGUI\n"
"POT-Creation-Date: 2024-10-07 19:12+0300\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 12:09+0300\n"
"PO-Revision-Date: 2024-10-07 19:17+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
......@@ -13,60 +14,77 @@ msgstr ""
"X-Poedit-Basepath: ../src\n"
"X-Poedit-SearchPath-0: .\n"
#: gtk/help-overlay.ui:11
#: data/ru.eepm.PlayGUI.desktop.in:3
msgid "eepm play"
msgstr ""
#: data/ru.eepm.PlayGUI.desktop.in:7
#, fuzzy
msgid "Install applications from official sites"
msgstr "Установить программы"
#: data/ru.eepm.PlayGUI.metainfo.xml.in:7
msgid "No description"
msgstr ""
#: data/ui/help-overlay.ui:11
msgctxt "shortcut window"
msgid "General"
msgstr ""
#: gtk/help-overlay.ui:14
#: data/ui/help-overlay.ui:14
msgctxt "shortcut window"
msgid "Show Shortcuts"
msgstr ""
#: gtk/help-overlay.ui:20
#: data/ui/help-overlay.ui:20
msgctxt "shortcut window"
msgid "Quit"
msgstr "Выйти"
#: window.py:167
msgid "Remove and install applications"
msgstr "Удалить и установить программы"
#: window.py:168
msgid "Install applications"
msgstr "Установить программы"
#: window.py:169
msgid "Remove applications"
msgstr "Удалить программы"
#: window.py:170 window.ui:100
msgid "Update applications"
msgstr "Обновить программы"
#: data/ui/window.ui:46
msgid "Getting packages list…"
msgstr "Получение списка пакетов…"
#: window.ui:20
msgid "Menu"
msgstr ""
#: data/ui/window.ui:47
msgid "It could take a while"
msgstr "Это может занять некоторое время"
#: window.ui:48
#: data/ui/window.ui:79
msgid "All"
msgstr "Все"
#: window.ui:49
#: data/ui/window.ui:80
msgid "Installed"
msgstr "Установленные"
#: window.ui:50
#: data/ui/window.ui:81
msgid "Uninstalled"
msgstr "Неустановленные"
#: window.ui:51
#: data/ui/window.ui:82
msgid "Changed"
msgstr "Изменённые"
#: window.ui:122
#: data/ui/window.ui:132 src/window.py:180
msgid "Update applications"
msgstr "Обновить программы"
#: data/ui/window.ui:158
msgid "_About Eepm-play-gui"
msgstr "О программе"
msgstr "_О программе"
#: src/window.py:177
msgid "Remove and install applications"
msgstr "Удалить и установить программы"
#: src/window.py:178
msgid "Install applications"
msgstr "Установить программы"
#: src/window.py:179
msgid "Remove applications"
msgstr "Удалить программы"
#~ msgid "Apply"
#~ msgstr "Применить"
......@@ -36,11 +36,6 @@ class EepmPlayGuiApplication(Adw.Application):
self.create_action('quit', lambda *_: self.quit(), ['<primary>q'])
self.create_action('about', self.on_about_action)
provider = Gtk.CssProvider()
provider.load_from_resource("/ru/eepm/PlayGUI/style.css")
display = Gdk.Display.get_default()
Gtk.StyleContext.add_provider_for_display(display, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
def do_activate(self):
"""Called when the application is activated.
......@@ -54,16 +49,16 @@ class EepmPlayGuiApplication(Adw.Application):
def on_about_action(self, widget, _):
"""Callback for the app.about action."""
about = Adw.AboutWindow(transient_for=self.props.active_window,
application_name='eepm-play-gui',
about = Adw.AboutDialog(application_name='eepm-play-gui',
application_icon='ru.eepm.PlayGUI',
developer_name='Etersoft',
version='0.2.0',
developers=['Ximper'],
artists=['Ximper', "Vladimir Vaskov <rirusha@altlinux.org>"],
developers=['Ximper', "Vladimir Vaskov <rirusha@altlinux.org>"],
designers=['Ximper', "Vladimir Vaskov <rirusha@altlinux.org>"],
artists=['Ximper'],
license_type=Gtk.License.AGPL_3_0,
copyright='© 2024 Etersoft')
about.present()
about.present(self.props.active_window)
def create_action(self, name, callback, shortcuts=None):
"""Add an application action.
......
pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
moduledir = pkgdatadir / 'eepm_play_gui'
gnome = import('gnome')
gnome.compile_resources('eepm-play-gui',
'eepm-play-gui.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
)
python = import('python')
conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').full_path())
conf.set('VERSION', meson.project_version())
......@@ -26,6 +13,13 @@ configure_file(
install_mode: 'r-xr-xr-x'
)
gnome.compile_resources('eepm-play-gui',
'eepm-play-gui.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
)
eepm_play_gui_sources = [
'__init__.py',
'main.py',
......
......@@ -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,16 @@ class LogDialog(Adw.Dialog):
@Gtk.Template(resource_path='/ru/eepm/PlayGUI/window.ui')
class EepmPlayGuiWindow(Adw.ApplicationWindow):
__gtype_name__ = 'EepmPlayGuiWindow'
is_loading = GObject.Property(type=bool, default=True)
search_entry = Gtk.Template.Child()
search_bar = 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 +102,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_bar.connect_entry(self.search_entry)
self.search_entry.connect("search-changed", self.on_search_changed)
self.search_dropdown.connect("notify::selected", self.on_filter_changed)
......@@ -105,14 +114,9 @@ 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_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 +128,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 +147,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 +222,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment