Installer development
This commit is contained in:
17
horsygui.py
17
horsygui.py
@@ -1,5 +1,7 @@
|
||||
import sys
|
||||
import math
|
||||
import webbrowser
|
||||
import modules.vars as horsy_vars
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
import modules.gui as gui
|
||||
@@ -8,7 +10,6 @@ import modules.gui as gui
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
|
||||
UiMainWindow = QtWidgets.QMainWindow()
|
||||
ui = gui.Ui_MainWindow()
|
||||
ui.setupUi(UiMainWindow)
|
||||
@@ -24,10 +25,12 @@ download_ui.setupUi(UiDownloadWindow)
|
||||
if __name__ == "__main__":
|
||||
UiMainWindow.show()
|
||||
|
||||
|
||||
# Functions
|
||||
def refresh_gui():
|
||||
installed_apps()
|
||||
|
||||
|
||||
def installed_apps():
|
||||
from modules.manager import apps_list
|
||||
ui.installed_table.clear()
|
||||
@@ -37,6 +40,7 @@ def installed_apps():
|
||||
for i in range(len(apps)):
|
||||
ui.installed_table.setItem(i // 4, i % 4, QtWidgets.QTableWidgetItem(str(apps[i])))
|
||||
|
||||
|
||||
def update_app():
|
||||
try:
|
||||
app_name = ui.installed_table.currentItem().text()
|
||||
@@ -48,6 +52,7 @@ def update_app():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def uninstall_app():
|
||||
try:
|
||||
app_name = ui.installed_table.currentItem().text()
|
||||
@@ -60,6 +65,7 @@ def uninstall_app():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def search_gui():
|
||||
from modules.search import search
|
||||
search_query = ui.search_box.toPlainText()
|
||||
@@ -73,6 +79,7 @@ def search_gui():
|
||||
for i in range(len(found)):
|
||||
ui.search_table.setItem(i // 4, i % 4, QtWidgets.QTableWidgetItem(str(found[i])))
|
||||
|
||||
|
||||
def install_app():
|
||||
from modules.gui_manager import install
|
||||
try:
|
||||
@@ -84,6 +91,7 @@ def install_app():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def get_source_gui():
|
||||
from modules.source import get_source
|
||||
try:
|
||||
@@ -97,6 +105,7 @@ def get_source_gui():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def info_gui():
|
||||
from modules.search import info
|
||||
try:
|
||||
@@ -110,6 +119,7 @@ def info_gui():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def like_gui():
|
||||
from modules.liker import like
|
||||
try:
|
||||
@@ -123,6 +133,7 @@ def like_gui():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def dislike_gui():
|
||||
from modules.liker import dislike
|
||||
try:
|
||||
@@ -136,6 +147,7 @@ def dislike_gui():
|
||||
except:
|
||||
return
|
||||
|
||||
|
||||
def upload_gui():
|
||||
from modules.uploader import upload
|
||||
gui.popup('Upload', str(upload(True, ui, login_ui, UiMainWindow)))
|
||||
@@ -157,7 +169,8 @@ if __name__ == "__main__":
|
||||
ui.like_button.clicked.connect(like_gui)
|
||||
ui.dislike_button.clicked.connect(dislike_gui)
|
||||
ui.upload_button.clicked.connect(upload_gui)
|
||||
|
||||
ui.regmessage_button.clicked.connect(lambda: webbrowser.open(f"{horsy_vars.protocol}{horsy_vars.server_url}"
|
||||
f"/registration"))
|
||||
|
||||
# Handle GUI exiting to exit whole program
|
||||
sys.exit(app.exec_())
|
||||
|
||||
Reference in New Issue
Block a user