From f7e54cc8a29e5fa319ce21d6ec268e210397740a Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 24 Jun 2017 21:55:37 +0100 Subject: write a proper Makefile, rearrange source code a bit --- src/backend/libsisyphus.sh | 179 +++++++++ src/frontend/cli/sisyphus-cli.py | 33 ++ src/frontend/cli/sisyphus-cli.sh | 116 ++++++ src/frontend/gui/accesories.py | 50 +++ src/frontend/gui/development.py | 50 +++ src/frontend/gui/everything.py | 61 +++ src/frontend/gui/games.py | 77 ++++ src/frontend/gui/graphics.py | 50 +++ src/frontend/gui/icon/category_accessories.png | Bin 0 -> 10321 bytes src/frontend/gui/icon/category_all.png | Bin 0 -> 16629 bytes src/frontend/gui/icon/category_development.png | Bin 0 -> 6675 bytes src/frontend/gui/icon/category_games.png | Bin 0 -> 3165 bytes src/frontend/gui/icon/category_graphics.png | Bin 0 -> 31803 bytes src/frontend/gui/icon/category_internet.png | Bin 0 -> 7535 bytes src/frontend/gui/icon/category_local.png | Bin 0 -> 5384 bytes src/frontend/gui/icon/category_multimedia.png | Bin 0 -> 5276 bytes src/frontend/gui/icon/category_office.png | Bin 0 -> 5638 bytes src/frontend/gui/icon/category_system.png | Bin 0 -> 9621 bytes src/frontend/gui/icon/package_install.png | Bin 0 -> 498 bytes src/frontend/gui/icon/package_search.png | Bin 0 -> 2959 bytes src/frontend/gui/icon/package_uninstall.png | Bin 0 -> 250 bytes src/frontend/gui/icon/remove_orphans.png | Bin 0 -> 354 bytes src/frontend/gui/icon/system_upgrade.png | Bin 0 -> 1089 bytes src/frontend/gui/icon/window_close.png | Bin 0 -> 971 bytes src/frontend/gui/icon/window_icon.png | Bin 0 -> 2691 bytes src/frontend/gui/internet.py | 100 +++++ src/frontend/gui/local.py | 50 +++ src/frontend/gui/multimedia.py | 50 +++ src/frontend/gui/office.py | 84 ++++ src/frontend/gui/sisyphus-gui.py | 106 +++++ src/frontend/gui/system.py | 50 +++ src/frontend/gui/ui/accesories.ui | 220 +++++++++++ src/frontend/gui/ui/development.ui | 220 +++++++++++ src/frontend/gui/ui/everything.ui | 220 +++++++++++ src/frontend/gui/ui/games.ui | 220 +++++++++++ src/frontend/gui/ui/graphics.ui | 220 +++++++++++ src/frontend/gui/ui/internet.ui | 220 +++++++++++ src/frontend/gui/ui/local.ui | 217 +++++++++++ src/frontend/gui/ui/multimedia.ui | 220 +++++++++++ src/frontend/gui/ui/office.ui | 220 +++++++++++ src/frontend/gui/ui/sisyphus-gui.ui | 520 +++++++++++++++++++++++++ src/frontend/gui/ui/system.ui | 220 +++++++++++ src/helpers/make_local_csv_post | 21 + src/helpers/make_local_csv_pre | 21 + 44 files changed, 3815 insertions(+) create mode 100755 src/backend/libsisyphus.sh create mode 100755 src/frontend/cli/sisyphus-cli.py create mode 100755 src/frontend/cli/sisyphus-cli.sh create mode 100755 src/frontend/gui/accesories.py create mode 100755 src/frontend/gui/development.py create mode 100755 src/frontend/gui/everything.py create mode 100755 src/frontend/gui/games.py create mode 100755 src/frontend/gui/graphics.py create mode 100644 src/frontend/gui/icon/category_accessories.png create mode 100644 src/frontend/gui/icon/category_all.png create mode 100644 src/frontend/gui/icon/category_development.png create mode 100644 src/frontend/gui/icon/category_games.png create mode 100644 src/frontend/gui/icon/category_graphics.png create mode 100644 src/frontend/gui/icon/category_internet.png create mode 100644 src/frontend/gui/icon/category_local.png create mode 100644 src/frontend/gui/icon/category_multimedia.png create mode 100644 src/frontend/gui/icon/category_office.png create mode 100644 src/frontend/gui/icon/category_system.png create mode 100644 src/frontend/gui/icon/package_install.png create mode 100644 src/frontend/gui/icon/package_search.png create mode 100644 src/frontend/gui/icon/package_uninstall.png create mode 100644 src/frontend/gui/icon/remove_orphans.png create mode 100644 src/frontend/gui/icon/system_upgrade.png create mode 100644 src/frontend/gui/icon/window_close.png create mode 100644 src/frontend/gui/icon/window_icon.png create mode 100755 src/frontend/gui/internet.py create mode 100755 src/frontend/gui/local.py create mode 100755 src/frontend/gui/multimedia.py create mode 100755 src/frontend/gui/office.py create mode 100755 src/frontend/gui/sisyphus-gui.py create mode 100755 src/frontend/gui/system.py create mode 100644 src/frontend/gui/ui/accesories.ui create mode 100644 src/frontend/gui/ui/development.ui create mode 100644 src/frontend/gui/ui/everything.ui create mode 100644 src/frontend/gui/ui/games.ui create mode 100644 src/frontend/gui/ui/graphics.ui create mode 100644 src/frontend/gui/ui/internet.ui create mode 100644 src/frontend/gui/ui/local.ui create mode 100644 src/frontend/gui/ui/multimedia.ui create mode 100644 src/frontend/gui/ui/office.ui create mode 100644 src/frontend/gui/ui/sisyphus-gui.ui create mode 100644 src/frontend/gui/ui/system.ui create mode 100755 src/helpers/make_local_csv_post create mode 100755 src/helpers/make_local_csv_pre (limited to 'src') diff --git a/src/backend/libsisyphus.sh b/src/backend/libsisyphus.sh new file mode 100755 index 0000000..530f9bf --- /dev/null +++ b/src/backend/libsisyphus.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash + +# import gentoo functions +source /lib/gentoo/functions.sh + +checkroot () { + if [[ "$(whoami)" != root ]] ; then + eerror "You're not root?...No cookies for you, go away !!!" + exit 1 + fi +} + +checksystemmode() { + if [[ "$(readlink -f "/etc/portage/make.conf")" = /opt/redcore-build/conf/intel/portage/make.conf.amd64-srcmode ]] ; then + eerror "The system is set to srcmode (full Gentoo mode), cowardly refusing to run!" + exit 1 + fi +} + +checkportageconfig () { + pushd /opt/redcore-build > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local confhash=$(git rev-parse @) + export local rconfhash=$(git rev-parse @{u}) + if [ $confhash != $rconfhash ] ; then + eerror "Portage config is out-of-date, run "sisyphus update" first" + exit 1 + fi + popd > /dev/null 2>&1 +} + +checkportagetree () { + pushd /usr/portage > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local treehash=$(git rev-parse @) + export local rtreehash=$(git rev-parse @{u}) + if [ $treehash != $rtreehash ] ; then + eerror "Portage tree is out-of-date, run "sisyphus update" first" + exit 1 + fi + popd > /dev/null 2>&1 +} + +checkredcoreoverlay () { + pushd /var/lib/layman/redcore-desktop > /dev/null 2>&1 + git remote update > /dev/null 2>&1 + export local overlayhash=$(git rev-parse @) + export local roverlayhash=$(git rev-parse @{u}) + if [ $overlayhash != $roverlayhash ] ; then + eerror "Redcore Desktop overlay is out-of-date, run "sisyphus update" first" + exit 1 + fi +} + +remotedbcsvget () { + if [[ ! -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then + pushd /var/lib/sisyphus/csv > /dev/null 2>&1 + touch remote_preinst.csv + wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 + popd > /dev/null 2>&1 + elif [[ -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then + pushd /var/lib/sisyphus/csv > /dev/null 2>&1 + wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 + popd > /dev/null 2>&1 + fi +} + +remotedbcsvcheck () { + if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + eerror "SisyphusDB : "remote_packages" table is out-of-date, run "sisyphus update" first" + rm -rf /var/lib/sisyphus/csv/remote_postinst.csv + exit 1 + elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + rm -rf /var/lib/sisyphus/csv/remote_postinst.csv + fi +} + +checkremotedb () { + remotedbcsvget + remotedbcsvcheck +} + +checksync () { + checkroot + checkportagetree + checkredcoreoverlay + checkportageconfig + checkremotedb +} + +syncrepos () { + emerge --sync +} + +syncportageconfig () { + pushd /opt/redcore-build > /dev/null 2>&1 + echo ">>> Syncing 'portage config' into '/etc/portage'..." + echo "/usr/bin/git pull" + git pull + echo "=== Sync completed for 'portage config'" + popd > /dev/null 2>&1 +} + +remotedbcsvsync () { + if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + pushd /var/lib/sisyphus/db > /dev/null 2>&1 + sqlite3 -echo sisyphus.db<<-EXIT_HERE + drop table if exists remote_packages; + create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); + .mode csv + .import /var/lib/sisyphus/csv/remote_postinst.csv remote_packages + EXIT_HERE + popd > /dev/null 2>&1 + echo "=== Sync completed for 'SisyphusDB remote_packages'" + elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then + echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + echo "Already up-to-date." + echo "=== Sync completed for 'SisyphusDB remote_packages'" + fi + mv /var/lib/sisyphus/csv/remote_postinst.csv /var/lib/sisyphus/csv/remote_preinst.csv +} + +syncremotedb() { + remotedbcsvget + remotedbcsvsync +} + +redcoresync () { + checkroot + syncrepos + syncportageconfig + syncremotedb +} + +localdbcsvpre () { + if [[ ! -f /var/lib/sisyphus/csv/local_preinst.csv ]] ; then + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /var/lib/sisyphus/csv/local_preinst.csv + popd > /dev/null 2>&1 + done + fi +} + +localdbcsvpost () { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /var/lib/sisyphus/csv/local_postinst.csv + popd > /dev/null 2>&1 + done +} + +localdbcsvsync () { + if cmp /var/lib/sisyphus/csv/local_preinst.csv /var/lib/sisyphus/csv/local_postinst.csv > /dev/null 2>&1 ; then + einfo "'PortageDB' && 'SisyphusDB local_packages' are in sync, nothing to do..." + else + einfo "'PortageDB' && 'SisyphusDB local_packages' are out of sync, syncing now..." + echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" + pushd /var/lib/sisyphus/db > /dev/null 2>&1 + sqlite3 -echo sisyphus.db<<-EXIT_HERE + drop table if exists local_packages; + create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); + .mode csv + .import /var/lib/sisyphus/csv/local_postinst.csv local_packages + EXIT_HERE + popd > /dev/null 2>&1 + einfo "'PortageDB' && 'SisyphusDB local_packages' resync complete..." + fi + mv /var/lib/sisyphus/csv/local_postinst.csv /var/lib/sisyphus/csv/local_preinst.csv +} + +updatelocaldb () { + checkroot + localdbcsvpost + localdbcsvsync +} diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py new file mode 100755 index 0000000..3d4fb3a --- /dev/null +++ b/src/frontend/cli/sisyphus-cli.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 + +import sys +import subprocess +from libsisyphus import * + +check_if_srcmode() + +if "__main__" == __name__: + if "install" in sys.argv[1:]: + sisyphus_pkg_install() + elif "uninstall" in sys.argv[1:]: + sisyphus_pkg_uninstall() + elif "force-uninstall" in sys.argv[1:]: + sisyphus_pkg_force_uninstall() + elif "remove-orphans" in sys.argv[1:]: + sisyphus_pkg_remove_orphans() + elif "upgrade" in sys.argv[1:]: + sisyphus_pkg_system_upgrade() + elif "auto-install" in sys.argv[1:]: + sisyphus_pkg_auto_install() + elif "auto-uninstall" in sys.argv[1:]: + sisyphus_pkg_auto_uninstall() + elif "auto-force-uninstall" in sys.argv[1:]: + sisyphus_pkg_auto_force_uninstall() + elif "auto-remove-orphans" in sys.argv[1:]: + sisyphus_pkg_auto_remove_orphans() + elif "auto-upgrade" in sys.argv[1:]: + sisyphus_pkg_auto_system_upgrade() + elif "search" in sys.argv[1:]: + sisyphus_pkg_search() + elif "update" in sys.argv[1:]: + sisyphus_pkg_system_update() diff --git a/src/frontend/cli/sisyphus-cli.sh b/src/frontend/cli/sisyphus-cli.sh new file mode 100755 index 0000000..79023aa --- /dev/null +++ b/src/frontend/cli/sisyphus-cli.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash + +source /usr/lib/sisyphus/libsisyphus.sh + +checksystemmode + +action=$1 +shift + +case "$action" in + install) + checksync + localdbcsvpre + emerge -a "$@" + updatelocaldb + ;; + uninstall) + checksync + localdbcsvpre + emerge --depclean -a "$@" + updatelocaldb + ;; + force-uninstall) + checksync + localdbcsvpre + emerge --unmerge -a "$@" + updatelocaldb + ;; + remove-orphans) + checksync + localdbcsvpre + emerge --depclean -a + updatelocaldb + ;; + upgrade) + checksync + localdbcsvpre + emerge -uDaN --with-bdeps=y @system @world "$@" + updatelocaldb + ;; + auto-install) + redcoresync + localdbcsvpre + emerge "$@" + updatelocaldb + ;; + auto-uninstall) + redcoresync + localdbcsvpre + emerge --depclean "$@" + updatelocaldb + ;; + auto-force-uninstall) + redcoresync + localdbcsvpre + emerge --unmerge "$@" + updatelocaldb + ;; + auto-remove-orphans) + redcoresync + localdbcsvpre + emerge --depclean -q + updatelocaldb + ;; + auto-upgrade) + redcoresync + localdbcsvpre + emerge -uDN --with-bdeps=y @system @world "$@" + updatelocaldb + ;; + search) + emerge -s "$@" + ;; + update) + redcoresync + ;; + belongs) + equery belongs "$@" + ;; + depends) + equery depends "$@" + ;; + files) + equery files "$@" + ;; + sysinfo) + emerge --info + ;; + *) + cat <<-"EOH" + Usage: sisyphus command [package(s)] + + sisyphus is a simple wrapper around portage, gentoolkit, and portage-utils that provides an + apt-get/yum-alike interface to these commands, to assist people transitioning from + Debian/RedHat-based systems to Gentoo. + + Commands : + install - Install new packages + uninstall - Uninstall packages safely + force-uninstall - *Unsafely* uninstall packages + remove-orphans - Uninstall packages that are no longer needed + upgrade - Upgrade system + auto-install - Install new packages (no confirmation) + auto-uninstall - Uninstall packages safely (no confirmation) + auto-force-uninstall - *Unsafely* uninstall packages (no confirmation) + auto-remove-orphans - Uninstall packages that are no longer needed (no confirmation) + auto-upgrade - Upgrade system (no confirmation) + search - Search for packages + update - Resync portage tree, portage config && redcore overlay + belongs - List what package FILE(s) belong to + depends - List all packages directly depending on given package + files - List all files installed by package + sysinfo - Display information about installed core packages and portage configuration + EOH + ;; +esac diff --git a/src/frontend/gui/accesories.py b/src/frontend/gui/accesories.py new file mode 100755 index 0000000..32d3b68 --- /dev/null +++ b/src/frontend/gui/accesories.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Accesories(QtWidgets.QMainWindow): + def __init__(self): + super(Accesories, self).__init__() + uic.loadUi('ui/accesories.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_accesories.item(self.table_accesories.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_accesories.insertRow(inx) + self.table_accesories.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_accesories.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_accesories.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_accesories.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_accesories.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/development.py b/src/frontend/gui/development.py new file mode 100755 index 0000000..ede83a4 --- /dev/null +++ b/src/frontend/gui/development.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Development(QtWidgets.QMainWindow): + def __init__(self): + super(Development, self).__init__() + uic.loadUi('ui/development.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_development.item(self.table_development.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_development.insertRow(inx) + self.table_development.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_development.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_development.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_development.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_development.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/everything.py b/src/frontend/gui/everything.py new file mode 100755 index 0000000..ac83ca6 --- /dev/null +++ b/src/frontend/gui/everything.py @@ -0,0 +1,61 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Everything(QtWidgets.QMainWindow): + def __init__(self): + super(Everything, self).__init__() + uic.loadUi('ui/everything.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_everything.item(self.table_everything.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_everything.insertRow(inx) + self.table_everything.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_everything.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_everything.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_everything.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_everything.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/games.py b/src/frontend/gui/games.py new file mode 100755 index 0000000..5eed9fa --- /dev/null +++ b/src/frontend/gui/games.py @@ -0,0 +1,77 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Games(QtWidgets.QMainWindow): + def __init__(self): + super(Games, self).__init__() + uic.loadUi('ui/games.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_games.item(self.table_games.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('steam', + 'playonlinux', + 'armagetronad', + 'chromium-bsu', + 'supertuxkart', + 'teeworlds', + 'dosbox', + 'snes9x', + 'zsnes', + 'urbanterror', + 'openttd', + '0ad', + 'warzone2100', + 'wesnoth', + 'xonotic') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_games.insertRow(inx) + self.table_games.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_games.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_games.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_games.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_games.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/graphics.py b/src/frontend/gui/graphics.py new file mode 100755 index 0000000..a50a169 --- /dev/null +++ b/src/frontend/gui/graphics.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Graphics(QtWidgets.QMainWindow): + def __init__(self): + super(Graphics, self).__init__() + uic.loadUi('ui/graphics.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_graphics.item(self.table_graphics.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_graphics.insertRow(inx) + self.table_graphics.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_graphics.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_graphics.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_graphics.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_graphics.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/icon/category_accessories.png b/src/frontend/gui/icon/category_accessories.png new file mode 100644 index 0000000..becbfc9 Binary files /dev/null and b/src/frontend/gui/icon/category_accessories.png differ diff --git a/src/frontend/gui/icon/category_all.png b/src/frontend/gui/icon/category_all.png new file mode 100644 index 0000000..462c97c Binary files /dev/null and b/src/frontend/gui/icon/category_all.png differ diff --git a/src/frontend/gui/icon/category_development.png b/src/frontend/gui/icon/category_development.png new file mode 100644 index 0000000..b2c160e Binary files /dev/null and b/src/frontend/gui/icon/category_development.png differ diff --git a/src/frontend/gui/icon/category_games.png b/src/frontend/gui/icon/category_games.png new file mode 100644 index 0000000..b128490 Binary files /dev/null and b/src/frontend/gui/icon/category_games.png differ diff --git a/src/frontend/gui/icon/category_graphics.png b/src/frontend/gui/icon/category_graphics.png new file mode 100644 index 0000000..63c7c5e Binary files /dev/null and b/src/frontend/gui/icon/category_graphics.png differ diff --git a/src/frontend/gui/icon/category_internet.png b/src/frontend/gui/icon/category_internet.png new file mode 100644 index 0000000..9f630cd Binary files /dev/null and b/src/frontend/gui/icon/category_internet.png differ diff --git a/src/frontend/gui/icon/category_local.png b/src/frontend/gui/icon/category_local.png new file mode 100644 index 0000000..561d218 Binary files /dev/null and b/src/frontend/gui/icon/category_local.png differ diff --git a/src/frontend/gui/icon/category_multimedia.png b/src/frontend/gui/icon/category_multimedia.png new file mode 100644 index 0000000..e6414e6 Binary files /dev/null and b/src/frontend/gui/icon/category_multimedia.png differ diff --git a/src/frontend/gui/icon/category_office.png b/src/frontend/gui/icon/category_office.png new file mode 100644 index 0000000..78af8a4 Binary files /dev/null and b/src/frontend/gui/icon/category_office.png differ diff --git a/src/frontend/gui/icon/category_system.png b/src/frontend/gui/icon/category_system.png new file mode 100644 index 0000000..2a360bd Binary files /dev/null and b/src/frontend/gui/icon/category_system.png differ diff --git a/src/frontend/gui/icon/package_install.png b/src/frontend/gui/icon/package_install.png new file mode 100644 index 0000000..736cddf Binary files /dev/null and b/src/frontend/gui/icon/package_install.png differ diff --git a/src/frontend/gui/icon/package_search.png b/src/frontend/gui/icon/package_search.png new file mode 100644 index 0000000..5f50a53 Binary files /dev/null and b/src/frontend/gui/icon/package_search.png differ diff --git a/src/frontend/gui/icon/package_uninstall.png b/src/frontend/gui/icon/package_uninstall.png new file mode 100644 index 0000000..187ce04 Binary files /dev/null and b/src/frontend/gui/icon/package_uninstall.png differ diff --git a/src/frontend/gui/icon/remove_orphans.png b/src/frontend/gui/icon/remove_orphans.png new file mode 100644 index 0000000..b165bf7 Binary files /dev/null and b/src/frontend/gui/icon/remove_orphans.png differ diff --git a/src/frontend/gui/icon/system_upgrade.png b/src/frontend/gui/icon/system_upgrade.png new file mode 100644 index 0000000..4443cb7 Binary files /dev/null and b/src/frontend/gui/icon/system_upgrade.png differ diff --git a/src/frontend/gui/icon/window_close.png b/src/frontend/gui/icon/window_close.png new file mode 100644 index 0000000..35dbf35 Binary files /dev/null and b/src/frontend/gui/icon/window_close.png differ diff --git a/src/frontend/gui/icon/window_icon.png b/src/frontend/gui/icon/window_icon.png new file mode 100644 index 0000000..da169ba Binary files /dev/null and b/src/frontend/gui/icon/window_icon.png differ diff --git a/src/frontend/gui/internet.py b/src/frontend/gui/internet.py new file mode 100755 index 0000000..e8ad1d3 --- /dev/null +++ b/src/frontend/gui/internet.py @@ -0,0 +1,100 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Internet(QtWidgets.QMainWindow): + def __init__(self): + super(Internet, self).__init__() + uic.loadUi('ui/internet.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_internet.item(self.table_internet.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('firewalld', + 'ufw', + 'ufw-frontends', + 'cifs-utils', + 'samba', + 'sshfs', + 'filezilla', + 'franz', + 'qtox', + 'telegram', + 'viber', + 'konversation', + 'quassel', + 'aria2', + 'dropbox', + 'megasync', + 'owncloud-client', + 'teamviewer', + 'telnet-bsd', + 'tigervnc', + 'youtube-dl', + 'quiterss', + 'qbittorrent', + 'transmission', + 'firefox', + 'google-chrome', + 'opera', + 'qupzilla', + 'vivaldi', + 'adobe-flash', + 'chrome-binary-plugins', + 'freshplayerplugin', + 'google-talkplugin', + 'wmail', + 'trojita', + 'aircrack-ng', + 'wavemon', + 'messengerfordesktop') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_internet.insertRow(inx) + self.table_internet.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_internet.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_internet.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_internet.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_internet.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/local.py b/src/frontend/gui/local.py new file mode 100755 index 0000000..e8b506a --- /dev/null +++ b/src/frontend/gui/local.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Local(QtWidgets.QMainWindow): + def __init__(self): + super(Local, self).__init__() + uic.loadUi('ui/local.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_local.item(self.table_local.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from local_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_local.insertRow(inx) + self.table_local.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_local.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_local.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_local.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_local.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/multimedia.py b/src/frontend/gui/multimedia.py new file mode 100755 index 0000000..e4214f2 --- /dev/null +++ b/src/frontend/gui/multimedia.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Multimedia(QtWidgets.QMainWindow): + def __init__(self): + super(Multimedia, self).__init__() + uic.loadUi('ui/multimedia.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_multimedia.item(self.table_multimedia.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_multimedia.insertRow(inx) + self.table_multimedia.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_multimedia.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_multimedia.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_multimedia.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_multimedia.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/office.py b/src/frontend/gui/office.py new file mode 100755 index 0000000..286494a --- /dev/null +++ b/src/frontend/gui/office.py @@ -0,0 +1,84 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class Office(QtWidgets.QMainWindow): + def __init__(self): + super(Office, self).__init__() + uic.loadUi('ui/office.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_office.item(self.table_office.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('fet', + 'libreoffice', + 'wps-office', + 'tesseract', + 'okular', + 'cantarell', + 'corefonts', + 'dejavu', + 'liberation-fonts', + 'libertine', + 'noto', + 'open-sans', + 'roboto', + 'ttf-bitstream-vera', + 'qpdfview', + 'cups', + 'cups-filters', + 'cups-pdf', + 'simple-scan', + 'cnijfilter', + 'cnijfilter-drivers', + 'hplip') + ''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_office.insertRow(inx) + self.table_office.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_office.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_office.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_office.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_office.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py new file mode 100755 index 0000000..1cc4fb6 --- /dev/null +++ b/src/frontend/gui/sisyphus-gui.py @@ -0,0 +1,106 @@ +#!/usr/bin/python3 +import sys, subprocess +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +from accesories import Accesories +from development import Development +from games import Games +from graphics import Graphics +from internet import Internet +from multimedia import Multimedia +from office import Office +from system import System +from local import Local +from everything import Everything + +class Sisyphus(QtWidgets.QMainWindow): + def __init__(self): + super(Sisyphus, self).__init__() + uic.loadUi('ui/sisyphus-gui.ui', self) + self.centerOnScreen() + self.show() + + self.package_search.clicked.connect(self.search_package) + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.system_upgrade.clicked.connect(self.upgrade_system) + self.orphans_remove.clicked.connect(self.remove_orphans) + + self.category_accesories.clicked.connect(self.accesories_category) + self.category_development.clicked.connect(self.development_category) + self.category_games.clicked.connect(self.games_category) + self.category_graphics.clicked.connect(self.graphics_category) + self.category_internet.clicked.connect(self.internet_category) + self.category_multimedia.clicked.connect(self.multimedia_category) + self.category_office.clicked.connect(self.office_category) + self.category_system.clicked.connect(self.system_category) + self.category_local.clicked.connect(self.local_category) + self.category_everything.clicked.connect(self.everything_category) + + def centerOnScreen (self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def search_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-hold', '-e', 'sisyphus', 'search'] + pkgname.split()) + + def install_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.input.text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def upgrade_system(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'autoupgrade']) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def accesories_category(self): + self.window = Accesories() + self.window.show() + + def development_category(self): + self.window = Development() + self.window.show() + + def games_category(self): + self.window = Games() + self.window.show() + + def graphics_category(self): + self.window = Graphics() + self.window.show() + + def internet_category(self): + self.window = Internet() + self.window.show() + + def multimedia_category(self): + self.window = Multimedia() + self.window.show() + + def office_category(self): + self.window = Office() + self.window.show() + + def system_category(self): + self.window = System() + self.window.show() + + def local_category(self): + self.window = Local() + self.window.show() + + def everything_category(self): + self.window = Everything() + self.window.show() + +if __name__ == '__main__': + app = QtWidgets.QApplication(sys.argv) + window = Sisyphus() + sys.exit(app.exec_()) diff --git a/src/frontend/gui/system.py b/src/frontend/gui/system.py new file mode 100755 index 0000000..f8cc428 --- /dev/null +++ b/src/frontend/gui/system.py @@ -0,0 +1,50 @@ +#!/usr/bin/python3 +import sys, subprocess, sqlite3 +from PyQt5 import QtCore, QtGui, QtWidgets, uic + +class System(QtWidgets.QMainWindow): + def __init__(self): + super(System, self).__init__() + uic.loadUi('ui/system.ui', self) + self.centerOnScreen() + self.show() + self.load_packages() + + self.package_install.clicked.connect(self.install_package) + self.package_uninstall.clicked.connect(self.uninstall_package) + self.orphans_remove.clicked.connect(self.remove_orphans) + self.category_exit.clicked.connect(self.exit_category) + + def centerOnScreen(self): + resolution = QtWidgets.QDesktopWidget().screenGeometry() + self.move((resolution.width() / 2) - (self.frameSize().width() / 2), + (resolution.height() / 2) - (self.frameSize().height() / 2)) + + def install_package(self): + pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + + def uninstall_package(self): + pkgname = self.table_system.item(self.table_system.currentRow(), 1).text() + subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + + def remove_orphans(self): + subprocess.Popen(['xterm', '-e', 'sisyphus', 'remove-orphans']) + + def exit_category(self): + self.close() + + def load_packages(self): + with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db: + cursor=db.cursor() + cursor.execute('''SELECT * from remote_packages''') + rows = cursor.fetchall() + + for row in rows: + inx = rows.index(row) + self.table_system.insertRow(inx) + self.table_system.setItem(inx, 0, QtWidgets.QTableWidgetItem(row[0])) + self.table_system.setItem(inx, 1, QtWidgets.QTableWidgetItem(row[1])) + self.table_system.setItem(inx, 2, QtWidgets.QTableWidgetItem(row[2])) + self.table_system.setItem(inx, 3, QtWidgets.QTableWidgetItem(row[3])) + self.table_system.setItem(inx, 4, QtWidgets.QTableWidgetItem(row[4])) diff --git a/src/frontend/gui/ui/accesories.ui b/src/frontend/gui/ui/accesories.ui new file mode 100644 index 0000000..ea9e495 --- /dev/null +++ b/src/frontend/gui/ui/accesories.ui @@ -0,0 +1,220 @@ + + + Accesories + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Accesories + + + + ../icon/category_accessories.png../icon/category_accessories.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_accesories + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/development.ui b/src/frontend/gui/ui/development.ui new file mode 100644 index 0000000..4c102f1 --- /dev/null +++ b/src/frontend/gui/ui/development.ui @@ -0,0 +1,220 @@ + + + Development + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Development + + + + ../icon/category_development.png../icon/category_development.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_development + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/everything.ui b/src/frontend/gui/ui/everything.ui new file mode 100644 index 0000000..b609cee --- /dev/null +++ b/src/frontend/gui/ui/everything.ui @@ -0,0 +1,220 @@ + + + Everything + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : All Packages + + + + ../icon/category_all.png../icon/category_all.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_everything + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/games.ui b/src/frontend/gui/ui/games.ui new file mode 100644 index 0000000..0bbc787 --- /dev/null +++ b/src/frontend/gui/ui/games.ui @@ -0,0 +1,220 @@ + + + Games + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Games + + + + ../icon/category_games.png../icon/category_games.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_games + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/graphics.ui b/src/frontend/gui/ui/graphics.ui new file mode 100644 index 0000000..e943b49 --- /dev/null +++ b/src/frontend/gui/ui/graphics.ui @@ -0,0 +1,220 @@ + + + Graphics + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Graphics + + + + ../icon/category_graphics.png../icon/category_graphics.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_graphics + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/internet.ui b/src/frontend/gui/ui/internet.ui new file mode 100644 index 0000000..810c065 --- /dev/null +++ b/src/frontend/gui/ui/internet.ui @@ -0,0 +1,220 @@ + + + Internet + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Internet + + + + ../icon/category_internet.png../icon/category_internet.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_internet + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/local.ui b/src/frontend/gui/ui/local.ui new file mode 100644 index 0000000..46cd6f9 --- /dev/null +++ b/src/frontend/gui/ui/local.ui @@ -0,0 +1,217 @@ + + + Local + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Local Packages + + + + ../icon/category_local.png../icon/category_local.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + false + + + + Category + + + + + Name + + + + + Version + + + + + Slot + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_local + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/multimedia.ui b/src/frontend/gui/ui/multimedia.ui new file mode 100644 index 0000000..b2c4938 --- /dev/null +++ b/src/frontend/gui/ui/multimedia.ui @@ -0,0 +1,220 @@ + + + Multimedia + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Multimedia + + + + ../icon/category_multimedia.png../icon/category_multimedia.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_multimedia + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/office.ui b/src/frontend/gui/ui/office.ui new file mode 100644 index 0000000..d1d3bad --- /dev/null +++ b/src/frontend/gui/ui/office.ui @@ -0,0 +1,220 @@ + + + Office + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category Office + + + + ../icon/category_office.png../icon/category_office.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_office + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/frontend/gui/ui/sisyphus-gui.ui b/src/frontend/gui/ui/sisyphus-gui.ui new file mode 100644 index 0000000..0d6749c --- /dev/null +++ b/src/frontend/gui/ui/sisyphus-gui.ui @@ -0,0 +1,520 @@ + + + MainWindow + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Graphical User Interface + + + + ../icon/window_icon.png../icon/window_icon.png + + + Qt::LeftToRight + + + true + + + + + 0 + 0 + + + + + + 0 + 0 + 1000 + 200 + + + + + 0 + 0 + + + + Qt::LeftToRight + + + true + + + QFrame::NoFrame + + + QFrame::Plain + + + + + 100 + 30 + 800 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Enter package name you want to Search/Install/Uninstall</p></body></html> + + + Enter package name... + + + true + + + Qt::AlignJustify|Qt::AlignVCenter + + + true + + + + + + 215 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Install package(s)</p></body></html> + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + + 25 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Search package(s)</p></body></html> + + + + ../icon/package_search.png../icon/package_search.png + + + + 32 + 32 + + + + + + + 405 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Uninstall package(s)</p></body></html> + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 595 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Upgrade system</p></body></html> + + + + ../icon/system_upgrade.png../icon/system_upgrade.png + + + + 32 + 32 + + + + + + + 785 + 105 + 190 + 40 + + + + + 0 + 0 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + + 0 + 200 + 1000 + 400 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + 25 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Accesories Category</p></body></html> + + + + ../icon/category_accessories.png../icon/category_accessories.png + + + + 64 + 64 + + + + + + + 425 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Games Category</p></body></html> + + + + ../icon/category_games.png../icon/category_games.png + + + + 64 + 64 + + + + + + + 625 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Graphics Category</p></body></html> + + + + ../icon/category_graphics.png../icon/category_graphics.png + + + + 64 + 64 + + + + + + + 825 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Internet Category</p></body></html> + + + + ../icon/category_internet.png../icon/category_internet.png + + + + 64 + 64 + + + + + + + 25 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Multimedia Category</p></body></html> + + + + ../icon/category_multimedia.png../icon/category_multimedia.png + + + + 64 + 64 + + + + + + + 225 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Office Category</p></body></html> + + + + ../icon/category_office.png../icon/category_office.png + + + + 64 + 64 + + + + + + + 425 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse System Category</p></body></html> + + + + ../icon/category_system.png../icon/category_system.png + + + + 64 + 64 + + + + + + + 225 + 20 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Development Category</p></body></html> + + + + ../icon/category_development.png../icon/category_development.png + + + + 64 + 64 + + + + + + + 625 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse All Packages</p></body></html> + + + + ../icon/category_all.png../icon/category_all.png + + + + 64 + 64 + + + + + + + 825 + 215 + 150 + 150 + + + + <html><head/><body><p align="center">Browse Installed Packages</p></body></html> + + + + + + + ../icon/category_local.png../icon/category_local.png + + + + 64 + 64 + + + + + + + + input + package_search + package_install + package_uninstall + system_upgrade + orphans_remove + category_accesories + category_development + category_games + category_graphics + category_internet + category_multimedia + category_office + category_system + category_local + category_everything + + + + diff --git a/src/frontend/gui/ui/system.ui b/src/frontend/gui/ui/system.ui new file mode 100644 index 0000000..59f1967 --- /dev/null +++ b/src/frontend/gui/ui/system.ui @@ -0,0 +1,220 @@ + + + System + + + Qt::ApplicationModal + + + + 0 + 0 + 1000 + 600 + + + + + 0 + 0 + + + + + 1000 + 600 + + + + Sisyphus : Category System + + + + ../icon/category_system.png../icon/category_system.png + + + + + 25 + 25 + 950 + 475 + + + + + 950 + 500 + + + + QFrame::Panel + + + QFrame::Raised + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::NoEditTriggers + + + false + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + 110 + + + true + + + false + + + + Category + + + + + Name + + + + + Available Version + + + + + Installed Version + + + + + Description + + + + + + + 275 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Uninstall package</p></body></html> + + + + + + + ../icon/package_uninstall.png../icon/package_uninstall.png + + + + 32 + 32 + + + + + + + 525 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Remove orphan packages</p></body></html> + + + + + + + ../icon/remove_orphans.png../icon/remove_orphans.png + + + + 32 + 32 + + + + + + + 775 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Close window</p></body></html> + + + + ../icon/window_close.png../icon/window_close.png + + + + 32 + 32 + + + + + + + 25 + 530 + 200 + 40 + + + + <html><head/><body><p align="center">Install package</p></body></html> + + + + + + + ../icon/package_install.png../icon/package_install.png + + + + 32 + 32 + + + + + + table_system + package_install + package_uninstall + orphans_remove + category_exit + + + + diff --git a/src/helpers/make_local_csv_post b/src/helpers/make_local_csv_post new file mode 100755 index 0000000..cd38974 --- /dev/null +++ b/src/helpers/make_local_csv_post @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +collect_local_portage_database() { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /tmp/local_postinst.csv + popd > /dev/null 2>&1 + done + mv /tmp/local_postinst.csv /var/lib/sisyphus/csv/ +} + +clean_temporary_files() { + rm -rf /tmp/local_postinst.csv +} + +main() { + collect_local_portage_database + clean_temporary_files +} + +main diff --git a/src/helpers/make_local_csv_pre b/src/helpers/make_local_csv_pre new file mode 100755 index 0000000..068331e --- /dev/null +++ b/src/helpers/make_local_csv_pre @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +collect_local_portage_database() { + for i in $(qlist -ICv); do + pushd /var/db/pkg/$i > /dev/null 2>&1 + echo "$(> /tmp/local_preinst.csv + popd > /dev/null 2>&1 + done + mv /tmp/local_preinst.csv /var/lib/sisyphus/csv/ +} + +clean_temporary_files() { + rm -rf /tmp/local_preinst.csv +} + +main() { + collect_local_portage_database + clean_temporary_files +} + +main -- cgit v1.2.3