Last step before base

This commit is contained in:
YourSandwich 2021-05-02 07:14:44 +02:00
parent 19324b1115
commit 29925c7eb5
2 changed files with 18 additions and 25 deletions

BIN
Installing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

39
main.py
View File

@ -1,7 +1,7 @@
from PySide2.QtWidgets import QWidget, QPushButton, QListWidget, QApplication, QListWidgetItem, QMessageBox, QTextBrowser, QVBoxLayout from PySide2.QtWidgets import QWidget, QPushButton, QListWidget, QApplication, QListWidgetItem, QMessageBox, QLabel, QVBoxLayout
from PySide2.QtGui import QGuiApplication, QIcon, QFont from PySide2.QtGui import QGuiApplication, QIcon, QFont
from getKernelInfo import KernelVerList, KernelURL from getKernelInfo import KernelVerList, KernelURL
import sys,os import sys,os,time
# TODO: Fix the install Process function. # TODO: Fix the install Process function.
# TODO: Implement resizable Windows # TODO: Implement resizable Windows
@ -34,6 +34,8 @@ class Window(QWidget):
def installKernel(self): def installKernel(self):
self.install = InstallProcess() self.install = InstallProcess()
self.install.show() self.install.show()
self.install.Installation()
self.install.hide()
## Application Quit Popup ## Application Quit Popup
def exitApp(self): def exitApp(self):
@ -58,33 +60,23 @@ class InstallProcess(QWidget):
QWidget.__init__(self, *args) QWidget.__init__(self, *args)
self.setWindowTitle("Kernel Installation") self.setWindowTitle("Kernel Installation")
self.setMinimumSize(400,300) self.setFixedSize(400,120)
self.center() self.center()
def Installation():
output = os.popen("wget "+ URL + " -P ~/").read()
return output
Stream = Installation()
#!!! WARNING this function is wrong it waits for the Terminal to finish then it display the output.
#!!! If you put yes in it, the Program will freeze, there needs to be a better way to implement this.
# Output into InstallProcess Windows -> QTextBrowser
"""
def letsgo():
output = os.popen("echo 'The Place where all the Terminal work is gonna be done.'").read()
return output
Stream = letsgo()
"""
# create objects # create objects
self.te = QTextBrowser() self.te = QLabel()
# puts the Terminal output into InstallWindow # puts the Terminal output into InstallWindow
self.te.setHtml(Stream) pic = 'Installing.png'
self.te.setPixmap(pic)
# layout # layout
layout = QVBoxLayout(self) self.layout = QVBoxLayout(self)
layout.addWidget(self.te) self.layout.addWidget(self.te)
self.setLayout(layout) self.setLayout(self.layout)
def Installation(self):
os.system("wget "+ URL + " -P ~/")
print("done")
def center(self): def center(self):
qRect = self.frameGeometry() qRect = self.frameGeometry()
@ -125,4 +117,5 @@ def main():
App.exec_() App.exec_()
sys.exit(0) sys.exit(0)
if __name__ == '__main__':
main() main()