Skip to content

Commit

Permalink
Initial commit (v1.4.0)
Browse files Browse the repository at this point in the history
Initial commit, ProtonUp-Qt v1.4.0 for ProtonUp v0.1.4.
  • Loading branch information
DavidoTek committed Aug 29, 2021
1 parent 4151319 commit c90716c
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 0 deletions.
42 changes: 42 additions & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: 1
script:
- rm -rf AppDir | true
- mkdir -p AppDir/usr/src
- mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
- cp pupgui AppDir/usr/src -r
- pyside6-uic ui/protonup_mainwindow.ui > AppDir/usr/src/pupgui/protonup_mainwindow.py
- cp ui/pupgui.png AppDir/usr/share/icons/hicolor/256x256/apps
- python3 -m pip install --ignore-installed --prefix=/usr --root=AppDir -r ./requirements.txt


AppDir:
path: ./AppDir

app_info:
id: net.davidotek.protonup-qt
name: ProtonUp-Qt
icon: pupgui
version: 1.4.0
exec: usr/bin/python3
exec_args: "$APPDIR/usr/src/pupgui/pupgui.py $@"

apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse'
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'

include:
- python3
- python3-pkg-resources
exclude: []

runtime:
env:
PYTHONHOME: '${APPDIR}/usr'
PYTHONPATH: '${APPDIR}/usr/lib/python3.9/site-packages'


AppImage:
sign-key: None
arch: x86_64
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ProtonUp-Qt
Qt-based graphical user interface for [ProtonUp](https://github.com/AUNaseef/protonup).

## Run from source
### Install dependencies
`pip3 install -r ./requirements.txt`
### Compile GUI
`pyside6-uic ui/protonup_mainwindow.ui > pupgui/protonup_mainwindow.py`
### Run ProtonUp-Qt
`python3 pupgui/pupgui.py`

## Build AppImage
### Install dependencies
1. Install appimage-builder: https://appimage-builder.readthedocs.io/en/latest/intro/install.html
2. Install PySide6: `pip3 install pyside6`
### Build AppImage
`appimage-builder`

## Licensing
Project|License
-------|--------
ProtonUp-Qt|GPL-3.0
[ProtonUp](https://pypi.org/project/protonup/)|GPL-3.0
[PySide6](https://pypi.org/project/PySide6/)|LGPL-3.0/GPL-2.0
80 changes: 80 additions & 0 deletions pupgui/pupgui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/usr/bin/env python3
import sys, threading
from PySide6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
from protonup_mainwindow import Ui_MainWindow

import protonup.api as papi


APP_NAME = 'ProtonUp-Qt'
APP_VERSION = '1.4.0'


class installProtonThread(threading.Thread):
def __init__(self, proton_version, main_window):
threading.Thread.__init__(self)
self.proton_version = proton_version
self.main_window = main_window
def run(self):
self.main_window.ui.statusBar.showMessage('Installing Proton-' + self.proton_version + '...')
papi.get_proton(self.proton_version)
self.main_window.ui.statusBar.showMessage('Installed Proton-' + self.proton_version)
self.main_window.updateInfo()


class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)

self._available_releases = []

self.ui.btnAddVersion.clicked.connect(self.btnAddVersionClicked)
self.ui.btnRemoveSelected.clicked.connect(self.btnRemoveSelectedClicked)
self.ui.btnClose.clicked.connect(self.btnCloseClicked)

self.ui.comboInstallDirectory.addItem(papi.install_directory())

self.updateInfo()
self._available_releases = papi.fetch_releases() # ToDo: separate thread

app_status_label = QLabel(APP_NAME + ' ' + APP_VERSION)
self.ui.statusBar.addPermanentWidget(app_status_label)

self.setWindowIcon(QIcon.fromTheme('pupgui'))

def btnAddVersionClicked(self):
result = QInputDialog.getItem(self, 'Install Proton', 'Select Proton-GE version to be installed', self._available_releases, editable=False)
if not result[1]:
return
install_thread = installProtonThread(result[0], self)
install_thread.start()

def btnRemoveSelectedClicked(self):
current = self.ui.listInstalledVersions.currentItem()
if not current:
return
ver = current.text().replace('Proton-', '')
papi.remove_proton(ver)
self.ui.statusBar.showMessage('Removed Proton-' + ver, timeout=3000)
self.updateInfo()

def btnCloseClicked(self):
self.close()

def updateInfo(self):
# installed versions
self.ui.listInstalledVersions.clear()
for item in papi.installed_versions():
self.ui.listInstalledVersions.addItem(item)

if __name__ == '__main__':
app = QApplication(sys.argv)

window = MainWindow()
window.show()

sys.exit(app.exec())
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
protonup==0.1.4
PySide6==6.1.2
103 changes: 103 additions & 0 deletions ui/protonup_mainwindow.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>320</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string>ProtonUp - Proton-GE Installer</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="lblInstallDirectory">
<property name="text">
<string>Install directory:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboInstallDirectory"/>
</item>
<item>
<widget class="QLabel" name="lblInstalledVersions">
<property name="text">
<string>Installed Proton-GE versions:</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listInstalledVersions"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnAddVersion">
<property name="text">
<string>Add version</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRemoveSelected">
<property name="text">
<string>Remove selected</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnClose">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<resources/>
<connections/>
</ui>
Binary file added ui/pupgui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c90716c

Please sign in to comment.