mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
added more gui stuff
This commit is contained in:
+21
-4
@@ -1,9 +1,9 @@
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QLineEdit, QWidget, QVBoxLayout
|
||||
from PySide6.QtWidgets import QLayoutItem, QLineEdit, QWidget, QVBoxLayout, QHBoxLayout, QListWidget, QListWidgetItem, QLabel, QPushButton
|
||||
import sys
|
||||
|
||||
class MainWindow(QtWidgets.QMainWindow):
|
||||
class MainWindow(QtWidgets.QMainWindow, QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("Software Manager")
|
||||
@@ -12,17 +12,34 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.controls = QWidget()
|
||||
self.controlsLayout = QVBoxLayout()
|
||||
|
||||
# Searchbar
|
||||
# Widgets
|
||||
self.searchbar = QLineEdit()
|
||||
self.searchbar.setPlaceholderText("Search for software...")
|
||||
self.searchbar.setClearButtonEnabled(True)
|
||||
self.searchbar.setMinimumHeight(30)
|
||||
self.searchbar.returnPressed.connect(self.return_pressed)
|
||||
|
||||
self.button = QtWidgets.QPushButton("Download")
|
||||
self.softwareList = QListWidget()
|
||||
|
||||
container = QWidget()
|
||||
containerLayout = QVBoxLayout()
|
||||
containerLayout.addWidget(self.searchbar)
|
||||
|
||||
containerLayout.addWidget(self.softwareList)
|
||||
self.softwareList.addItems(["Software A", "Software B", "Software C", "Software D"])
|
||||
|
||||
containerLayout.addWidget(self.button)
|
||||
self.button.clicked.connect(lambda: print(f"Downloading {self.softwareList.currentItem().text()}"))
|
||||
|
||||
container.setLayout(containerLayout)
|
||||
self.setCentralWidget(container)
|
||||
|
||||
containerLayout.setAlignment(Qt.AlignmentFlag.AlignTop)
|
||||
containerLayout.setAlignment(Qt.AlignmentFlag.AlignBottom)
|
||||
|
||||
def return_pressed(self):
|
||||
search_text = self.searchbar.text()
|
||||
print("User searched for:", search_text)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
search = input("Enter the name of the program you want to search for: ")
|
||||
url = "https://uztracker.net/tracker.php?nm=" # placeholder url for now
|
||||
response = requests.get(url) # get da content from da url
|
||||
@@ -30,11 +29,10 @@ def scrape_uztracker():
|
||||
return None
|
||||
|
||||
def get_post_title(post_url):
|
||||
response = requests.get(post_url)
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
maintitle = soup.find(class_='tt-text')
|
||||
if maintitle:
|
||||
print("Program found:", maintitle.text)
|
||||
print(maintitle.text)
|
||||
else:
|
||||
print("Program not found")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user