Add functions and Comments
This commit is contained in:
parent
f845f67aa9
commit
f041d6cfba
2 changed files with 119 additions and 72 deletions
|
@ -1,4 +1,10 @@
|
|||
#!/usr/bin/python
|
||||
'''
|
||||
Parch Linux Project (c) 2023
|
||||
Parch Linux is an open-source, Arch-based Linux distribution, that tried to be pretty, easy to use, light, fast and stable.
|
||||
|
||||
Project: parch-welcome
|
||||
'''
|
||||
# Resource object code (Python 3)
|
||||
# Created by: object code
|
||||
# Created by: The Resource Compiler for Qt version 5.15.10
|
||||
|
@ -1225,79 +1231,95 @@ class Quick(QQmlApplicationEngine):
|
|||
super(Quick, self).__init__()
|
||||
|
||||
|
||||
# Main Class of Parch Welcome Project
|
||||
class Main(Quick):
|
||||
browser = "xdg-open"
|
||||
|
||||
# DO: Button 1 loading link: https://github.com/parchlinux
|
||||
def b1_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://github.com/parchlinux', shell=True)
|
||||
self.link("https://github.com/parchlinux")
|
||||
|
||||
# DO: Button 2 loading link: https://twitter.com/bssfoss
|
||||
def b2_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://twitter.com/bssfoss', shell=True)
|
||||
self.link("https://twitter.com/bssfoss")
|
||||
|
||||
# DO: Button 3 loading link: https://t.me/parchlinux
|
||||
def b3_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://t.me/parchlinux', shell=True)
|
||||
self.link("https://t.me/parchlinux")
|
||||
|
||||
# DO: Button 4 loading link: https://discord.gg/9RW5cRByAM
|
||||
def b4_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://discord.gg/9RW5cRByAM', shell=True)
|
||||
self.link("https://discord.gg/9RW5cRByAM")
|
||||
|
||||
# DO: Button 5 loading link: https://mas.to/@bssfoss
|
||||
def b5_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://mas.to/@bssfoss', shell=True)
|
||||
self.link("https://mas.to/@bssfoss")
|
||||
|
||||
# DO: Button 6 loading link: https://coffeete.ir/parchlinux
|
||||
def b6_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://coffeete.ir/parchlinux', shell=True)
|
||||
self.link("https://coffeete.ir/parchlinux")
|
||||
|
||||
# DO: Button 7 loading link: https://parchlinux.ir
|
||||
def b7_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://parchlinux.ir', shell=True)
|
||||
self.link("https://parchlinux.ir")
|
||||
|
||||
# DO: Button 8 loading link: https://parchlinux.ir/parchwiki/
|
||||
def b8_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://parchlinux.ir/parchwiki/', shell=True)
|
||||
self.link("https://parchlinux.ir/parchwiki/")
|
||||
|
||||
# DO: Run Calamares Installer
|
||||
def install_(self):
|
||||
self.close()
|
||||
subprocess.call('sudo sh /etc/calamares/launch.sh',shell=True)
|
||||
subprocess.run('sudo sh /etc/calamares/launch.sh',shell=True)
|
||||
|
||||
# DO: Loading link in `xdg-open` function
|
||||
def link(self,url):
|
||||
self.close()
|
||||
subprocess.run(f'xdg-open {url}',shell=True)
|
||||
|
||||
# DO: Init Function
|
||||
def __init__(self):
|
||||
super(Main, self).__init__()
|
||||
|
||||
# Load Main QML file
|
||||
self.load(":/ParchLinux.qml")
|
||||
|
||||
self.b1 = self.findChild("b1")
|
||||
self.b1.clicked.connect(self.b1_)
|
||||
|
||||
self.b2 = self.findChild("b2")
|
||||
self.b2.clicked.connect(self.b2_)
|
||||
self.b1 = self.findChild("b1") # Find Button 1
|
||||
self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_
|
||||
|
||||
self.b3 = self.findChild("b3")
|
||||
self.b3.clicked.connect(self.b3_)
|
||||
self.b2 = self.findChild("b2") # Find Button 2
|
||||
self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_
|
||||
|
||||
self.b4 = self.findChild("b4")
|
||||
self.b4.clicked.connect(self.b4_)
|
||||
self.b3 = self.findChild("b3") # Find Button 3
|
||||
self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_
|
||||
|
||||
self.b5 = self.findChild("b5")
|
||||
self.b5.clicked.connect(self.b5_)
|
||||
self.b4 = self.findChild("b4") # Find Button 4
|
||||
self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_
|
||||
|
||||
self.b6 = self.findChild("b6")
|
||||
self.b6.clicked.connect(self.b6_)
|
||||
self.b5 = self.findChild("b5") # Find Button 5
|
||||
self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_
|
||||
|
||||
self.b7 = self.findChild("b7")
|
||||
self.b7.clicked.connect(self.b7_)
|
||||
self.b6 = self.findChild("b6") # Find Button 6
|
||||
self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_
|
||||
|
||||
self.b8 = self.findChild("b8")
|
||||
self.b8.clicked.connect(self.b8_)
|
||||
self.b7 = self.findChild("b7") # Find Button 7
|
||||
self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_
|
||||
|
||||
self.install = self.findChild('install')
|
||||
self.install.clicked.connect(self.install_)
|
||||
self.b8 = self.findChild("b8") # Find Button 8
|
||||
self.b8.clicked.connect(self.b8_) # Action: Connect Button 8 action to b8_
|
||||
|
||||
self.install = self.findChild('install') # Find Install Button
|
||||
self.install.clicked.connect(self.install_) # Action: Connect to install_ function
|
||||
|
||||
|
||||
# Start Qt Qui Application loop
|
||||
app = QGuiApplication([])
|
||||
|
||||
# Set Qt Window Icon
|
||||
app.setWindowIcon(QIcon(":/ParchLogo.svg"))
|
||||
|
||||
# Loading Main Class
|
||||
m = Main()
|
||||
|
||||
# Set loop exec
|
||||
app.exec()
|
|
@ -1,23 +1,32 @@
|
|||
# Import I/O
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Import PyQt6 Framework libraries
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
from PyQt6.QtQml import *
|
||||
|
||||
# Import Resources of Qt
|
||||
import Res
|
||||
|
||||
# Simple Qt Quick class for loading QML files
|
||||
|
||||
class Quick(QQmlApplicationEngine):
|
||||
|
||||
# DO: Set property of object
|
||||
def setProperty(self, name, value):
|
||||
self.rootObjects()[0].setProperty(name, value)
|
||||
|
||||
# DO: Get property of object
|
||||
def property(self, name):
|
||||
return self.rootObjects()[0].property(name)
|
||||
|
||||
# DO: find a object
|
||||
def findChild(self, name, **kwargs):
|
||||
return self.rootObjects()[0].findChild(QObject, name)
|
||||
|
||||
# DO: Close the loader
|
||||
def close(self):
|
||||
self.rootObjects()[0].close()
|
||||
|
||||
|
@ -25,79 +34,95 @@ class Quick(QQmlApplicationEngine):
|
|||
super(Quick, self).__init__()
|
||||
|
||||
|
||||
# Main Class of Parch Welcome Project
|
||||
class Main(Quick):
|
||||
browser = "xdg-open"
|
||||
|
||||
# DO: Button 1 loading link: https://github.com/parchlinux
|
||||
def b1_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://github.com/parchlinux', shell=True)
|
||||
self.link("https://github.com/parchlinux")
|
||||
|
||||
# DO: Button 2 loading link: https://twitter.com/bssfoss
|
||||
def b2_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://twitter.com/bssfoss', shell=True)
|
||||
self.link("https://twitter.com/bssfoss")
|
||||
|
||||
# DO: Button 3 loading link: https://t.me/parchlinux
|
||||
def b3_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://t.me/parchlinux', shell=True)
|
||||
self.link("https://t.me/parchlinux")
|
||||
|
||||
# DO: Button 4 loading link: https://discord.gg/9RW5cRByAM
|
||||
def b4_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://discord.gg/9RW5cRByAM', shell=True)
|
||||
self.link("https://discord.gg/9RW5cRByAM")
|
||||
|
||||
# DO: Button 5 loading link: https://mas.to/@bssfoss
|
||||
def b5_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://mas.to/@bssfoss', shell=True)
|
||||
self.link("https://mas.to/@bssfoss")
|
||||
|
||||
# DO: Button 6 loading link: https://coffeete.ir/parchlinux
|
||||
def b6_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://coffeete.ir/parchlinux', shell=True)
|
||||
self.link("https://coffeete.ir/parchlinux")
|
||||
|
||||
# DO: Button 7 loading link: https://parchlinux.ir
|
||||
def b7_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://parchlinux.ir', shell=True)
|
||||
self.link("https://parchlinux.ir")
|
||||
|
||||
# DO: Button 8 loading link: https://parchlinux.ir/parchwiki/
|
||||
def b8_(self):
|
||||
self.close()
|
||||
subprocess.call(f'{self.browser} https://parchlinux.ir/parchwiki/', shell=True)
|
||||
self.link("https://parchlinux.ir/parchwiki/")
|
||||
|
||||
# DO: Run Calamares Installer
|
||||
def install_(self):
|
||||
self.close()
|
||||
subprocess.call('sudo sh /etc/calamares/launch.sh',shell=True)
|
||||
subprocess.run('sudo sh /etc/calamares/launch.sh',shell=True)
|
||||
|
||||
# DO: Loading link in `xdg-open` function
|
||||
def link(self,url):
|
||||
self.close()
|
||||
subprocess.run(f'xdg-open {url}',shell=True)
|
||||
|
||||
# DO: Init Function
|
||||
def __init__(self):
|
||||
super(Main, self).__init__()
|
||||
|
||||
# Load Main QML file
|
||||
self.load(":/ParchLinux.qml")
|
||||
|
||||
self.b1 = self.findChild("b1")
|
||||
self.b1.clicked.connect(self.b1_)
|
||||
|
||||
self.b2 = self.findChild("b2")
|
||||
self.b2.clicked.connect(self.b2_)
|
||||
self.b1 = self.findChild("b1") # Find Button 1
|
||||
self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_
|
||||
|
||||
self.b3 = self.findChild("b3")
|
||||
self.b3.clicked.connect(self.b3_)
|
||||
self.b2 = self.findChild("b2") # Find Button 2
|
||||
self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_
|
||||
|
||||
self.b4 = self.findChild("b4")
|
||||
self.b4.clicked.connect(self.b4_)
|
||||
self.b3 = self.findChild("b3") # Find Button 3
|
||||
self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_
|
||||
|
||||
self.b5 = self.findChild("b5")
|
||||
self.b5.clicked.connect(self.b5_)
|
||||
self.b4 = self.findChild("b4") # Find Button 4
|
||||
self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_
|
||||
|
||||
self.b6 = self.findChild("b6")
|
||||
self.b6.clicked.connect(self.b6_)
|
||||
self.b5 = self.findChild("b5") # Find Button 5
|
||||
self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_
|
||||
|
||||
self.b7 = self.findChild("b7")
|
||||
self.b7.clicked.connect(self.b7_)
|
||||
self.b6 = self.findChild("b6") # Find Button 6
|
||||
self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_
|
||||
|
||||
self.b8 = self.findChild("b8")
|
||||
self.b8.clicked.connect(self.b8_)
|
||||
self.b7 = self.findChild("b7") # Find Button 7
|
||||
self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_
|
||||
|
||||
self.install = self.findChild('install')
|
||||
self.install.clicked.connect(self.install_)
|
||||
self.b8 = self.findChild("b8") # Find Button 8
|
||||
self.b8.clicked.connect(self.b8_) # Action: Connect Button 8 action to b8_
|
||||
|
||||
self.install = self.findChild('install') # Find Install Button
|
||||
self.install.clicked.connect(self.install_) # Action: Connect to install_ function
|
||||
|
||||
|
||||
# Start Qt Qui Application loop
|
||||
app = QGuiApplication([])
|
||||
|
||||
# Set Qt Window Icon
|
||||
app.setWindowIcon(QIcon(":/ParchLogo.svg"))
|
||||
|
||||
# Loading Main Class
|
||||
m = Main()
|
||||
|
||||
# Set loop exec
|
||||
app.exec()
|
Loading…
Add table
Reference in a new issue