diff --git a/.gitignore b/.gitignore index 94242ab..a07d033 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,54 @@ -venv -.idea -__pycache__ -*.tar.* \ No newline at end of file +# C++ objects and libs +*.slo +*.lo +*.o +*.a +*.la +*.lai +*.so +*.so.* +*.dll +*.dylib + +# Qt-es +object_script.*.Release +object_script.*.Debug +*_plugin_import.cpp +/.qmake.cache +/.qmake.stash +*.pro.user +*.pro.user.* +*.qbs.user +*.qbs.user.* +*.moc +moc_*.cpp +moc_*.h +qrc_*.cpp +ui_*.h +*.qmlc +*.jsc +Makefile* +*build-* +*.qm +*.prl + +# Qt unit tests +target_wrapper.* + +# QtCreator +*.autosave + +# QtCreator Qml +*.qmlproject.user +*.qmlproject.user.* + +# QtCreator CMake +CMakeLists.txt.user* + +# QtCreator 4.8< compilation database +compile_commands.json + +# QtCreator local machine-specific files for imported projects +*creator.user* + +*_qmlcache.qrc diff --git a/Build.py b/Build.py deleted file mode 100644 index c66b859..0000000 --- a/Build.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -import os,subprocess - -# Jump to Src -os.chdir("src/") - -# Create Qrc file -listrc = os.listdir('UI') -listrc.remove('res.qrc') -f = open('UI/res.qrc', 'w') -f.write("""""") -for i in listrc: - f.write(f"{i}") -f.write("""""") -f.close() - -# Compile Qrc & Create onefile script & Build Parch Package -subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && cp Welcome ../build/parch-welcome/usr/bin/ && cd ../build && chmod +x parch-welcome/usr/bin/* && tar -czvf parch-welcome.tar.gz parch-welcome/ && makepkg -f && cd .. && rm -rf build/pkg build/src build/*.tar.gz && rm -rf src/Welcome""",shell=True) \ No newline at end of file diff --git a/Debug.py b/Debug.py deleted file mode 100644 index 598dcac..0000000 --- a/Debug.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -import os,subprocess - -# Jump to Src -os.chdir("src") - -# Create Qrc file -listrc = os.listdir('UI') -listrc.remove('res.qrc') -f = open('UI/res.qrc', 'w') -f.write("""""") -for i in listrc: - f.write(f"{i}") -f.write("""""") -f.close() - -# Compile Qrc & Create onefile script & run it -subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && ./Welcome && rm Welcome""",shell=True) \ No newline at end of file diff --git a/README.md b/README.md index f31a3c9..a858777 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,18 @@ Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Gre - Showing Parch Linux pages on social media - Running the installer program - Updating Parch repositories -This program is still on alpha stages and it is not completely ready to use. +This program is still on beta stages and it is semi complete and ready to use. -## Build Parch Package -for building **Parch Package** from **Welcome** project you should run: +## Build the package on Arch machines +- For building this package run: ```shell -python Build.py +cd build/ +makepkg -f ``` -## Debug & Run from Source -if you want to run project without installing, you should run: +### Install the package +- For installing this pacakge run: ```shell -python Debug.py -``` \ No newline at end of file +cd build/ +sudo pacman -U ./parch-welcome* +``` diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..73e070b --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!PKGBUILD \ No newline at end of file diff --git a/build/PKGBUILD b/build/PKGBUILD index 96d9fb8..4e8a84c 100644 --- a/build/PKGBUILD +++ b/build/PKGBUILD @@ -1,20 +1,50 @@ pkgname=parch-welcome -destname="/" -pkgver=1 -pkgrel=0 -pkgdesc='Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Greetings", is a welcome app in the Parch distribution.' arch=('x86_64') -url="https://parchlinux.ir" +pkgver=1.0.0 +pkgrel=1 +pkgdesc='Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Greetings", is a welcome app in the Parch distribution.' +url="https://github.com/parchlinux/${pkgname}" license=('GPL') -makedepends=() -depends=("python-pyqt6") -optdepends=() -conflicts=() +makedepends=("git") +depends=("qt6-base" "qt6-declarative" "base-devel") +conflicts=("${pkgname}") provides=("${pkgname}") -options=(!strip !emptydirs) -source=("${pkgname}.tar.gz") -sha256sums=('SKIP') -package() { - install -dm755 ${pkgdir}${destname} - cp -r ${srcdir}/${pkgname}${destname}/* ${pkgdir}${destname} +source=("${pkgname}::git+${url}") +#source=("${pkgname}.tar.gz") +md5sums=('SKIP') +build(){ + _workdir="${srcdir}/${pkgname}/" + mkdir ${_workdir}/bin + cd ${_workdir}/bin + qmake6 .. + make -j$(nproc) + cp ./parch-welcome ../ +} + +pkgver() { + cd "${srcdir}/${pkgname}" + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + + +package() { + + # copy license + install -d "${pkgdir}/usr/share/licenses/${pkgname}" + install -m644 "${srcdir}/${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + #copy logo + install -Dm644 "${srcdir}/${pkgname}/resources/logo.png" "${pkgdir}/usr/share/icons/${pkgname}.png" + + # copy welcome binfile into /bin + install -Dm755 "${srcdir}/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + + # copy autostart desktop file into autostart dir + install -Dm644 "${srcdir}/${pkgname}/resources/autostart.desktop" "${pkgdir}/etc/xdg/autostart/${pkgname}.desktop" + + # copy appliction desktop file into autostart dir + install -Dm644 "${srcdir}/${pkgname}/resources/application.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop" } diff --git a/build/parch-welcome/usr/bin/Welcome b/build/parch-welcome/usr/bin/Welcome deleted file mode 100755 index eee7240..0000000 --- a/build/parch-welcome/usr/bin/Welcome +++ /dev/null @@ -1,1329 +0,0 @@ -#!/usr/bin/python -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 5.15.10 -# WARNING! All changes made in this file will be lost! - -from PyQt6 import QtCore - -qt_resource_data = b"\ -\x00\x00\x05\x0e\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ -\x00\x00\x01@\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-x\ --lg\x22 viewBox=\x220 \ -0 16 16\x22>\x0a \x0a\ -\x00\x00\x02y\ -\x00\ -\x00\x09^x\x9c\xed\x96\xcfn\x1aA\x0c\xc6\xef}\x8a\ -\xd1\xde\xc7\x8c\xed\xf9[\x01\x12\xed\xa5\x97\xbc\x00\xb7\x15\ -\xa1!\xd2\x12\x22B \x8f_{vH\xdaFM\x0e\ -\x91\xa2D*0\xdf.\xd8\xeb\xb1\x7f\xfb!\x98\xde\x1d\ -\xaf\xcc\xc3v\xb8\xb9\x9bu\x9b\xc3\xe1\xf6\xebdr:\ -\x9d\xe0\xc4\xb0\xdb_M\xc897\x91\x8c\xce\xfc\xbc\x1e\ -\x86Y\xb7\xba\xdf\xef\xd77\x87\xef\xbba\xb7\xef\xccj\ -\xe8\xef\xe4\xb2\x93\x8dfccg\x8e\xd7\xeb\xd3\xb7\xdd\ -\xc3\xacs\xc6\x19\x8c\xf2\xea\xe6_\xcc?\x1e\xd3\xdb\xfe\ -\xb0\xa9e\xed\xfe~X\xcf\xba\xf5q}\xb3\xbb\xbc\xec\ -\xcc\xe5\xac\xbb\x80`b\x0fA\x0eZ\xcbY\xf09C\ -ty@\x88\x81L\x02\xcf~A\x12\xa6s\x8a\xf1\x80\ -\xce\xcb\x9e\x9b\x00\xa9P\xffg\x90\xc0{\x8bPB\x1e\ -\x00\x19-\x84\xd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h\xfahDz4by\xdd\x88\xe5#\x1a\ -\xb1\xbc\xc5\x88\xe5\xfd\x8c\x88\xae:\xf1\xe5\x1f\xf1\xa9\xfe\ -m\x9a\xff\x025\x8d\xde4\ -\x00\x00\x02\xd4\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-g\ -lobe-americas\x22 v\ -iewBox=\x220 0 16 1\ -6\x22>\x0a \x0a\ -\x00\x00\x017\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 class=\x22h-\ -5 w-5 ml-2\x22 fill\ -=\x22none\x22 viewBox=\ -\x220 0 24 24\x22 stro\ -ke=\x22currentColor\ -\x22 stroke-width=\x22\ -2\x22>\x0a \ - \x0a \ - \ -\ -\x00\x00\x03\x0f\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-b\ -ook\x22 viewBox=\x220 \ -0 16 16\x22>\x0a \x0a\ -\x00\x00#f\ -<\ -?xml version=\x221.\ -0\x22 encoding=\x22UTF\ --8\x22 standalone=\x22\ -no\x22?>\x0a\x0a\ -\x0a\x0a \x0a \ - \x0a <\ -/sodipodi:namedv\ -iew>\x0a \x0a\ - \x0a \x0a \ -\x0a \x0a \x0a \ -\x0a \x0a \x0a \x0a \x0a \x0a \x0a \ - \x0a \ -\x0a \x0a \ - \x0a \x0a \ -\x0a \x0a \x0a \ -\ -\x0a \x0a \x0a \x0a \x0a \x0a \x0a \x0a <\ -path\x0a st\ -yle=\x22fill:url(#l\ -inearGradient736\ -6);fill-opacity:\ -1;stroke:none;st\ -roke-width:0;str\ -oke-linecap:roun\ -d;stroke-linejoi\ -n:round;stroke-d\ -asharray:none\x22\x0a \ - d=\x22m 907\ -.42424,1616.2488\ - c -24.0017,-2.3\ -297 -52.02635,-1\ -2.6231 -78.85555\ -,-28.9638 -19.10\ -68,-11.6372 -38.\ -2733,-27.4597 -5\ -8.392,-48.2042 -\ -18.2162,-18.7831\ - -32.4842,-36.73\ -42 -49.1463,-61.\ -8328 -11.964,-18\ -.022 256.84077,-\ -146.9291 265.909\ -07,-151.2971 5.5\ -59,-2.6776 9.794\ -8,3.391 77.01334\ -,-7.6092 23.5832\ -,-3.8593 47.0328\ -,-7.1016 52.1103\ -,-7.2049 11.0834\ -,-0.2258 10.575,\ --0.8697 14.9478,\ -18.9334 9.5134,4\ -3.0829 11.2104,1\ -05.2552 3.6828,1\ -34.9296 -12.2746\ -,48.3882 -47.214\ -3,95.0359 -92.23\ -01,123.1357 -17.\ -1131,10.6824 -40\ -.2247,20.473 -58\ -.20424,24.6566 -\ -18.5624,4.3192 -\ -52.3089,5.8373 -\ -76.83512,3.4567 \ -z\x22\x0a id=\x22\ -path3231\x22\x0a \ - sodipodi:node\ -types=\x22sssssssss\ -sss\x22 />\x0a \x0a \x0a \ - \x0a \ -\x0a \ - \x0a \x0a\x0a\ -\x00\x00\x03\x19\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ - \ -\x00\x00\x03n\ -\x00\ -\x00\x13\xe9x\x9c\xddX\xdfo\xda0\x10~\xcf_a\ -\xd1\x87n\x12\xcd\x02\xa5\xacE]\xa5\x8eiZ\xa5n\ -Z\xb7N{v\x12\x93x56\xb2\x9dB;\xf1\xbf\ -\xef\xf2\xc3)\x10'\xa4S\x11\xd3\xee\x01\xe1\xf3q\xfe\ -\xee\xbe\xb3\xcf\x86NgBjt\xa3o\x12\x1a\xdc9\ -tm\xe8\x8e\x05\xd7R0U\xa7w?cM$\xc5\ -\xccq.g3F\x03\xac\xa9\xe0?)\x0f\xc5\x1c\xfd\ -v\x10\xc8\x9c\x86:\x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08\ -?\xcawH\x17]\x82\xf5\x91\x8f\x15\x09\xf3\xdf\xa0\x90\ -\x825\xf5\x93\xf4H\xef>\x9b\xd8{\x225\xf4\x03v\ -\xc9h\xc4\xa7\x10\xe6(\x0b\xc6\xcd\xc6\x16\x06R\xb1\x15\ -\x03\x80\x81Tn/\x89\xde`\xa7%QC\xc4\x96$\ -\x14<\xe9\x18kh_\x14R\xab\x05\xf2\x09\x9aI\xa2\ -\xf5C\x17\x11\xac\x1eRU\xa2\x80\x00\x96\x06\xdaE\x13\ -\xac4@\x0f\x91\xd2\x18\xfa\x9e\xfb\xdf\xa7\xf6\x9f\xd9l\ -\xcd\xed\xfc\xefBMeG\xbd;\xa2:N\xfc\x86\xee\ -\xed\xff\x82\xcc~\x81[\x15\x18\xfb\xbd\xaaQ\xb5/\xef\ -\x08\xa9\x9e\xb7E\xd9\xdf'J\xb8}\xb6\xc5y\xbcG\ -\x9cp.\x07B\x86m\xa1\x0e\xf6\x08u\x0agY\xcd\ -\x85\xab\x0a\xf4d\x8f@\x03\x0a\ - \ - \x0a \ - \ - \ -\x00\x00\x02\xe0\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ -\x00\x00\x02\x93\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \ -\x0a \ - \ -" - -qt_resource_name = b"\ -\x00\x0b\ -\x06QI\x87\ -\x00d\ -\x00i\x00s\x00c\x00o\x00r\x00d\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x04*U\xa7\ -\x00x\ -\x00-\x00l\x00g\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x07\xc8W\xe7\ -\x00c\ -\x00a\x00f\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ -\x00_)\x87\ -\x00w\ -\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ -\x08\xcf\xef\x87\ -\x00i\ -\x00n\x00s\x00t\x00a\x00l\x00l\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x06^W\xe7\ -\x00b\ -\x00o\x00o\x00k\x00.\x00s\x00v\x00g\ -\x00\x0d\ -\x08\xf3a\xe7\ -\x00P\ -\x00a\x00r\x00c\x00h\x00L\x00o\x00g\x00o\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x0c(U\x87\ -\x00t\ -\x00e\x00l\x00e\x00.\x00s\x00v\x00g\ -\x00\x0e\ -\x04\xd8\xe8\x9c\ -\x00P\ -\x00a\x00r\x00c\x00h\x00L\x00i\x00n\x00u\x00x\x00.\x00q\x00m\x00l\ -\x00\x09\ -\x0a\xb2\xbd\xc7\ -\x00m\ -\x00a\x00s\x00t\x00o\x00.\x00s\x00v\x00g\ -\x00\x0a\ -\x0f\xb8\x9b\x87\ -\x00g\ -\x00i\x00t\x00h\x00u\x00b\x00.\x00s\x00v\x00g\ -\x00\x06\ -\x07\xbaZ\xc7\ -\x00t\ -\x00w\x00.\x00s\x00v\x00g\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x05\x12\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xcc\x00\x01\x00\x00\x00\x01\x00\x006\x80\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x0c\xe6\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x01 \x00\x00\x00\x00\x00\x01\x00\x00@\xc2\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x002\x00\x01\x00\x00\x00\x01\x00\x00\x06V\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0b\xab\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xf9\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xee\x00\x00\x00\x00\x00\x01\x00\x009\xf2\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x003c\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00=\xde\ -\x00\x00\x01\x89\xf8\x14s,\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() -# 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() - - def __init__(self): - super(Quick, self).__init__() - - -# Main Class of Parch Welcome Project -class Main(Quick): - - # DO: Button 1 loading link: https://github.com/parchlinux - def b1_(self): - self.link("https://github.com/parchlinux") - - # DO: Button 2 loading link: https://twitter.com/bssfoss - def b2_(self): - self.link("https://twitter.com/bssfoss") - - # DO: Button 3 loading link: https://t.me/parchlinux - def b3_(self): - self.link("https://t.me/parchlinux") - - # DO: Button 4 loading link: https://discord.gg/9RW5cRByAM - def b4_(self): - self.link("https://discord.gg/9RW5cRByAM") - - # DO: Button 5 loading link: https://mas.to/@bssfoss - def b5_(self): - self.link("https://mas.to/@bssfoss") - - # DO: Button 6 loading link: https://coffeete.ir/parchlinux - def b6_(self): - self.link("https://coffeete.ir/parchlinux") - - # DO: Button 7 loading link: https://parchlinux.ir - def b7_(self): - self.link("https://parchlinux.ir") - - # DO: Button 8 loading link: https://parchlinux.ir/parchwiki/ - def b8_(self): - self.link("https://parchlinux.ir/parchwiki/") - - # DO: Run Calamares Installer - def install_(self): - self.close() - 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") # Find Button 1 - self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_ - - self.b2 = self.findChild("b2") # Find Button 2 - self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_ - - self.b3 = self.findChild("b3") # Find Button 3 - self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_ - - self.b4 = self.findChild("b4") # Find Button 4 - self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_ - - self.b5 = self.findChild("b5") # Find Button 5 - self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_ - - self.b6 = self.findChild("b6") # Find Button 6 - self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_ - - self.b7 = self.findChild("b7") # Find Button 7 - self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_ - - 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() \ No newline at end of file diff --git a/parch-welcome.pro b/parch-welcome.pro new file mode 100644 index 0000000..38f3a76 --- /dev/null +++ b/parch-welcome.pro @@ -0,0 +1,11 @@ +QT += core widgets gui qml quickcontrols2 + +CONFIG += release +TARGET = parch-welcome +TEMPLATE = app + +SOURCES += src/main.cpp src/processhandler.cpp + +HEADERS += src/processhandler.h + +RESOURCES += src/assets/res.qrc diff --git a/build/parch-welcome/usr/share/applications/welcome.desktop b/resources/application.desktop similarity index 60% rename from build/parch-welcome/usr/share/applications/welcome.desktop rename to resources/application.desktop index 0e50f13..2e11b0d 100644 --- a/build/parch-welcome/usr/share/applications/welcome.desktop +++ b/resources/application.desktop @@ -2,7 +2,7 @@ [Desktop Entry] Name=Welcome Name[ir]=درود -Exec=/usr/bin/Welcome +Exec=/usr/bin/parch-welcome Terminal=false Type=Application -Icon=/usr/share/icons/ParchLogo.png +Icon=/usr/share/icons/parch-welcome.png diff --git a/build/parch-welcome/etc/xdg/autostart/welcome.desktop b/resources/autostart.desktop similarity index 60% rename from build/parch-welcome/etc/xdg/autostart/welcome.desktop rename to resources/autostart.desktop index 0e50f13..2e11b0d 100644 --- a/build/parch-welcome/etc/xdg/autostart/welcome.desktop +++ b/resources/autostart.desktop @@ -2,7 +2,7 @@ [Desktop Entry] Name=Welcome Name[ir]=درود -Exec=/usr/bin/Welcome +Exec=/usr/bin/parch-welcome Terminal=false Type=Application -Icon=/usr/share/icons/ParchLogo.png +Icon=/usr/share/icons/parch-welcome.png diff --git a/build/parch-welcome/usr/share/icons/ParchLogo.png b/resources/logo.png similarity index 100% rename from build/parch-welcome/usr/share/icons/ParchLogo.png rename to resources/logo.png diff --git a/src/Res.py b/src/Res.py deleted file mode 100644 index 1d35d30..0000000 --- a/src/Res.py +++ /dev/null @@ -1,1200 +0,0 @@ -# Resource object code (Python 3) -# Created by: object code -# Created by: The Resource Compiler for Qt version 5.15.10 -# WARNING! All changes made in this file will be lost! - -from PyQt6 import QtCore - -qt_resource_data = b"\ -\x00\x00\x05\x0e\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ -\x00\x00\x01@\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-x\ --lg\x22 viewBox=\x220 \ -0 16 16\x22>\x0a \x0a\ -\x00\x00\x02y\ -\x00\ -\x00\x09^x\x9c\xed\x96\xcfn\x1aA\x0c\xc6\xef}\x8a\ -\xd1\xde\xc7\x8c\xed\xf9[\x01\x12\xed\xa5\x97\xbc\x00\xb7\x15\ -\xa1!\xd2\x12\x22B \x8f_{vH\xdaFM\x0e\ -\x91\xa2D*0\xdf.\xd8\xeb\xb1\x7f\xfb!\x98\xde\x1d\ -\xaf\xcc\xc3v\xb8\xb9\x9bu\x9b\xc3\xe1\xf6\xebdr:\ -\x9d\xe0\xc4\xb0\xdb_M\xc897\x91\x8c\xce\xfc\xbc\x1e\ -\x86Y\xb7\xba\xdf\xef\xd77\x87\xef\xbba\xb7\xef\xccj\ -\xe8\xef\xe4\xb2\x93\x8dfccg\x8e\xd7\xeb\xd3\xb7\xdd\ -\xc3\xacs\xc6\x19\x8c\xf2\xea\xe6_\xcc?\x1e\xd3\xdb\xfe\ -\xb0\xa9e\xed\xfe~X\xcf\xba\xf5q}\xb3\xbb\xbc\xec\ -\xcc\xe5\xac\xbb\x80`b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xb8\xdcr\x9d\xe6\xbf\x0d\xdf\ -`\xc3\xf8\x11m\x18\xdfb\xc3\xf8~6L/\xdb\xd0\ -%\xb5\xa1\xea3\x1brj\xfa\xb9l\x88%\x9bQ\x9f\ -\x19\x91sh\xfahDz4by\xdd\x88\xe5#\x1a\ -\xb1\xbc\xc5\x88\xe5\xfd\x8c\x88\xae:\xf1\xe5\x1f\xf1\xa9\xfe\ -m\x9a\xff\x025\x8d\xde4\ -\x00\x00\x02\xd4\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-g\ -lobe-americas\x22 v\ -iewBox=\x220 0 16 1\ -6\x22>\x0a \x0a\ -\x00\x00\x017\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 class=\x22h-\ -5 w-5 ml-2\x22 fill\ -=\x22none\x22 viewBox=\ -\x220 0 24 24\x22 stro\ -ke=\x22currentColor\ -\x22 stroke-width=\x22\ -2\x22>\x0a \ - \x0a \ - \ -\ -\x00\x00\x03\x0f\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 width=\x2216\ -\x22 height=\x2216\x22 fi\ -ll=\x22currentColor\ -\x22 class=\x22bi bi-b\ -ook\x22 viewBox=\x220 \ -0 16 16\x22>\x0a \x0a\ -\x00\x00#f\ -<\ -?xml version=\x221.\ -0\x22 encoding=\x22UTF\ --8\x22 standalone=\x22\ -no\x22?>\x0a\x0a\ -\x0a\x0a \x0a \ - \x0a <\ -/sodipodi:namedv\ -iew>\x0a \x0a\ - \x0a \x0a \ -\x0a \x0a \x0a \ -\x0a \x0a \x0a \x0a \x0a \x0a \x0a \ - \x0a \ -\x0a \x0a \ - \x0a \x0a \ -\x0a \x0a \x0a \ -\ -\x0a \x0a \x0a \x0a \x0a \x0a \x0a \x0a <\ -path\x0a st\ -yle=\x22fill:url(#l\ -inearGradient736\ -6);fill-opacity:\ -1;stroke:none;st\ -roke-width:0;str\ -oke-linecap:roun\ -d;stroke-linejoi\ -n:round;stroke-d\ -asharray:none\x22\x0a \ - d=\x22m 907\ -.42424,1616.2488\ - c -24.0017,-2.3\ -297 -52.02635,-1\ -2.6231 -78.85555\ -,-28.9638 -19.10\ -68,-11.6372 -38.\ -2733,-27.4597 -5\ -8.392,-48.2042 -\ -18.2162,-18.7831\ - -32.4842,-36.73\ -42 -49.1463,-61.\ -8328 -11.964,-18\ -.022 256.84077,-\ -146.9291 265.909\ -07,-151.2971 5.5\ -59,-2.6776 9.794\ -8,3.391 77.01334\ -,-7.6092 23.5832\ -,-3.8593 47.0328\ -,-7.1016 52.1103\ -,-7.2049 11.0834\ -,-0.2258 10.575,\ --0.8697 14.9478,\ -18.9334 9.5134,4\ -3.0829 11.2104,1\ -05.2552 3.6828,1\ -34.9296 -12.2746\ -,48.3882 -47.214\ -3,95.0359 -92.23\ -01,123.1357 -17.\ -1131,10.6824 -40\ -.2247,20.473 -58\ -.20424,24.6566 -\ -18.5624,4.3192 -\ -52.3089,5.8373 -\ -76.83512,3.4567 \ -z\x22\x0a id=\x22\ -path3231\x22\x0a \ - sodipodi:node\ -types=\x22sssssssss\ -sss\x22 />\x0a \x0a \x0a \ - \x0a \ -\x0a \ - \x0a \x0a\x0a\ -\x00\x00\x03\x19\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ - \ -\x00\x00\x03n\ -\x00\ -\x00\x13\xe9x\x9c\xddX\xdfo\xda0\x10~\xcf_a\ -\xd1\x87n\x12\xcd\x02\xa5\xacE]\xa5\x8eiZ\xa5n\ -Z\xb7N{v\x12\x93x56\xb2\x9dB;\xf1\xbf\ -\xef\xf2\xc3)\x10'\xa4S\x11\xd3\xee\x01\xe1\xf3q\xfe\ -\xee\xbe\xb3\xc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2\xbe\xd3G`\xf3\xd8\xdb)\x13/FE\xb5\ -`v\xc2\xc4y\x9a\x9f\xdc\xf5\xbb\xc3\x83c\xff\xb4?\ -\x19\x1e\xae\xf3\x93Z\x5c\x944!\xaa aH\xcc\x08\ -?\xcawH\x17]\x82\xf5\x91\x8f\x15\x09\xf3\xdf\xa0\x90\ -\x825\xf5\x93\xf4H\xef>\x9b\xd8{\x225\xf4\x03v\ -\xc9h\xc4\xa7\x10\xe6(\x0b\xc6\xcd\xc6\x16\x06R\xb1\x15\ -\x03\x80\x81Tn/\x89\xde`\xa7%QC\xc4\x96$\ -\x14<\xe9\x18kh_\x14R\xab\x05\xf2\x09\x9aI\xa2\ -\xf5C\x17\x11\xac\x1eRU\xa2\x80\x00\x96\x06\xdaE\x13\ -\xac4@\x0f\x91\xd2\x18\xfa\x9e\xfb\xdf\xa7\xf6\x9f\xd9l\ -\xcd\xed\xfc\xefBMeG\xbd;\xa2:N\xfc\x86\xee\ -\xed\xff\x82\xcc~\x81[\x15\x18\xfb\xbd\xaaQ\xb5/\xef\ -\x08\xa9\x9e\xb7E\xd9\xdf'J\xb8}\xb6\xc5y\xbcG\ -\x9cp.\x07B\x86m\xa1\x0e\xf6\x08u\x0agY\xcd\ -\x85\xab\x0a\xf4d\x8f@\x03\x0a\ - \ - \x0a \ - \ - \ -\x00\x00\x02\xe0\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \x0a \ - \ -\x00\x00\x02\x93\ -<\ -svg class=\x22w-6 h\ --6\x22 xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 fill=\x22cur\ -rentColor\x22 viewB\ -ox=\x220 0 16 16\x22>\x0a\ - \ - \ -\x0a \ - \ -" - -qt_resource_name = b"\ -\x00\x0b\ -\x06QI\x87\ -\x00d\ -\x00i\x00s\x00c\x00o\x00r\x00d\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x04*U\xa7\ -\x00x\ -\x00-\x00l\x00g\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x07\xc8W\xe7\ -\x00c\ -\x00a\x00f\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ -\x00_)\x87\ -\x00w\ -\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ -\x08\xcf\xef\x87\ -\x00i\ -\x00n\x00s\x00t\x00a\x00l\x00l\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x06^W\xe7\ -\x00b\ -\x00o\x00o\x00k\x00.\x00s\x00v\x00g\ -\x00\x0d\ -\x08\xf3a\xe7\ -\x00P\ -\x00a\x00r\x00c\x00h\x00L\x00o\x00g\x00o\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x0c(U\x87\ -\x00t\ -\x00e\x00l\x00e\x00.\x00s\x00v\x00g\ -\x00\x0e\ -\x04\xd8\xe8\x9c\ -\x00P\ -\x00a\x00r\x00c\x00h\x00L\x00i\x00n\x00u\x00x\x00.\x00q\x00m\x00l\ -\x00\x09\ -\x0a\xb2\xbd\xc7\ -\x00m\ -\x00a\x00s\x00t\x00o\x00.\x00s\x00v\x00g\ -\x00\x0a\ -\x0f\xb8\x9b\x87\ -\x00g\ -\x00i\x00t\x00h\x00u\x00b\x00.\x00s\x00v\x00g\ -\x00\x06\ -\x07\xbaZ\xc7\ -\x00t\ -\x00w\x00.\x00s\x00v\x00g\ -" - -qt_resource_struct = b"\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x05\x12\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xcc\x00\x01\x00\x00\x00\x01\x00\x006\x80\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x0c\xe6\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x01 \x00\x00\x00\x00\x00\x01\x00\x00@\xc2\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x002\x00\x01\x00\x00\x00\x01\x00\x00\x06V\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0b\xab\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xf9\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xee\x00\x00\x00\x00\x00\x01\x00\x009\xf2\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x003c\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00=\xde\ -\x00\x00\x01\x89\xf8\x14s,\ -" - -def qInitResources(): - QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -def qCleanupResources(): - QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) - -qInitResources() diff --git a/src/UI/res.qrc b/src/UI/res.qrc deleted file mode 100644 index be3b626..0000000 --- a/src/UI/res.qrc +++ /dev/null @@ -1 +0,0 @@ -website.svginstall.svgbook.svgmasto.svgx-lg.svgtele.svgParchLogo.svggithub.svgdiscord.svgParchLinux.qmlcafe.svgtw.svg \ No newline at end of file diff --git a/src/Welcome.py b/src/Welcome.py deleted file mode 100644 index a32d685..0000000 --- a/src/Welcome.py +++ /dev/null @@ -1,128 +0,0 @@ -# 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() - - def __init__(self): - super(Quick, self).__init__() - - -# Main Class of Parch Welcome Project -class Main(Quick): - - # DO: Button 1 loading link: https://github.com/parchlinux - def b1_(self): - self.link("https://github.com/parchlinux") - - # DO: Button 2 loading link: https://twitter.com/bssfoss - def b2_(self): - self.link("https://twitter.com/bssfoss") - - # DO: Button 3 loading link: https://t.me/parchlinux - def b3_(self): - self.link("https://t.me/parchlinux") - - # DO: Button 4 loading link: https://discord.gg/9RW5cRByAM - def b4_(self): - self.link("https://discord.gg/9RW5cRByAM") - - # DO: Button 5 loading link: https://mas.to/@bssfoss - def b5_(self): - self.link("https://mas.to/@bssfoss") - - # DO: Button 6 loading link: https://coffeete.ir/parchlinux - def b6_(self): - self.link("https://coffeete.ir/parchlinux") - - # DO: Button 7 loading link: https://parchlinux.ir - def b7_(self): - self.link("https://parchlinux.ir") - - # DO: Button 8 loading link: https://parchlinux.ir/parchwiki/ - def b8_(self): - self.link("https://parchlinux.ir/parchwiki/") - - # DO: Run Calamares Installer - def install_(self): - self.close() - 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") # Find Button 1 - self.b1.clicked.connect(self.b1_) # Action: Connect Button 1 action to b1_ - - self.b2 = self.findChild("b2") # Find Button 2 - self.b2.clicked.connect(self.b2_) # Action: Connect Button 2 action to b2_ - - self.b3 = self.findChild("b3") # Find Button 3 - self.b3.clicked.connect(self.b3_) # Action: Connect Button 3 action to b3_ - - self.b4 = self.findChild("b4") # Find Button 4 - self.b4.clicked.connect(self.b4_) # Action: Connect Button 4 action to b4_ - - self.b5 = self.findChild("b5") # Find Button 5 - self.b5.clicked.connect(self.b5_) # Action: Connect Button 5 action to b5_ - - self.b6 = self.findChild("b6") # Find Button 6 - self.b6.clicked.connect(self.b6_) # Action: Connect Button 6 action to b6_ - - self.b7 = self.findChild("b7") # Find Button 7 - self.b7.clicked.connect(self.b7_) # Action: Connect Button 7 action to b7_ - - 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() \ No newline at end of file diff --git a/src/UI/ParchLinux.qml b/src/assets/ParchLinux.qml similarity index 67% rename from src/UI/ParchLinux.qml rename to src/assets/ParchLinux.qml index d570f91..47ab00f 100644 --- a/src/UI/ParchLinux.qml +++ b/src/assets/ParchLinux.qml @@ -1,7 +1,7 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.Controls.Material - +import QtQuick 6.0 +import QtQuick.Controls 6.0 +import QtQuick.Controls.Material 6.0 +import com.parch 1.0 ApplicationWindow { width: 900 height: 500 @@ -10,25 +10,35 @@ ApplicationWindow { id: parch color: "transparent" + function link(url) { + Qt.openUrlExternally(url); + } + ProcessHandler { + id: processHandler + onProcessFinished: { + // console.log("Process finished with exit code:", exitCode, "Exit status:", exitStatus); + parch.close() + } + } Rectangle { - anchors.fill: parent + anchors.centerIn: parent + width: 900 + height: 500 radius: 20 color: "#DD010409" Row { - anchors.right: parent.right - anchors.top: parent.top + anchors.right: parent.right + anchors.top: parent.top - ToolButton { - icon.color: "white" - icon.source: "x-lg.svg" - onClicked: { - parch.close() - } + ToolButton { + icon.color: "white" + icon.source: "x-lg.svg" + onClicked: { + parch.close() } - - + } } Column { @@ -60,7 +70,7 @@ ApplicationWindow { Text { text: "Parch Linux is an open-source, Arch-based Linux distribution," color: "white" - verticalAlignment: Text.AlignCenter + verticalAlignment: Text.AlignVCenter font.family: "Ubuntu Light" font.pixelSize: 14 anchors.horizontalCenter: parent.horizontalCenter @@ -68,7 +78,7 @@ ApplicationWindow { Text { color: "white" text: "that tried to be pretty, easy to use, light, fast and stable." - verticalAlignment: Text.AlignCenter + verticalAlignment: Text.AlignVCenter font.family: "Ubuntu Light" font.pixelSize: 14 anchors.horizontalCenter: parent.horizontalCenter @@ -84,41 +94,66 @@ ApplicationWindow { icon.color: "white" icon.source: "github.svg" objectName: "b1" + onClicked: { + link("https://github.com/parchlinux") + } } ToolButton { icon.color: "white" icon.source: "tw.svg" objectName: "b2" + onClicked: { + link("https://twitter.com/bssfoss") + } } ToolButton { icon.color: "white" icon.source: "tele.svg" objectName: "b3" + onClicked: { + link("https://t.me/parchlinux") + } } ToolButton { icon.color: "white" icon.source: "discord.svg" objectName: "b4" + onClicked: { + link("https://discord.gg/9RW5cRByAM") + } } ToolButton { icon.color: "white" icon.source: "masto.svg" objectName: "b5" + onClicked: { + link("https://mas.to/@bssfoss") + } } ToolButton { icon.color: "white" icon.source: "cafe.svg" objectName: "b6" + // Replace with Daramet platform due to Coffeete platform is unavailable + onClicked: { + link("https://daramet.com/parchlinux") + } } ToolButton { icon.color: "white" icon.source: "website.svg" objectName: "b7" + onClicked: { + link("https://parchlinux.ir") + } } ToolButton { icon.color: "white" icon.source: "book.svg" objectName: "b8" + onClicked: { + link("https://parchlinux.ir/parchwiki/") + } } } Rectangle { @@ -132,10 +167,14 @@ ApplicationWindow { height: 40 radius: 15 anchors.horizontalCenter: parent.horizontalCenter - ToolButton { anchors.fill: parent objectName: "install" + id: installBtn + onClicked: { + // Start the process through the ProcessHandler object + processHandler.startProcess(); + } } Row { @@ -154,6 +193,7 @@ ApplicationWindow { text: "Install Parch" font.pixelSize: 14 anchors.verticalCenter: parent.verticalCenter + id: installBtnText } ToolButton { width: 40 @@ -161,6 +201,10 @@ ApplicationWindow { anchors.verticalCenter: parent.verticalCenter icon.color: "white" icon.source: "install.svg" + onClicked: { + // Start the process through the ProcessHandler object + processHandler.startProcess(); + } } } } diff --git a/src/UI/ParchLogo.svg b/src/assets/ParchLogo.svg similarity index 100% rename from src/UI/ParchLogo.svg rename to src/assets/ParchLogo.svg diff --git a/src/UI/book.svg b/src/assets/book.svg similarity index 100% rename from src/UI/book.svg rename to src/assets/book.svg diff --git a/src/UI/cafe.svg b/src/assets/cafe.svg similarity index 100% rename from src/UI/cafe.svg rename to src/assets/cafe.svg diff --git a/src/UI/discord.svg b/src/assets/discord.svg similarity index 100% rename from src/UI/discord.svg rename to src/assets/discord.svg diff --git a/src/UI/github.svg b/src/assets/github.svg similarity index 100% rename from src/UI/github.svg rename to src/assets/github.svg diff --git a/src/UI/install.svg b/src/assets/install.svg similarity index 100% rename from src/UI/install.svg rename to src/assets/install.svg diff --git a/src/UI/masto.svg b/src/assets/masto.svg similarity index 100% rename from src/UI/masto.svg rename to src/assets/masto.svg diff --git a/src/assets/res.qrc b/src/assets/res.qrc new file mode 100644 index 0000000..4fa598f --- /dev/null +++ b/src/assets/res.qrc @@ -0,0 +1,16 @@ + + + discord.svg + x-lg.svg + tele.svg + cafe.svg + book.svg + github.svg + masto.svg + ParchLinux.qml + tw.svg + install.svg + ParchLogo.svg + website.svg + + \ No newline at end of file diff --git a/src/UI/tele.svg b/src/assets/tele.svg similarity index 100% rename from src/UI/tele.svg rename to src/assets/tele.svg diff --git a/src/UI/tw.svg b/src/assets/tw.svg similarity index 100% rename from src/UI/tw.svg rename to src/assets/tw.svg diff --git a/src/UI/website.svg b/src/assets/website.svg similarity index 100% rename from src/UI/website.svg rename to src/assets/website.svg diff --git a/src/UI/x-lg.svg b/src/assets/x-lg.svg similarity index 100% rename from src/UI/x-lg.svg rename to src/assets/x-lg.svg diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..dbc1e44 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include "processhandler.h" // Include the ProcessHandler class header + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + + // Register the ProcessHandler class with the QML engine + qmlRegisterType("com.parch", 1, 0, "ProcessHandler"); + + // Load the QML content from the resource + QResource::registerResource(":/resources.rcc"); + + // Load the QML file + engine.load(QUrl("qrc:/ParchLinux.qml")); + + // Set App Icon + app.setWindowIcon(QIcon("icon.png")); + + return app.exec(); +} \ No newline at end of file diff --git a/src/processhandler.cpp b/src/processhandler.cpp new file mode 100644 index 0000000..234f7bf --- /dev/null +++ b/src/processhandler.cpp @@ -0,0 +1,14 @@ +#include "processhandler.h" + +ProcessHandler::ProcessHandler(QObject *parent) : QObject(parent) +{ + connect(&m_process, QOverload::of(&QProcess::finished), + this, &ProcessHandler::processFinished); +} + +void ProcessHandler::startProcess() +{ + m_process.start("sudo", QStringList() << "sh" << "/etc/calamares/launch.sh"); + m_process.waitForFinished(); + emit processFinished(m_process.exitCode(), m_process.exitStatus()); +} diff --git a/src/processhandler.h b/src/processhandler.h new file mode 100644 index 0000000..c9bcd76 --- /dev/null +++ b/src/processhandler.h @@ -0,0 +1,23 @@ +#ifndef PROCESSHANDLER_H +#define PROCESSHANDLER_H + +#include +#include +class ProcessHandler : public QObject +{ + Q_OBJECT + +public: + explicit ProcessHandler(QObject *parent = nullptr); + +public slots: + void startProcess(); + +signals: + void processFinished(int exitCode, QProcess::ExitStatus exitStatus); + +private: + QProcess m_process; +}; + +#endif // PROCESSHANDLER_H