Rename to Warehouse

This commit is contained in:
kramo
2023-09-18 20:11:42 +02:00
parent 9e4a7f7124
commit 7ab64f6b3b
28 changed files with 425 additions and 219 deletions

View File

@@ -17,7 +17,7 @@ jobs:
- name: Flatpak Builder
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1
with:
bundle: io.github.heliguy4599.FlattoolGUI.flatpak
manifest-path: io.github.heliguy4599.FlattoolGUI.json
bundle: io.github.heliguy4599.Warehouse.flatpak
manifest-path: io.github.heliguy4599.Warehouse.json
repository-name: gnome-nightly
repository-url: https://nightly.gnome.org/gnome-nightly.flatpakrepo

View File

@@ -1,20 +1,20 @@
# 🛠️ Flattool GUI
# 🛠️ Warehouse
<p align="center">
<img src="https://github.com/flattool/flattool-cli/raw/main/flattool_logo-name.png" alt="Flattool Logo">
<img src="https://github.com/flattool/flattool-cli/raw/main/flattool_logo-name.png" alt="Warehouse Logo">
</p>
## Flattool GUI is a versatile toolbox for managing flatpak user data, viewing flatpak app info, and batch managing installed flatpaks.
## Warehouse is a versatile toolbox for managing flatpak user data, viewing flatpak app info, and batch managing installed flatpaks.
## 🚀 Main Features:
1. **Viewing Flatpak Info:** 📋 Flattool can display all the information provided by the `flatpak list` command in a user-friendly graphical window. Each item includes a button for easy copying.
1. **Viewing Flatpak Info:** 📋 Warehouse can display all the information provided by the `flatpak list` command in a user-friendly graphical window. Each item includes a button for easy copying.
2. **Managing User Data:** 🗑️ Flatpaks store user data in a specific system location, often left behind when an app is uninstalled. Flattool can uninstall an app and delete its data, delete data without uninstalling, or simply show if an app has user data.
2. **Managing User Data:** 🗑️ Flatpaks store user data in a specific system location, often left behind when an app is uninstalled. Warehouse can uninstall an app and delete its data, delete data without uninstalling, or simply show if an app has user data.
3. **Batch Actions:**Flattool features a batch mode for swift uninstallations, user data deletions, and app ID copying in bulk.
3. **Batch Actions:**Warehouse features a batch mode for swift uninstallations, user data deletions, and app ID copying in bulk.
4. **Leftover Data Management:** 📁 Flattool scans the user data folder to check for installed apps associated with the data. If none are found, it can delete the data or attempt to install a matching flatpak.
4. **Leftover Data Management:** 📁 Warehouse scans the user data folder to check for installed apps associated with the data. If none are found, it can delete the data or attempt to install a matching flatpak.
![Alt text](screenshots.png)
@@ -23,24 +23,24 @@
- You can always open issues, PRs, and use other GitHub features here
## Important Notes:
- Translators, I thank you very much for your interest and contributions, but as of now Flattool GUI is not accpeting any translation work until proper translation infrastructure is in place.
- Translators, I thank you very much for your interest and contributions, but as of now Warehouse is not accpeting any translation work until proper translation infrastructure is in place.
- This project is still in its early stages, developed by a newcomer. Your understanding of potential bugs is greatly appreciated.
- Flattool assumes flatpak user data is located in the default directory: `~/.var/app`.
- Flattool does not aim to replace flatpak; it simply facilitates appropriate flatpak commands for the desired actions.
- Warehouse assumes flatpak user data is located in the default directory: `~/.var/app`.
- Warehouse does not aim to replace flatpak; it simply facilitates appropriate flatpak commands for the desired actions.
## 📦 Dependencies:
To use Flattool effectively, ensure the following dependencies are installed on your system:
To use Warehouse effectively, ensure the following dependencies are installed on your system:
- GIO
- [GNOME Nightly Flatpak Remote](https://wiki.gnome.org/Apps/Nightly)
## 🛠️ Installation Steps:
1. Make sure you have the above dependencies installed.
2. Visit the [releases](https://github.com/flattool/flattool-gui/releases) page and download `io.github.heliguy4599.FlattoolGUI.flatpak`.
2. Visit the [releases](https://github.com/flattool/warehouse/releases) page and download `io.github.heliguy4599.Warehouse.flatpak`.
3. Install it using your software store or run the following command:
```shell
$ flatpak install /path/to/io.github.heliguy4599.FlattoolGUI.flatpak
$ flatpak install /path/to/io.github.heliguy4599.Warehouse.flatpak
```
You're all set! Launch the application by clicking its icon in your app menu or running:
```shell
$ flatpak run io.github.heliguy4599.FlattoolGUI
$ flatpak run io.github.heliguy4599.Warehouse
```

View File

@@ -4,3 +4,4 @@ After 1.0
- Separate Orphans Window
- Export in batch mode
- Copy drop down in batch mode
- World domination

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,4 +1,4 @@
application_id = 'io.github.heliguy4599.FlattoolGUI'
application_id = 'io.github.heliguy4599.Warehouse'
scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="flattool-gui">
<schema id="io.github.heliguy4599.FlattoolGUI" path="/io/github/heliguy4599/FlattoolGUI/">
</schema>
</schemalist>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>io.github.heliguy4599.FlattoolGUI.desktop</id>
<id>io.github.heliguy4599.Warehouse.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<description>

View File

@@ -1,7 +1,7 @@
[Desktop Entry]
Name=Warehouse
Exec=flattool-gui
Icon=io.github.heliguy4599.FlattoolGUI
Exec=warehouse
Icon=io.github.heliguy4599.Warehouse
Terminal=false
Type=Application
Categories=GTK;

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="warehouse">
<schema id="io.github.heliguy4599.Warehouse" path="/io/github/heliguy4599/Warehouse/">
</schema>
</schemalist>

View File

@@ -1,6 +1,6 @@
desktop_file = i18n.merge_file(
input: 'io.github.heliguy4599.FlattoolGUI.desktop.in',
output: 'io.github.heliguy4599.FlattoolGUI.desktop',
input: 'io.github.heliguy4599.Warehouse.desktop.in',
output: 'io.github.heliguy4599.Warehouse.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
@@ -13,8 +13,8 @@ if desktop_utils.found()
endif
appstream_file = i18n.merge_file(
input: 'io.github.heliguy4599.FlattoolGUI.appdata.xml.in',
output: 'io.github.heliguy4599.FlattoolGUI.appdata.xml',
input: 'io.github.heliguy4599.Warehouse.appdata.xml.in',
output: 'io.github.heliguy4599.Warehouse.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'appdata')
@@ -25,7 +25,7 @@ if appstream_util.found()
test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
endif
install_data('io.github.heliguy4599.FlattoolGUI.gschema.xml',
install_data('io.github.heliguy4599.Warehouse.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas')
)

View File

@@ -1,9 +1,9 @@
{
"id" : "io.github.heliguy4599.FlattoolGUI",
"id" : "io.github.heliguy4599.Warehouse",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"command" : "flattool-gui",
"command" : "warehouse",
"finish-args" : [
"--share=network",
"--share=ipc",
@@ -42,7 +42,7 @@
]
},
{
"name" : "flattool-gui",
"name" : "warehouse",
"builddir" : true,
"buildsystem" : "meson",
"sources" : [

View File

@@ -1,4 +1,4 @@
project('flattool-gui',
project('warehouse',
version: '0.3.0',
meson_version: '>= 0.62.0',
default_options: [ 'warning_level=2', 'werror=false', ],

View File

@@ -1,6 +1,6 @@
data/io.github.heliguy4599.FlattoolGUI.desktop.in
data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in
data/io.github.heliguy4599.FlattoolGUI.gschema.xml
data/io.github.heliguy4599.Warehouse.desktop.in
data/io.github.heliguy4599.Warehouse.appdata.xml.in
data/io.github.heliguy4599.Warehouse.gschema.xml
src/main.py
src/window.py
src/window.blp

View File

@@ -1,11 +1,11 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023 Kuchenmampfer
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# FIRST AUTHOR <accounts@kuchenmampfer.de>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 16:25-0400\n"
"PO-Revision-Date: 2023-09-03 00:00+0200\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.1\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
msgstr "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr "Warehouse"
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr "Keine Beschreibung"
@@ -67,9 +67,9 @@ msgstr "Bitte warten"
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr ""
"Flattool versucht, die ausgewählten Programme zu installieren. Dies kann "
"Warehouse versucht, die ausgewählten Programme zu installieren. Dies kann "
"eine Weile dauern."
#: src/window.py:212
@@ -227,16 +227,16 @@ msgstr "Keine Flatpaks gefunden"
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
"Flattool kann die Liste der installierten Flatpaks nicht sehen oder es sind "
"Warehouse kann die Liste der installierten Flatpaks nicht sehen oder es sind "
"keine Flatpaks auf dem System installiert."
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr ""
"Flattool deinstalliert die ausgewählten Programme. Dies kann eine Weile "
"Warehouse deinstalliert die ausgewählten Programme. Dies kann eine Weile "
"dauern."
#: src/window.blp:113
@@ -252,5 +252,5 @@ msgid "_Keyboard Shortcuts"
msgstr "_Tastaturbefehle"
#: src/window.blp:133
msgid "_About Flattool-gui"
msgstr "_Über Flattool-gui"
msgid "_About Warehouse"
msgstr "_Über Warehouse"

View File

@@ -1,12 +1,12 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Heliguy
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# FIRST AUTHOR <racsufkoficial@gmail.com>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 16:11-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
msgstr "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr "Warehouse"
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr ""
@@ -65,8 +65,8 @@ msgstr "Espere, por favor"
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
msgstr "Flattool está intentando instalar las aplicaciones seleccionadas. Esto puede tardar un poco."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr "Warehouse está intentando instalar las aplicaciones seleccionadas. Esto puede tardar un poco."
#: src/window.py:212
msgid "~"
@@ -221,15 +221,15 @@ msgstr "No se han encontrado Flatpaks "
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
"Flattool no puede ver la lista de Flatpaks instalados o el sistema no tiene "
"Warehouse no puede ver la lista de Flatpaks instalados o el sistema no tiene "
"Flatpaks instaladas."
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgstr "Flattool está desinstalando las aplicaciones seleccionadas. Esto puede tardar un rato."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr "Warehouse está desinstalando las aplicaciones seleccionadas. Esto puede tardar un rato."
#: src/window.blp:113
msgid "Show Flatpak Runtimes"
@@ -244,5 +244,5 @@ msgid "_Keyboard Shortcuts"
msgstr "_Atajos de teclado"
#: src/window.blp:133
msgid "_About Flattool-gui"
msgstr "_Sobre Flattool-gui"
msgid "_About Warehouse"
msgstr "_Sobre Warehouse"

View File

@@ -1,12 +1,12 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Heliguy
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 17:37-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr ""
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr ""
@@ -65,7 +65,7 @@ msgstr ""
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr ""
#: src/window.py:212
@@ -220,12 +220,12 @@ msgstr ""
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr ""
#: src/window.blp:113
@@ -241,5 +241,5 @@ msgid "_Keyboard Shortcuts"
msgstr ""
#: src/window.blp:133
msgid "_About Flattool-gui"
msgid "_About Warehouse"
msgstr ""

View File

@@ -1 +1 @@
i18n.gettext('flattool-gui', preset: 'glib')
i18n.gettext('warehouse', preset: 'glib')

View File

@@ -1,11 +1,11 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Heliguy
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# runarcn <runarcn@proton.me>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 15:21-0400\n"
"PO-Revision-Date: 2023-09-02 22:08+0200\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.1\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
msgstr "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr "Warehouse"
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr "Ingen beskrivelse"
@@ -67,9 +67,9 @@ msgstr "Vennligst vent"
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr ""
"Flattool forsøker å installere programmene som er valgt. Dette kan ta litt "
"Warehouse forsøker å installere programmene som er valgt. Dette kan ta litt "
"tid."
#: src/window.py:212
@@ -225,15 +225,15 @@ msgstr "Ingen Flatpak-er funnet"
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
"Flattool kan ikke se listen over installerte Flatpak-er, eller systemet har "
"Warehouse kan ikke se listen over installerte Flatpak-er, eller systemet har "
"ingen Flatpak-er installert."
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgstr "Flattool avinstallerer de valgte programmene. Dette kan ta litt tid."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr "Warehouse avinstallerer de valgte programmene. Dette kan ta litt tid."
#: src/window.blp:113
#, fuzzy
@@ -249,5 +249,5 @@ msgid "_Keyboard Shortcuts"
msgstr "_Hurtigtaster"
#: src/window.blp:133
msgid "_About Flattool-gui"
msgstr "_Om Flattool-gui"
msgid "_About Warehouse"
msgstr "_Om Warehouse"

View File

@@ -1,11 +1,11 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Heliguy
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# runarcn <runarcn@proton.me>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 16:25-0400\n"
"PO-Revision-Date: 2023-09-02 22:39+0200\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.1\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
msgstr "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr "Warehouse"
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr "Ingen skildring"
@@ -67,9 +67,9 @@ msgstr "Vennlegst vent"
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr ""
"Flattool forsøkar å installere dei valde programma. Dette kan ta litt tid."
"Warehouse forsøkar å installere dei valde programma. Dette kan ta litt tid."
#: src/window.py:212
msgid "~"
@@ -224,15 +224,15 @@ msgstr "Ikkje noko Flatpak-er funne"
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
"Flattool kan ikkje sjå lista over installere Flatpak-er eller systemet har "
"Warehouse kan ikkje sjå lista over installere Flatpak-er eller systemet har "
"ikkje noko Flatpak-er installert."
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgstr "Flattool avinstallerer dei valde programma. Dette kan ta litt tid."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr "Warehouse avinstallerer dei valde programma. Dette kan ta litt tid."
#: src/window.blp:113
msgid "Show Flatpak Runtimes"
@@ -247,5 +247,5 @@ msgid "_Keyboard Shortcuts"
msgstr "_Hurtigtastar"
#: src/window.blp:133
msgid "_About Flattool-gui"
msgstr "_Om Flattool-gui"
msgid "_About Warehouse"
msgstr "_Om Warehouse"

View File

@@ -1,11 +1,11 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Heliguy
# This file is distributed under the same license as the flattool-gui package.
# This file is distributed under the same license as the warehouse package.
# runarcn <eryn@blahaj.land>, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: flattool-gui\n"
"Project-Id-Version: warehouse\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 16:25-0400\n"
"PO-Revision-Date: 2023-09-02 22:39+0200\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.1\n"
#: data/io.github.heliguy4599.FlattoolGUI.desktop.in:3
msgid "Flattool"
msgstr "Flattool"
#: data/io.github.heliguy4599.Warehouse.desktop.in:3
msgid "Warehouse"
msgstr "Warehouse"
#: data/io.github.heliguy4599.FlattoolGUI.appdata.xml.in:7
#: data/io.github.heliguy4599.Warehouse.appdata.xml.in:7
msgid "No description"
msgstr "Brak opisu"
@@ -67,8 +67,8 @@ msgstr "Proszę czekać"
#: src/window.py:176
msgid ""
"Flattool is attempting to install the selected apps. This could take a while."
msgstr "Flattool próbuje zainstalować wybrane aplikacje. To może chwilę potrwać."
"Warehouse is attempting to install the selected apps. This could take a while."
msgstr "Warehouse próbuje zainstalować wybrane aplikacje. To może chwilę potrwać."
#: src/window.py:212
msgid "~"
@@ -223,15 +223,15 @@ msgstr "Nie znaleziono aplikacji Flatpak"
#: src/window.blp:97
msgid ""
"Flattool cannot see the list of installed Flatpaks or the system has no "
"Warehouse cannot see the list of installed Flatpaks or the system has no "
"Flatpaks installed."
msgstr ""
"Flattool nie widzi listy zainstalowanych aplikacji Flatpak lub system nie ma "
"Warehouse nie widzi listy zainstalowanych aplikacji Flatpak lub system nie ma "
"zainstalowanych aplikacji Flatpak."
#: src/window.blp:102
msgid "Flattool is uninstalling the selected apps. This could take a while."
msgstr "Flattool odinstalowuje wybrane aplikacje. To może chwilę potrwać."
msgid "Warehouse is uninstalling the selected apps. This could take a while."
msgstr "Warehouse odinstalowuje wybrane aplikacje. To może chwilę potrwać."
#: src/window.blp:113
msgid "Show Flatpak Runtimes"
@@ -246,5 +246,5 @@ msgid "_Keyboard Shortcuts"
msgstr "_Skróty klawiszowe"
#: src/window.blp:133
msgid "_About Flattool-gui"
msgstr "_O Flattool-gui"
msgid "_About Warehouse"
msgstr "_O Warehouse"

View File

@@ -19,33 +19,48 @@
import sys
import gi
#import subprocess
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
# import subprocess
gi.require_version("Gtk", "4.0")
gi.require_version("Adw", "1")
from gi.repository import Gtk, Gio, Adw, GLib
from .window import FlattoolGuiWindow
from .window import WarehouseWindow
class FlattoolGuiApplication(Adw.Application):
class WarehouseApplication(Adw.Application):
"""The main application singleton class."""
def __init__(self):
super().__init__(application_id='io.github.heliguy4599.FlattoolGUI',
flags=Gio.ApplicationFlags.DEFAULT_FLAGS)
self.create_action('quit', lambda *_: self.quit(), ['<primary>q'])
self.create_action('about', self.on_about_action)
self.create_action('preferences', self.on_preferences_action)
self.create_action('search', self.on_search_action, ['<primary>f'])
self.create_action('manage-data-folders', self.on_manage_data_folders_action)
self.create_action('toggle-batch-mode', self.batch_mode_shortcut, ['<primary>b', '<primary>Return'])
self.create_action('select-all-in-batch-mode', self.select_all_shortcut, ['<primary>a'])
self.create_action('manage-data-folders', self.manage_data_shortcut, ['<primary>d'])
self.create_action('refresh-list', self.refresh_list_shortcut, ['<primary>r','F5'])
self.create_action('show-runtimes', self.show_runtimes_shortcut, ['<primary>t'])
super().__init__(
application_id="io.github.heliguy4599.Warehouse",
flags=Gio.ApplicationFlags.DEFAULT_FLAGS,
)
self.create_action("quit", lambda *_: self.quit(), ["<primary>q"])
self.create_action("about", self.on_about_action)
self.create_action("preferences", self.on_preferences_action)
self.create_action("search", self.on_search_action, ["<primary>f"])
self.create_action("manage-data-folders", self.on_manage_data_folders_action)
self.create_action(
"toggle-batch-mode",
self.batch_mode_shortcut,
["<primary>b", "<primary>Return"],
)
self.create_action(
"select-all-in-batch-mode", self.select_all_shortcut, ["<primary>a"]
)
self.create_action(
"manage-data-folders", self.manage_data_shortcut, ["<primary>d"]
)
self.create_action(
"refresh-list", self.refresh_list_shortcut, ["<primary>r", "F5"]
)
self.create_action("show-runtimes", self.show_runtimes_shortcut, ["<primary>t"])
self.show_runtimes_stateful = Gio.SimpleAction.new_stateful("show-runtimes", None, GLib.Variant.new_boolean(False))
self.show_runtimes_stateful = Gio.SimpleAction.new_stateful(
"show-runtimes", None, GLib.Variant.new_boolean(False)
)
self.show_runtimes_stateful.connect("activate", self.on_show_runtimes_action)
self.add_action(self.show_runtimes_stateful)
@@ -78,37 +93,54 @@ class FlattoolGuiApplication(Adw.Application):
"""
win = self.props.active_window
if not win:
win = FlattoolGuiWindow(application=self)
win = WarehouseWindow(application=self)
win.present()
#try:
#subprocess.run(['flattool', 'id', 'abcdefg'], check=True)
#except subprocess.CalledProcessError:
#print("Not found")
# try:
# subprocess.run(['flattool', 'id', 'abcdefg'], check=True)
# except subprocess.CalledProcessError:
# print("Not found")
def on_about_action(self, widget, _):
"""Callback for the app.about action."""
about = Adw.AboutWindow(transient_for=self.props.active_window,
application_name='Warehouse',
application_icon='io.github.heliguy4599.FlattoolGUI',
developer_name='Heliguy',
version='0.3.0',
developers=['Heliguy https://github.com/heliguy4599', 'kramo https://kramo.hu'],
artists=['Heliguy https://github.com/heliguy4599', 'kramo https://kramo.hu', 'eryn https://github.com/hericiumvevo'],
copyright='© 2023 The Files Authors\n\nThis application comes with absolutely no warranty. See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 only</a> for details.')
about = Adw.AboutWindow(
transient_for=self.props.active_window,
application_name="Warehouse",
application_icon="io.github.heliguy4599.Warehouse",
developer_name="Heliguy",
version="0.3.0",
developers=[
"Heliguy https://github.com/heliguy4599",
"kramo https://kramo.hu",
],
artists=[
"Heliguy https://github.com/heliguy4599",
"kramo https://kramo.hu",
"eryn https://github.com/hericiumvevo",
],
copyright='© 2023 The Files Authors\n\nThis application comes with absolutely no warranty. See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License, version 3 only</a> for details.',
)
about.present()
def on_preferences_action(self, widget, _):
"""Callback for the app.preferences action."""
print('app.preferences action activated')
print("app.preferences action activated")
def on_search_action(self, widget, _):
self.props.active_window.search_bar.set_search_mode(not self.props.active_window.search_bar.get_search_mode())
self.props.active_window.search_bar.set_search_mode(
not self.props.active_window.search_bar.get_search_mode()
)
def on_manage_data_folders_action(self, widget, _):
self.props.active_window.orphans_window()
def on_show_runtimes_action(self, widget, _):
self.show_runtimes_stateful.set_state(GLib.Variant.new_boolean(state := (not self.show_runtimes_stateful.get_property("state").get_boolean())))
self.show_runtimes_stateful.set_state(
GLib.Variant.new_boolean(
state := (
not self.show_runtimes_stateful.get_property("state").get_boolean()
)
)
)
self.props.active_window.show_runtimes_toggle_handler(state)
def create_action(self, name, callback, shortcuts=None):
@@ -129,5 +161,5 @@ class FlattoolGuiApplication(Adw.Application):
def main(version):
"""The application's entry point."""
app = FlattoolGuiApplication()
app = WarehouseApplication()
return app.run(sys.argv)

View File

@@ -11,8 +11,8 @@ blueprints = custom_target('blueprints',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
gnome.compile_resources('flattool-gui',
'flattool-gui.gresource.xml',
gnome.compile_resources('warehouse',
'warehouse.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
@@ -28,8 +28,8 @@ conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
configure_file(
input: 'flattool-gui.in',
output: 'flattool-gui',
input: 'warehouse.in',
output: 'warehouse',
configuration: conf,
install: true,
install_dir: get_option('bindir'),

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/io/github/heliguy4599/FlattoolGUI">
<gresource prefix="/io/github/heliguy4599/Warehouse">
<file preprocess="xml-stripblanks">window.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
</gresource>
<gresource prefix="/io/github/heliguy4599/FlattoolGUI/icons/scalable/actions/">
<gresource prefix="/io/github/heliguy4599/Warehouse/icons/scalable/actions/">
<file preprocess="xml-stripblanks">selection-mode-symbolic.svg</file>
<file preprocess="xml-stripblanks">error-symbolic.svg</file>
<file preprocess="xml-stripblanks">brush-symbolic.svg</file>

View File

@@ -1,6 +1,6 @@
#!@PYTHON@
# flattool-gui.in
# warehouse.in
#
# Copyright 2023 Heliguy
#
@@ -31,15 +31,15 @@ localedir = '@localedir@'
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
locale.bindtextdomain('flattool-gui', localedir)
locale.textdomain('flattool-gui')
gettext.install('flattool-gui', localedir)
locale.bindtextdomain('warehouse', localedir)
locale.textdomain('warehouse')
gettext.install('warehouse', localedir)
if __name__ == '__main__':
import gi
from gi.repository import Gio
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'flattool-gui.gresource'))
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'warehouse.gresource'))
resource._register()
from flattool_gui import main

View File

@@ -1,7 +1,7 @@
using Gtk 4.0;
using Adw 1;
template FlattoolGuiWindow : Adw.ApplicationWindow {
template WarehouseWindow : Adw.ApplicationWindow {
default-width: 800;
default-height: 500;
@@ -36,7 +36,7 @@ template FlattoolGuiWindow : Adw.ApplicationWindow {
[top]
SearchBar search_bar {
search-mode-enabled: bind-property search_button.active bidirectional;
key-capture-widget: FlattoolGuiWindow;
key-capture-widget: WarehouseWindow;
Adw.Clamp{
maximum-size: 577;
tightening-threshold: 220;
@@ -96,7 +96,7 @@ template FlattoolGuiWindow : Adw.ApplicationWindow {
Adw.StatusPage no_flatpaks {
icon-name: "error-symbolic";
title: _("No Flatpaks Found");
description: _("Flattool cannot see the list of installed Flatpaks or the system has no Flatpaks installed.");
description: _("Warehouse cannot see the list of installed Flatpaks or the system has no Flatpaks installed.");
}
}
}

View File

@@ -24,9 +24,10 @@ from gi.repository import Adw, Gdk, Gio, GLib, Gtk
from .show_properties_window import show_properties_window
from .orphans_window import show_orphans_window
@Gtk.Template(resource_path="/io/github/heliguy4599/FlattoolGUI/window.ui")
class FlattoolGuiWindow(Adw.ApplicationWindow):
__gtype_name__ = "FlattoolGuiWindow"
@Gtk.Template(resource_path="/io/github/heliguy4599/Warehouse/window.ui")
class WarehouseWindow(Adw.ApplicationWindow):
__gtype_name__ = "WarehouseWindow"
main_window_title = "Warehouse"
list_of_flatpaks = Gtk.Template.Child()
search_entry = Gtk.Template.Child()
@@ -70,14 +71,20 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
GLib.timeout_add(500, self.main_pulser)
def filter_func(self, row):
if (self.search_entry.get_text().lower() in row.get_title().lower()) or (self.search_entry.get_text().lower() in row.get_subtitle().lower()):
if (self.search_entry.get_text().lower() in row.get_title().lower()) or (
self.search_entry.get_text().lower() in row.get_subtitle().lower()
):
return True
def trash_folder(self, _a, path):
if not os.path.exists(path):
return 1
try:
subprocess.run(["flatpak-spawn", "--host", "gio", "trash", path], capture_output=True, check=True)
subprocess.run(
["flatpak-spawn", "--host", "gio", "trash", path],
capture_output=True,
check=True,
)
return 0
except subprocess.CalledProcessError:
return 2
@@ -125,18 +132,31 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
if self.uninstall_success:
self.toast_overlay.add_toast(Adw.Toast.new(_("Uninstalled selected apps")))
else:
self.toast_overlay.add_toast(Adw.Toast.new(_("Could not uninstall some apps")))
self.toast_overlay.add_toast(
Adw.Toast.new(_("Could not uninstall some apps"))
)
def uninstall_flatpak_thread(self, ref_arr, id_arr, should_trash):
failures = []
for i in range(len(ref_arr)):
try:
subprocess.run(['flatpak-spawn', '--host', 'flatpak', 'remove', '-y', ref_arr[i]], capture_output=False, check=True)
subprocess.run(
["flatpak-spawn", "--host", "flatpak", "remove", "-y", ref_arr[i]],
capture_output=False,
check=True,
)
except subprocess.CalledProcessError:
failures.append(ref_arr[i])
if len(failures) > 0:
pk_command = ['flatpak-spawn', '--host', 'pkexec','flatpak', 'remove', '-y']
pk_command = [
"flatpak-spawn",
"--host",
"pkexec",
"flatpak",
"remove",
"-y",
]
for i in range(len(failures)):
pk_command.append(failures[i])
try:
@@ -145,11 +165,21 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
self.uninstall_success = False
if should_trash:
for i in range(len(id_arr)):
for i in range(len(id_arr)):
try:
subprocess.run(['flatpak-spawn', '--host', 'gio', 'trash', f'{self.user_data_path}{id_arr[i]}'])
subprocess.run(
[
"flatpak-spawn",
"--host",
"gio",
"trash",
f"{self.user_data_path}{id_arr[i]}",
]
)
except subprocess.CalledProcessError:
self.toast_overlay.add_toast(Adw.Toast.new(_("Could not trash data")))
self.toast_overlay.add_toast(
Adw.Toast.new(_("Could not trash data"))
)
def uninstall_flatpak(self, index_arr, should_trash):
ref_arr = []
@@ -160,12 +190,16 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
ref_arr.append(ref)
id_arr.append(id)
task = Gio.Task.new(None, None, self.uninstall_flatpak_callback)
task.run_in_thread(lambda _task, _obj, _data, _cancellable, ref_arr=ref_arr, id_arr=id_arr, should_trash=should_trash: self.uninstall_flatpak_thread(ref_arr, id_arr, should_trash))
task.run_in_thread(
lambda _task, _obj, _data, _cancellable, ref_arr=ref_arr, id_arr=id_arr, should_trash=should_trash: self.uninstall_flatpak_thread(
ref_arr, id_arr, should_trash
)
)
def batch_uninstall_button_handler(self, _widget):
self.should_pulse = True
self.main_pulser()
def batch_uninstall_response(_idk, response_id, _widget):
if response_id == "cancel":
self.should_pulse = False
@@ -176,11 +210,19 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
should_trash = True
self.main_toolbar_view.set_sensitive(False)
self.no_close = self.connect('close-request', lambda event: True) # Make window unable to close
self.no_close = self.connect(
"close-request", lambda event: True
) # Make window unable to close
self.main_progress_bar.set_visible(True)
self.uninstall_flatpak(self.selected_host_flatpak_indexes, should_trash)
dialog = Adw.MessageDialog.new(self, _("Uninstall Selected Apps?"), _("The app will be removed from your system. Optionally, you can also trash its user data."))
dialog = Adw.MessageDialog.new(
self,
_("Uninstall Selected Apps?"),
_(
"The app will be removed from your system. Optionally, you can also trash its user data."
),
)
dialog.set_close_response("cancel")
dialog.add_response("cancel", _("Cancel"))
dialog.add_response("continue", _("Uninstall"))
@@ -201,23 +243,33 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
if response_id == "cancel":
self.should_pulse = False
return 1
should_trash = False
if response_id == "purge":
should_trash = True
self.main_toolbar_view.set_sensitive(False)
self.no_close = self.connect('close-request', lambda event: True) # Make window unable to close
self.no_close = self.connect(
"close-request", lambda event: True
) # Make window unable to close
self.main_progress_bar.set_visible(True)
self.uninstall_flatpak([index], should_trash)
dialog = Adw.MessageDialog.new(self, _("Uninstall {}?").format(name), _("The app will be removed from your system."))
dialog = Adw.MessageDialog.new(
self,
_("Uninstall {}?").format(name),
_("The app will be removed from your system."),
)
dialog.set_close_response("cancel")
dialog.add_response("cancel", _("Cancel"))
dialog.add_response("continue", _("Uninstall"))
dialog.set_response_appearance("continue", Adw.ResponseAppearance.DESTRUCTIVE)
if os.path.exists(f"{self.user_data_path}{id}"):
dialog.set_body(_("The app will be removed from your system. Optionally, you can also trash its user data."))
dialog.set_body(
_(
"The app will be removed from your system. Optionally, you can also trash its user data."
)
)
dialog.add_response("purge", _("Uninstall and Trash Data"))
dialog.set_response_appearance("purge", Adw.ResponseAppearance.DESTRUCTIVE)
dialog.connect("response", uninstall_response, dialog.choose_finish)
@@ -240,7 +292,7 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
orphans_stack.add_child(orphans_clamp)
orphans_clamp.set_child(orphans_overlay)
orphans_toast_overlay.set_child(orphans_stack)
orphans_progress_bar = Gtk.ProgressBar(visible=False, pulse_step=0.7)
orphans_progress_bar.add_css_class("osd")
orphans_overlay.add_overlay(orphans_progress_bar)
@@ -253,10 +305,21 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
orphans_toolbar_view.add_bottom_bar(orphans_action_bar)
orphans_toolbar_view.set_content(orphans_toast_overlay)
orphans_window.set_content(orphans_toolbar_view)
orphans_list = Gtk.ListBox(selection_mode="none", valign=Gtk.Align.START, margin_top=6, margin_bottom=6, margin_start=12, margin_end=12)
orphans_list = Gtk.ListBox(
selection_mode="none",
valign=Gtk.Align.START,
margin_top=6,
margin_bottom=6,
margin_start=12,
margin_end=12,
)
orphans_list.add_css_class("boxed-list")
orphans_scroll.set_child(orphans_list)
no_data = Adw.StatusPage(icon_name="check-plain-symbolic", title=_("No Data"), description=_("There is no leftover user data"))
no_data = Adw.StatusPage(
icon_name="check-plain-symbolic",
title=_("No Data"),
description=_("There is no leftover user data"),
)
orphans_stack.add_child(no_data)
global total_selected
total_selected = 0
@@ -299,10 +362,20 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
if not file_list[i] in id_list:
row_index += 1
select_orphans_tickbox = Gtk.CheckButton(halign=Gtk.Align.CENTER)
orphans_row = Adw.ActionRow(title=GLib.markup_escape_text(file_list[i]), subtitle=_("~") + self.get_size_format(self.get_directory_size(f"{self.user_data_path}{file_list[i]}")))
orphans_row = Adw.ActionRow(
title=GLib.markup_escape_text(file_list[i]),
subtitle=_("~")
+ self.get_size_format(
self.get_directory_size(
f"{self.user_data_path}{file_list[i]}"
)
),
)
orphans_row.add_suffix(select_orphans_tickbox)
orphans_row.set_activatable_widget(select_orphans_tickbox)
select_orphans_tickbox.connect("toggled", selection_handler, orphans_row.get_title())
select_orphans_tickbox.connect(
"toggled", selection_handler, orphans_row.get_title()
)
if is_select_all == True:
select_orphans_tickbox.set_active(True)
orphans_list.append(orphans_row)
@@ -323,9 +396,15 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
for i in range(len(selected_rows)):
path = f"{self.user_data_path}{selected_rows[i]}"
try:
subprocess.run(["flatpak-spawn", "--host", "gio", "trash", path], capture_output=False, check=True)
subprocess.run(
["flatpak-spawn", "--host", "gio", "trash", path],
capture_output=False,
check=True,
)
except:
orphans_toast_overlay.add_toast(Adw.Toast.new(_("Can't trash {}").format(selected_rows[i])))
orphans_toast_overlay.add_toast(
Adw.Toast.new(_("Can't trash {}").format(selected_rows[i]))
)
show_success = False
select_all_button.set_active(False)
@@ -335,14 +414,17 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
generate_list(widget, False)
handler_id = 0
def install_callback(*_args):
nonlocal should_pulse
nonlocal handler_id
if self.install_success:
orphans_toast_overlay.add_toast(Adw.Toast.new(_("Installed all apps")))
else:
orphans_toast_overlay.add_toast(Adw.Toast.new(_("Some apps didn't install")))
orphans_toast_overlay.add_toast(
Adw.Toast.new(_("Some apps didn't install"))
)
select_all_button.set_active(False)
orphans_progress_bar.set_visible(False)
should_pulse = False
@@ -350,18 +432,45 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
generate_list(None, False)
nonlocal orphans_toolbar_view
orphans_toolbar_view.set_sensitive(True)
orphans_window.disconnect(handler_id) # Make window able to close
orphans_window.disconnect(handler_id) # Make window able to close
def thread_func(id_list, remote):
for i in range(len(id_list)):
try:
subprocess.run(['flatpak-spawn', '--host', 'flatpak', 'install', '-y', remote[0], f'--{remote[1]}', id_list[i]], capture_output=False, check=True)
subprocess.run(
[
"flatpak-spawn",
"--host",
"flatpak",
"install",
"-y",
remote[0],
f"--{remote[1]}",
id_list[i],
],
capture_output=False,
check=True,
)
except subprocess.CalledProcessError:
if remote[1] == "user":
self.install_success = False
continue
try:
subprocess.run(['flatpak-spawn', '--host', 'pkexec', 'flatpak', 'install', '-y', remote[0], f'--{remote[1]}', id_list[i]], capture_output=False, check=True)
subprocess.run(
[
"flatpak-spawn",
"--host",
"pkexec",
"flatpak",
"install",
"-y",
remote[0],
f"--{remote[1]}",
id_list[i],
],
capture_output=False,
check=True,
)
except subprocess.CalledProcessError:
self.install_success = False
@@ -372,17 +481,25 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
orphans_progress_bar.set_visible(False)
return 1
orphans_toast_overlay.add_toast(Adw.Toast.new(_("This could take some time")))
orphans_toast_overlay.add_toast(
Adw.Toast.new(_("This could take some time"))
)
nonlocal orphans_toolbar_view
orphans_toolbar_view.set_sensitive(False)
nonlocal handler_id
handler_id = orphans_window.connect('close-request', lambda event: True) # Make window unable to close
handler_id = orphans_window.connect(
"close-request", lambda event: True
) # Make window unable to close
remote = response_id.split("_")
orphans_progress_bar.set_visible(True)
task = Gio.Task.new(None, None, install_callback)
task.run_in_thread(lambda _task, _obj, _data, _cancellable, id_list=selected_rows, remote=remote: thread_func(id_list, remote))
task.run_in_thread(
lambda _task, _obj, _data, _cancellable, id_list=selected_rows, remote=remote: thread_func(
id_list, remote
)
)
def install_button_handler(widget):
self.install_success = True
@@ -391,7 +508,11 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
orphans_pulser()
def get_host_remotes():
output = subprocess.run(["flatpak-spawn", "--host", "flatpak", "remotes"], capture_output=True, text=True).stdout
output = subprocess.run(
["flatpak-spawn", "--host", "flatpak", "remotes"],
capture_output=True,
text=True,
).stdout
lines = output.strip().split("\n")
columns = lines[0].split("\t")
data = [columns]
@@ -408,12 +529,22 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
dialog.connect("response", install_on_response, dialog.choose_finish)
dialog.set_transient_for(orphans_window)
if len(host_remotes) > 1:
dialog.set_body(_("Choose the Flatpak Remote Repository where attempted app downloads will be from."))
dialog.set_body(
_(
"Choose the Flatpak Remote Repository where attempted app downloads will be from."
)
)
for i in range(len(host_remotes)):
remote_name = host_remotes[i][0]
remote_option = host_remotes[i][1]
dialog.add_response(f"{remote_name}_{remote_option}", f"{remote_name} {remote_option}")
dialog.set_response_appearance(f"{remote_name}_{remote_option}", Adw.ResponseAppearance.SUGGESTED,)
dialog.add_response(
f"{remote_name}_{remote_option}",
f"{remote_name} {remote_option}",
)
dialog.set_response_appearance(
f"{remote_name}_{remote_option}",
Adw.ResponseAppearance.SUGGESTED,
)
else:
remote_name = host_remotes[0][0]
remote_option = host_remotes[0][1]
@@ -429,16 +560,26 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
select_all_button.connect("toggled", toggle_button_handler)
orphans_action_bar.pack_start(select_all_button)
trash_button = Gtk.Button(label="Trash", valign=Gtk.Align.CENTER, tooltip_text=_("Trash Selected"))
trash_button = Gtk.Button(
label="Trash", valign=Gtk.Align.CENTER, tooltip_text=_("Trash Selected")
)
trash_button.add_css_class("destructive-action")
trash_button.connect("clicked", trash_button_handler)
orphans_action_bar.pack_end(trash_button)
install_button = Gtk.Button(label="Install", valign=Gtk.Align.CENTER, tooltip_text=_("Attempt to Install Selected"))
install_button = Gtk.Button(
label="Install",
valign=Gtk.Align.CENTER,
tooltip_text=_("Attempt to Install Selected"),
)
install_button.connect("clicked", install_button_handler)
install_button.set_visible(False)
orphans_action_bar.pack_end(install_button)
test = subprocess.run(["flatpak-spawn", "--host", "flatpak", "remotes"], capture_output=True, text=True).stdout
test = subprocess.run(
["flatpak-spawn", "--host", "flatpak", "remotes"],
capture_output=True,
text=True,
).stdout
for char in test:
if char.isalnum():
install_button.set_visible(True)
@@ -471,7 +612,13 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
def find_app_icon(self, app_id):
try:
icon_path = (self.icon_theme.lookup_icon(app_id, None, 512, 1, self.get_direction(), 0).get_file().get_path())
icon_path = (
self.icon_theme.lookup_icon(
app_id, None, 512, 1, self.get_direction(), 0
)
.get_file()
.get_path()
)
except GLib.GError:
icon_path = None
if icon_path:
@@ -490,7 +637,11 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
self.should_select_all = self.batch_select_all_button.get_active()
def get_host_flatpaks():
output = subprocess.run(["flatpak-spawn", "--host", "flatpak", "list", "--columns=all"], capture_output=True, text=True).stdout
output = subprocess.run(
["flatpak-spawn", "--host", "flatpak", "list", "--columns=all"],
capture_output=True,
text=True,
).stdout
lines = output.strip().split("\n")
columns = lines[0].split("\t")
data = [columns]
@@ -516,18 +667,26 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
if (not self.show_runtimes) and "runtime" in self.host_flatpaks[index][12]:
continue
if self.show_runtimes:
flatpak_row.set_subtitle(self.host_flatpaks[index][8])
else:
else:
flatpak_row.set_subtitle(self.host_flatpaks[index][2])
properties_button = Gtk.Button(icon_name="info-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("View Properties"))
properties_button = Gtk.Button(
icon_name="info-symbolic",
valign=Gtk.Align.CENTER,
tooltip_text=_("View Properties"),
)
properties_button.add_css_class("flat")
properties_button.connect("clicked", show_properties_window, index, self)
flatpak_row.add_suffix(properties_button)
trash_button = Gtk.Button(icon_name="user-trash-symbolic", valign=Gtk.Align.CENTER, tooltip_text=_("Uninstall {}").format(app_name))
trash_button = Gtk.Button(
icon_name="user-trash-symbolic",
valign=Gtk.Align.CENTER,
tooltip_text=_("Uninstall {}").format(app_name),
)
trash_button.add_css_class("flat")
trash_button.connect("clicked", self.uninstall_button_handler, index)
flatpak_row.add_suffix(trash_button)
@@ -536,7 +695,9 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
select_flatpak_tickbox.set_margin_start(4)
select_flatpak_tickbox.set_margin_end(4)
select_flatpak_tickbox.add_css_class("flat")
select_flatpak_tickbox.connect("toggled", self.flatpak_row_select_handler, index)
select_flatpak_tickbox.connect(
"toggled", self.flatpak_row_select_handler, index
)
flatpak_row.add_suffix(select_flatpak_tickbox)
if self.in_batch_mode:
@@ -598,16 +759,24 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
trash = self.trash_folder(None, path)
if trash == 1:
show_success = False
self.toast_overlay.add_toast(Adw.Toast.new(_("No user data for {}").format(app_name)))
self.toast_overlay.add_toast(
Adw.Toast.new(_("No user data for {}").format(app_name))
)
elif trash == 2:
show_success = False
self.toast_overlay.add_toast(Adw.Toast.new(_("Can't trash user data for {}").format(app_name)))
self.toast_overlay.add_toast(
Adw.Toast.new(_("Can't trash user data for {}").format(app_name))
)
if show_success:
self.toast_overlay.add_toast(Adw.Toast.new(_("Trashed user data")))
self.refresh_list_of_flatpaks(_a, False)
def batch_clean_handler(self, widget):
dialog = Adw.MessageDialog.new(self, _("Delete Selected User Data?"), _("This user data will be sent to the trash."))
dialog = Adw.MessageDialog.new(
self,
_("Delete Selected User Data?"),
_("This user data will be sent to the trash."),
)
dialog.set_close_response("cancel")
dialog.add_response("cancel", _("Cancel"))
dialog.add_response("continue", _("Trash Data"))
@@ -642,14 +811,18 @@ class FlattoolGuiWindow(Adw.ApplicationWindow):
super().__init__(**kwargs)
self.list_of_flatpaks.set_filter_func(self.filter_func)
self.generate_list_of_flatpaks()
self.search_entry.connect("search-changed", lambda *_: self.list_of_flatpaks.invalidate_filter())
self.search_entry.connect(
"search-changed", lambda *_: self.list_of_flatpaks.invalidate_filter()
)
self.search_bar.connect_entry(self.search_entry)
self.refresh_button.connect("clicked", self.refresh_list_of_flatpaks, True)
self.batch_mode_button.connect("toggled", self.batch_mode_handler)
self.batch_copy_button.connect("clicked", self.batch_copy_handler)
self.batch_clean_button.connect("clicked", self.batch_clean_handler)
self.batch_clean_button.add_css_class("destructive-action")
self.batch_uninstall_button.connect("clicked", self.batch_uninstall_button_handler)
self.batch_uninstall_button.connect(
"clicked", self.batch_uninstall_button_handler
)
self.batch_uninstall_button.add_css_class("destructive-action")
self.batch_select_all_button.connect("clicked", self.batch_select_all_handler)
self.batch_actions_enable(False)