Verified Kaydet (Commit) 52e2b3bc authored tarafından Erdem Ersoy's avatar Erdem Ersoy

Initial commit

* Add files from flatpak-gui-old
üst
flatpakgui/__pycache__/
*.po~
This diff is collapsed.
# Flatpak GUI
A GUI for Flatpak. You can run, install (from FlatHub and from Flatpak ref file), uninstall, update and get information about Flatpak softwares via this GUI. Written in PyGObject and Glade used.
## Versioning
X.Y version number scheme used. X means major version number indicates major changes, Y means minor version number indicates minor changes. 1.0 is the first version. For preview versions, X.Y-rcZ version number scheme used. Z means release candidate version number indicates changes for candidate of X.Y version release.
## Status
I won't maintain this project anymore. Because, I'll write different, store-like GUI for Flatpak.
## Roadmap
See ROADMAP.md file for roadmap.
## Copyright
Copyright (C) 2020 Erdem Ersoy.
## Licensing
Licensed under GPLv3. See COPYING file for license.
# Roadmap for Flatpak GUI
## TODOs for 1.0:
* Fix pycodestyle linting errors left
* Add comments to source code where appropriate
## TODOs for 1.0-rc1:
* Add screenshot for README.md
* Implement setup.py
* Implement Pardus (Debian) packaging
* Test Flatpak GUI on clean English and Turkish latest Pardus 19.x installations
#!/usr/bin/env python3
#
# Flatpak GUI main exectuable script (new)
# Copyright (C) 2020 Erdem Ersoy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from flatpakgui.flatpakguiapp import FlatpakGUIApp
import gi
gi.require_version('Gio', '2.0')
from gi.repository import Gio
def main():
app = FlatpakGUIApp("tr.org.pardus.flatpak-gui",
Gio.ApplicationFlags.FLAGS_NONE)
app.run()
if __name__ == "__main__":
main()
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-24 08:29+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: flatpakgui/flatpakguiapp.py:49 flatpakgui/installinputwindow.py:57
#: flatpakgui/mainwindow.py:69
msgid "Error reading message dialogs GUI file: "
msgstr ""
#: flatpakgui/flatpakguiapp.py:69
msgid "<big><b>File Not Found Error</b></big>"
msgstr ""
#: flatpakgui/flatpakguiapp.py:71
msgid "File not found: "
msgstr ""
#: flatpakgui/flatpakguiapp.py:87
msgid "<big><b>Installing Error</b></big>"
msgstr ""
#: flatpakgui/flatpakguiapp.py:89
msgid "The selected file doesn't indicate a Flatpak application: "
msgstr ""
#: flatpakgui/flatpakguiapp.py:99
msgid "<big><b>Argument Error</b></big>"
msgstr ""
#: flatpakgui/flatpakguiapp.py:101
msgid "There are too many arguments. Argument count: "
msgstr ""
#: flatpakgui/infowindow.py:45 flatpakgui/installdirectwindow.py:77
#: flatpakgui/installfromfileinputwindow.py:48
#: flatpakgui/installfromfilewindow.py:73 flatpakgui/installinputwindow.py:49
#: flatpakgui/installwindow.py:72 flatpakgui/mainwindow.py:53
#: flatpakgui/uninstallwindow.py:70 flatpakgui/updateallwindow.py:57
msgid "Error reading GUI file: "
msgstr ""
#: flatpakgui/infowindow.py:53
msgid "_Copy to Clipboard"
msgstr ""
#: flatpakgui/infowindow.py:57
msgid "Info About "
msgstr ""
#: flatpakgui/installdirectwindow.py:82 flatpakgui/installdirectwindow.py:95
#: flatpakgui/installdirectwindow.py:189
#: flatpakgui/installfromfilewindow.py:191 flatpakgui/installwindow.py:77
#: flatpakgui/installwindow.py:90 flatpakgui/installwindow.py:184
msgid "Installing: "
msgstr ""
#: flatpakgui/installdirectwindow.py:118
#: flatpakgui/installfromfilewindow.py:116 flatpakgui/installwindow.py:113
msgid "Error at installation!"
msgstr ""
#: flatpakgui/installdirectwindow.py:127
#: flatpakgui/installfromfilewindow.py:125 flatpakgui/installwindow.py:122
msgid "Installing completed!"
msgstr ""
#: flatpakgui/installdirectwindow.py:211
#: flatpakgui/installfromfilewindow.py:213 flatpakgui/installwindow.py:206
msgid "Not installed: "
msgstr ""
#: flatpakgui/installfromfileinputwindow.py:55
msgid "Please choose a Flatpak reference file."
msgstr ""
#: flatpakgui/installfromfileinputwindow.py:61
#: flatpakgui/installinputwindow.py:72
msgid ""
"NOTE: Installing an application from third party remote repositories isn't "
"secured as installing an application from official repositories of your "
"distribution."
msgstr ""
#: flatpakgui/installfromfileinputwindow.py:66
#: flatpakgui/installinputwindow.py:76 flatpakgui/mainwindow.py:90
msgid "I_nstall"
msgstr ""
#: flatpakgui/installfromfileinputwindow.py:71
msgid "Choose a file"
msgstr ""
#: flatpakgui/installfromfilewindow.py:79
#: flatpakgui/installfromfilewindow.py:93
msgid "Installing from file..."
msgstr ""
#: flatpakgui/installinputwindow.py:67
msgid ""
"Please enter an application name (Ex: org.libreoffice.LibreOffice) what you "
"want to install from Flathub."
msgstr ""
#: flatpakgui/installinputwindow.py:80
msgid "Enter an application name"
msgstr ""
#: flatpakgui/installinputwindow.py:90
msgid "<big><b>Input Error</b></big>"
msgstr ""
#: flatpakgui/installinputwindow.py:92
msgid "Input entered is invalid."
msgstr ""
#: flatpakgui/mainwindow.py:61
msgid "Error reading About dialog GUI file: "
msgstr ""
#: flatpakgui/mainwindow.py:77 flatpakgui/mainwindow.py:185
msgid "Flatpak GUI"
msgstr ""
#: flatpakgui/mainwindow.py:78
msgid "Manage Flatpak softwares via GUI"
msgstr ""
#: flatpakgui/mainwindow.py:81
msgid "_Run"
msgstr ""
#: flatpakgui/mainwindow.py:84
msgid "_Info"
msgstr ""
#: flatpakgui/mainwindow.py:87
msgid "_Uninstall"
msgstr ""
#: flatpakgui/mainwindow.py:93
msgid "Install From _Entry"
msgstr ""
#: flatpakgui/mainwindow.py:97
msgid "Install _From File"
msgstr ""
#: flatpakgui/mainwindow.py:100
msgid "Up_date All"
msgstr ""
#: flatpakgui/mainwindow.py:103
msgid "_About"
msgstr ""
#: flatpakgui/mainwindow.py:107
msgid "Real Name"
msgstr ""
#: flatpakgui/mainwindow.py:110
msgid "Arch"
msgstr ""
#: flatpakgui/mainwindow.py:113
msgid "Branch"
msgstr ""
#: flatpakgui/mainwindow.py:117
msgid "Remote Name"
msgstr ""
#: flatpakgui/mainwindow.py:121
msgid "Installed Size"
msgstr ""
#: flatpakgui/mainwindow.py:125
msgid "Download Size"
msgstr ""
#: flatpakgui/mainwindow.py:128
msgid "Name"
msgstr ""
#: flatpakgui/mainwindow.py:183
msgid "A GUI for Flatpak"
msgstr ""
#: flatpakgui/mainwindow.py:184
msgid "Copyright (C) 2020 Erdem Ersoy"
msgstr ""
#: flatpakgui/mainwindow.py:186
msgid "Flatpak GUI Web Site"
msgstr ""
#: flatpakgui/mainwindow.py:221 flatpakgui/mainwindow.py:261
#: flatpakgui/mainwindow.py:420 flatpakgui/mainwindow.py:450
msgid "<big><b>Selection Error</b></big>"
msgstr ""
#: flatpakgui/mainwindow.py:223 flatpakgui/mainwindow.py:263
#: flatpakgui/mainwindow.py:422 flatpakgui/mainwindow.py:452
msgid "None of the applications are selected."
msgstr ""
#: flatpakgui/mainwindow.py:250
msgid "<big><b>Running Error</b></big>"
msgstr ""
#: flatpakgui/mainwindow.py:252
msgid "The selected application couldn't run."
msgstr ""
#: flatpakgui/mainwindow.py:291 flatpakgui/mainwindow.py:308
#: flatpakgui/mainwindow.py:312 flatpakgui/mainwindow.py:316
#: flatpakgui/mainwindow.py:320 flatpakgui/mainwindow.py:324
#: flatpakgui/mainwindow.py:328 flatpakgui/mainwindow.py:332
#: flatpakgui/mainwindow.py:346 flatpakgui/mainwindow.py:350
#: flatpakgui/mainwindow.py:354 flatpakgui/mainwindow.py:387
#: flatpakgui/mainwindow.py:391 flatpakgui/mainwindow.py:399
msgid "None"
msgstr ""
#: flatpakgui/mainwindow.py:340 flatpakgui/mainwindow.py:366
#: flatpakgui/mainwindow.py:406
msgid "Yes"
msgstr ""
#: flatpakgui/mainwindow.py:342
msgid "No"
msgstr ""
#: flatpakgui/mainwindow.py:361 flatpakgui/mainwindow.py:401
msgid "Real Name: "
msgstr ""
#: flatpakgui/mainwindow.py:362 flatpakgui/mainwindow.py:402
msgid "Arch: "
msgstr ""
#: flatpakgui/mainwindow.py:363 flatpakgui/mainwindow.py:403
msgid "Branch: "
msgstr ""
#: flatpakgui/mainwindow.py:364 flatpakgui/mainwindow.py:404
msgid "Collection ID: "
msgstr ""
#: flatpakgui/mainwindow.py:365 flatpakgui/mainwindow.py:405
msgid "Commit: "
msgstr ""
#: flatpakgui/mainwindow.py:366 flatpakgui/mainwindow.py:406
msgid "Is Installed: "
msgstr ""
#: flatpakgui/mainwindow.py:367
msgid "License: "
msgstr ""
#: flatpakgui/mainwindow.py:368
msgid "Name: "
msgstr ""
#: flatpakgui/mainwindow.py:369
msgid "Summary: "
msgstr ""
#: flatpakgui/mainwindow.py:370
msgid "Version: "
msgstr ""
#: flatpakgui/mainwindow.py:371
msgid "Deploy Dir: "
msgstr ""
#: flatpakgui/mainwindow.py:372 flatpakgui/mainwindow.py:408
msgid "EOL Reason: "
msgstr ""
#: flatpakgui/mainwindow.py:373 flatpakgui/mainwindow.py:409
msgid "EOL Rebased: "
msgstr ""
#: flatpakgui/mainwindow.py:374 flatpakgui/mainwindow.py:410
msgid "Installed Size: "
msgstr ""
#: flatpakgui/mainwindow.py:375
msgid "Is Current: "
msgstr ""
#: flatpakgui/mainwindow.py:376
msgid "Latest Commit: "
msgstr ""
#: flatpakgui/mainwindow.py:377
msgid "Origin: "
msgstr ""
#: flatpakgui/mainwindow.py:378
msgid "Subpaths: "
msgstr ""
#: flatpakgui/mainwindow.py:407
msgid "Download Size: "
msgstr ""
#: flatpakgui/mainwindow.py:411
msgid "Remote Name: "
msgstr ""
#: flatpakgui/uninstallwindow.py:75
msgid "Uninstalling "
msgstr ""
#: flatpakgui/uninstallwindow.py:89 flatpakgui/uninstallwindow.py:183
msgid "Uninstalling: "
msgstr ""
#: flatpakgui/uninstallwindow.py:112
msgid "Error at uninstallation!"
msgstr ""
#: flatpakgui/uninstallwindow.py:121
msgid "Uninstalling completed!"
msgstr ""
#: flatpakgui/uninstallwindow.py:205
msgid "Not uninstalled: "
msgstr ""
#: flatpakgui/updateallwindow.py:62
msgid "Updating All"
msgstr ""
#: flatpakgui/updateallwindow.py:75
msgid "Updating..."
msgstr ""
#: flatpakgui/updateallwindow.py:104
msgid "Not updated: "
msgstr ""
#: flatpakgui/updateallwindow.py:113
msgid "Updated: "
msgstr ""
#: flatpakgui/updateallwindow.py:123
msgid "Updating completed!"
msgstr ""
#!/usr/bin/env python3
#
# Flatpak GUI Application module
# Copyright (C) 2020 Erdem Ersoy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from flatpakgui.mainwindow import MainWindow
from flatpakgui.installwindow import InstallWindow
import gettext
import locale
import sys
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GLib', '2.0')
gi.require_version('Flatpak', '1.0')
gi.require_version('Gio', '2.0')
from gi.repository import Gtk, GLib, Flatpak, Gio
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain("flatpak-gui", "po/")
gettext.textdomain("flatpak-gui")
_ = gettext.gettext
gettext.install("flatpak-gui", "po/")
class FlatpakGUIApp(Gtk.Application):
def __init__(self, application_id, flags):
Gtk.Application.__init__(self, application_id=application_id,
flags=flags)
try:
MessagesGUIFile = "ui/messagedialogs.glade"
MessagesBuilder = Gtk.Builder.new_from_file(MessagesGUIFile)
MessagesBuilder.connect_signals(self)
except GLib.GError:
print(_("Error reading message dialogs GUI file: ")
+ MessagesGUIFile)
raise
self.MessageDialogError = MessagesBuilder.get_object(
"MessageDialogError")
self.connect("activate", self.new_window)
def new_window(self, *args):
if len(sys.argv) == 1:
MainWindow(self)
elif len(sys.argv) == 2:
self.FlatpakInstallation = Flatpak.Installation.new_system()
self.FileFlatpakRefName = sys.argv[1]
try:
self.FileFlatpakRef = open(self.FileFlatpakRefName, "r")
except FileNotFoundError:
self.MessageDialogError.set_markup(
_("<big><b>File Not Found Error</b></big>"))
self.MessageDialogError.format_secondary_text(
_("File not found: ") + self.FileFlatpakRefName)
self.MessageDialogError.run()
self.MessageDialogError.hide()
return None
else:
self.FileFlatpakRefContents = self.FileFlatpakRef.read(-1)
self.FileFlatpakRefContentsAsBytes = bytes(
self.FileFlatpakRefContents, "utf-8")
self.FileFlatpakRefContentsAsGLibBytes = GLib.Bytes.new(
self.FileFlatpakRefContentsAsBytes)
self.AppToInstall = self.FlatpakInstallation.install_ref_file(
self.FileFlatpakRefContentsAsGLibBytes,
Gio.Cancellable.new())
if not self.AppToInstall.get_kind() == Flatpak.RefKind.APP:
self.MessageDialogError.set_markup(
_("<big><b>Installing Error</b></big>"))
self.MessageDialogError.format_secondary_text(
_("The selected file doesn't indicate a Flatpak application: ") +
self.FileFlatpakRefName)
self.MessageDialogError.run()
self.MessageDialogError.hide()
return None
InstallWindow(self, self.AppToInstall,
self.FlatpakInstallation, None)
else:
self.MessageDialogError.set_markup(
_("<big><b>Argument Error</b></big>"))
self.MessageDialogError.format_secondary_text(
_("There are too many arguments. Argument count: ") +
str(len(sys.argv)))
self.MessageDialogError.run()
self.MessageDialogError.hide()
return None
#!/usr/bin/env python3
#
# Flatpak GUI info window module
# Copyright (C) 2020 Erdem Ersoy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import gettext
import locale
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
gi.require_version('GLib', '2.0')
from gi.repository import Gtk, Gdk, GLib
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain("flatpak-gui", "po/")
gettext.textdomain("flatpak-gui")
_ = gettext.gettext
gettext.install("flatpak-gui", "po/")
class InfoWindow(object):
def __init__(self, application, infostring, app):
self.Application = application
self.InfoString = infostring
self.App = app
try:
InfoGUIFile = "ui/infowindow.glade"
InfoBuilder = Gtk.Builder.new_from_file(InfoGUIFile)
InfoBuilder.connect_signals(self)
except GLib.GError:
print(_("Error reading GUI file: ") + InfoGUIFile)
raise
InfoTextBuffer = InfoBuilder.get_object(
"InfoTextBuffer")
InfoTextBuffer.set_text(infostring)
InfoButton = InfoBuilder.get_object("InfoButton")
InfoButton.set_label(_("_Copy to Clipboard"))
self.InfoWindow = InfoBuilder.get_object("InfoWindow")
self.InfoWindow.set_application(application)
self.InfoWindow.set_title(_("Info About ") + app.get_name())
self.InfoWindow.show()
def onDestroy(self, *args):
self.InfoWindow.destroy()
def onPressedCopyToClipboard(self, button):
ClipboardCurrent = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
ClipboardCurrent.set_text(self.InfoString, -1)
#!/usr/bin/env python3
#
# Flatpak GUI direct install window module
# Copyright (C) 2020 Erdem Ersoy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import gettext
import locale
import sys
import threading
import time
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Flatpak', '1.0')
gi.require_version('GLib', '2.0')
gi.require_version('Gio', '2.0')
from gi.repository import Gtk, Flatpak, GLib, Gio
locale.setlocale(locale.LC_ALL, "")
gettext.bindtextdomain("flatpak-gui", "po/")
gettext.textdomain("flatpak-gui")
_ = gettext.gettext
gettext.install("flatpak-gui", "po/")
class InstallDirectWindow(object):
def __init__(self, application, apptoinstrealname, apptoinstarch,
apptoinstbranch, apptoinstremote, flatpakinstallation,
liststore):
self.Application = application
self.AppToInstallRealName = apptoinstrealname
self.AppToInstallArch = apptoinstarch
self.AppToInstallBranch = apptoinstbranch
self.AppToInstallRemote = apptoinstremote
self.AppToInstall = Flatpak.Ref.parse("app/" +
self.AppToInstallRealName + "/" +
self.AppToInstallArch + "/" +
self.AppToInstallBranch)
self.FlatpakInstallation = flatpakinstallation
self.FlatpakTransaction = \
Flatpak.Transaction.new_for_installation(
self.FlatpakInstallation,
Gio.Cancellable.new())
self.FlatpakTransaction.set_default_arch(self.AppToInstallArch)
self.FlatpakTransaction.set_disable_dependencies(False)
self.FlatpakTransaction.set_disable_prune(False)
self.FlatpakTransaction.set_disable_related(False)
self.FlatpakTransaction.set_disable_static_deltas(False)
self.FlatpakTransaction.set_no_deploy(False)
self.FlatpakTransaction.set_no_pull(False)
self.FlatpakTransaction.add_install(
self.AppToInstallRemote,
self.AppToInstall.format_ref(),
None)
self.ListStoreMain = liststore
try:
InstallGUIFile = "ui/actionwindow.glade"
InstallBuilder = Gtk.Builder.new_from_file(InstallGUIFile)
InstallBuilder.connect_signals(self)
except GLib.GError:
print(_("Error reading GUI file: ") + InstallGUIFile)
raise
self.InstallWindow = InstallBuilder.get_object("ActionWindow")
self.InstallWindow.set_application(application)
self.InstallWindow.set_title(_("Installing: ") + self.AppToInstallRealName)
self.InstallWindow.show()
self.InstallProgressBar = InstallBuilder.get_object(
"ActionProgressBar")
self.ProgressBarValue = int(
self.InstallProgressBar.get_fraction() * 100)
self.InstallLabel = InstallBuilder.get_object("ActionLabel")
self.InstallTextBuffer = InstallBuilder.get_object(
"ActionTextBuffer")
self.InstallTextBuffer.set_text("\0", -1)
self.StatusText = _("Installing: ") + self.AppToInstallRealName
self.InstallLabel.set_text(self.StatusText)
self.InstallTextBuffer.set_text(self.StatusText)
self.InstallThread = threading.Thread(
target=self.Install,
args=())
self.InstallThread.start()
GLib.threads_init()
def Install(self):
self.handler_id = self.FlatpakTransaction.connect(
"new-operation",
self.InstallProgressCallback)
self.handler_id_2 = self.FlatpakTransaction.connect(
"operation-done",
self.InstallProgressCallbackDisconnect)
self.handler_id_error = self.FlatpakTransaction.connect(
"operation-error",
self.InstallProgressCallbackError)
try:
self.FlatpakTransaction.run(Gio.Cancellable.new())
except GLib.Error:
statustext = _("Error at installation!")
self.StatusText = self.StatusText + "\n" + statustext
GLib.idle_add(self.InstallLabel.set_text,
statustext,
priority=GLib.PRIORITY_DEFAULT)
GLib.idle_add(self.InstallTextBuffer.set_text,
self.StatusText,
priority=GLib.PRIORITY_DEFAULT)
else:
statustext = _("Installing completed!")
self.StatusText = self.StatusText + "\n" + statustext
GLib.idle_add(self.InstallLabel.set_text,
statustext,
priority=GLib.PRIORITY_DEFAULT)
GLib.idle_add(self.InstallTextBuffer.set_text,
self.StatusText,
priority=GLib.PRIORITY_DEFAULT)
self.FlatpakTransaction.disconnect(self.handler_id)
self.FlatpakTransaction.disconnect(self.handler_id_2)