From 56f91b65fd66bc87bb85ab247ffd56aec399ed94 Mon Sep 17 00:00:00 2001 From: idarthjedi Date: Mon, 20 Mar 2023 01:04:42 -0400 Subject: [PATCH] Began updating the MainUI for future work --- .gitignore | 2 +- README.md | 6 +- app/mainConfig.bak.py | 198 -------- {app => src}/config/config.py | 0 src/config/resources/blue-folder--pencil.png | Bin 0 -> 597 bytes src/config/resources/chart-up-color.png | Bin 0 -> 710 bytes src/config/resources/compile.png | Bin 0 -> 668 bytes src/config/resources/cross-script.png | Bin 0 -> 663 bytes .../config/src/app-config.latest.json | 0 {app => src}/config/src/app-config.v1.0.json | 0 {app => src}/config/src/mainConfig.ui | 0 src/config/src/mainUI.ui | 457 ++++++++++++++++++ {app => src/forms}/mainConfig.py | 12 +- src/forms/mainUI.bak.py | 332 +++++++++++++ src/forms/mainUI.py | 353 ++++++++++++++ src/main.py | 13 + app/app.py => src/qt.py | 5 +- standalone/airdrop_loader.py | 2 +- 18 files changed, 1172 insertions(+), 208 deletions(-) delete mode 100644 app/mainConfig.bak.py rename {app => src}/config/config.py (100%) create mode 100755 src/config/resources/blue-folder--pencil.png create mode 100755 src/config/resources/chart-up-color.png create mode 100755 src/config/resources/compile.png create mode 100755 src/config/resources/cross-script.png rename {app => src}/config/src/app-config.latest.json (100%) rename {app => src}/config/src/app-config.v1.0.json (100%) rename {app => src}/config/src/mainConfig.ui (100%) create mode 100644 src/config/src/mainUI.ui rename {app => src/forms}/mainConfig.py (99%) create mode 100644 src/forms/mainUI.bak.py create mode 100644 src/forms/mainUI.py create mode 100644 src/main.py rename app/app.py => src/qt.py (95%) diff --git a/.gitignore b/.gitignore index 04baded..67b2082 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,4 @@ dmypy.json .idea/ # App specific details -app/config/app-config.json +src/config/app-config.json diff --git a/README.md b/README.md index ff99d60..e8409ef 100644 --- a/README.md +++ b/README.md @@ -73,4 +73,8 @@ options: -s {d,default,m,medical,b,basebuilding,m,military}, --section {d,default,m,medical,b,basebuilding,m,military} Identifies the section of the airdrop settings file -``` \ No newline at end of file +``` + +## Attribution + +Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/). \ No newline at end of file diff --git a/app/mainConfig.bak.py b/app/mainConfig.bak.py deleted file mode 100644 index 3050eb5..0000000 --- a/app/mainConfig.bak.py +++ /dev/null @@ -1,198 +0,0 @@ -# Form implementation generated from reading ui file 'src/mainConfig.ui' -# -# Created by: PyQt6 UI code generator 6.4.2 -# -# WARNING: Any manual changes made to this file will be lost when pyuic6 is -# run again. Do not edit this file unless you know what you are doing. - - -from PyQt6 import QtCore, QtGui, QtWidgets -#TODO: Added these additional imports -from PyQt6.QtWidgets import QFileDialog, QWidget, QMessageBox, QMainWindow -from config import config -import os -import json - - -class Ui_MainWindow(QMainWindow): - - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(596, 500) - #TODO: Added this next line - self._parent = MainWindow - self.centralwidget = QtWidgets.QWidget(parent=MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.gridLayout_2 = QtWidgets.QGridLayout(self.centralwidget) - self.gridLayout_2.setObjectName("gridLayout_2") - self.gridLayout = QtWidgets.QGridLayout() - self.gridLayout.setObjectName("gridLayout") - self.pushButton_addJSON = QtWidgets.QPushButton(parent=self.centralwidget) - self.pushButton_addJSON.setObjectName("pushButton_addJSON") - self.gridLayout.addWidget(self.pushButton_addJSON, 4, 2, 1, 1) - self.label = QtWidgets.QLabel(parent=self.centralwidget) - self.label.setObjectName("label") - self.gridLayout.addWidget(self.label, 0, 0, 1, 1) - self.label_2 = QtWidgets.QLabel(parent=self.centralwidget) - self.label_2.setObjectName("label_2") - self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) - self.label_3 = QtWidgets.QLabel(parent=self.centralwidget) - self.label_3.setObjectName("label_3") - self.gridLayout.addWidget(self.label_3, 5, 0, 1, 1) - self.lstJSONLocation = QtWidgets.QListWidget(parent=self.centralwidget) - self.lstJSONLocation.setObjectName("lstJSONLocation") - self.gridLayout.addWidget(self.lstJSONLocation, 3, 0, 1, 3) - self.pushButton_ProfileLocation = QtWidgets.QPushButton(parent=self.centralwidget) - self.pushButton_ProfileLocation.setObjectName("pushButton_ProfileLocation") - self.gridLayout.addWidget(self.pushButton_ProfileLocation, 1, 2, 1, 1, QtCore.Qt.AlignmentFlag.AlignTop) - self.lstXMLLocation = QtWidgets.QListWidget(parent=self.centralwidget) - self.lstXMLLocation.setObjectName("lstXMLLocation") - self.gridLayout.addWidget(self.lstXMLLocation, 6, 0, 1, 3) - self.pushButton_Close = QtWidgets.QPushButton(parent=self.centralwidget) - self.pushButton_Close.setObjectName("pushButton_Close") - self.gridLayout.addWidget(self.pushButton_Close, 8, 0, 1, 3) - self.pushButton_removeXML = QtWidgets.QPushButton(parent=self.centralwidget) - self.pushButton_removeXML.setObjectName("pushButton_removeXML") - self.gridLayout.addWidget(self.pushButton_removeXML, 7, 1, 1, 1) - self.pushButton_addXML = QtWidgets.QPushButton(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_addXML.sizePolicy().hasHeightForWidth()) - self.pushButton_addXML.setSizePolicy(sizePolicy) - self.pushButton_addXML.setObjectName("pushButton_addXML") - self.gridLayout.addWidget(self.pushButton_addXML, 7, 2, 1, 1) - self.pushButton_removeJSON = QtWidgets.QPushButton(parent=self.centralwidget) - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.pushButton_removeJSON.sizePolicy().hasHeightForWidth()) - self.pushButton_removeJSON.setSizePolicy(sizePolicy) - self.pushButton_removeJSON.setObjectName("pushButton_removeJSON") - self.gridLayout.addWidget(self.pushButton_removeJSON, 4, 1, 1, 1) - self.lnProfileLocation = QtWidgets.QLineEdit(parent=self.centralwidget) - self.lnProfileLocation.setObjectName("lnProfileLocation") - self.gridLayout.addWidget(self.lnProfileLocation, 1, 0, 1, 2) - self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(parent=MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 596, 24)) - self.menubar.setObjectName("menubar") - MainWindow.setMenuBar(self.menubar) - self.statusbar = QtWidgets.QStatusBar(parent=MainWindow) - self.statusbar.setObjectName("statusbar") - MainWindow.setStatusBar(self.statusbar) - - self.retranslateUi(MainWindow) - #TODO: Added All the Push Button Responses - self.pushButton_ProfileLocation.clicked['bool'].connect(self._getProfileLocation) # type: ignore - self.pushButton_addJSON.clicked['bool'].connect(self._addJSONLocation) # type: ignore - self.pushButton_removeJSON.clicked['bool'].connect(self._removeJSONLocation) # type: ignore - self.pushButton_addXML.clicked['bool'].connect(self._addXMLLocation) # type: ignore - self.pushButton_removeXML.clicked['bool'].connect(self._removeXMLLocation) # type: ignore - self.pushButton_Close.clicked['bool'].connect(self._closeForm) # type: ignore - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - #TODO: Changed Name of Main Window - MainWindow.setWindowTitle(_translate("MainWindow", "DayZ Admin Tools Config Editor")) - self.pushButton_addJSON.setText(_translate("MainWindow", "+")) - self.label.setText(_translate("MainWindow", "DayZ Profile Location")) - self.label_2.setText(_translate("MainWindow", "DayZ JSON File Location(s)")) - self.label_3.setText(_translate("MainWindow", "DayZ XML File Location(s)")) - self.pushButton_ProfileLocation.setText(_translate("MainWindow", "...")) - self.pushButton_Close.setText(_translate("MainWindow", "&Close")) - self.pushButton_removeXML.setText(_translate("MainWindow", "-")) - self.pushButton_addXML.setText(_translate("MainWindow", "+")) - self.pushButton_removeJSON.setText(_translate("MainWindow", "-")) - - - #TODO: Added All the code down to if __name__=="__main__" - profile_dir, json_dir, xml_dir = config.loadConfig() - - self.lnProfileLocation.setText(profile_dir) - for path in json_dir: - self.lstJSONLocation.addItem(path) - - for path in xml_dir: - self.lstXMLLocation.addItem(path) - - def getDirectory(self, title: str, start_dir: str): - - return QFileDialog.getExistingDirectory(self, caption=title, - directory=start_dir) - - def _getProfileLocation(self, status: bool): - fileName = self.getDirectory("Locate DayZ Profile Directory", self.lnProfileLocation.text()) - if fileName: - self.lnProfileLocation.setText(fileName) - else: - self.lnProfileLocation.setText("") - return - - def _addJSONLocation(self): - fileName = self.getDirectory("Locate JSON Directory", self.lnProfileLocation.text()) - if fileName: - self.lstJSONLocation.addItem(fileName) - return - - def _removeJSONLocation(self): - - for item in self.lstJSONLocation.selectedItems(): - current_item = self.lstJSONLocation.takeItem( - self.lstJSONLocation.indexFromItem(item).row()) - del current_item - - return - - def _addXMLLocation(self): - fileName = self.getDirectory("Locate XML Directory", self.lnProfileLocation.text()) - if fileName: - self.lstXMLLocation.addItem(fileName) - - return - - def _removeXMLLocation(self): - - for item in self.lstXMLLocation.selectedItems(): - current_item = self.lstXMLLocation.takeItem( - self.lstXMLLocation.indexFromItem(item).row()) - del current_item - - return - - def _closeForm(self): - # Save Configuration File Info - if self.lnProfileLocation.text() == "": - return - - self.saveConfig() - self._parent.close() - - return - - def saveConfig(self): - - json_items, xml_items = [], [] - - for index in range(self.lstJSONLocation.count()): - json_items.append(str(self.lstJSONLocation.item(index).text())) - - for index in range(self.lstXMLLocation.count()): - xml_items.append(str(self.lstXMLLocation.item(index).text())) - - config.saveConfig(self.lnProfileLocation.text(), - json_items, - xml_items) - - -if __name__ == "__main__": - import sys - - app = QtWidgets.QApplication(sys.argv) - MainWindow = QtWidgets.QMainWindow() - ui = Ui_MainWindow() - ui.setupUi(MainWindow) - MainWindow.show() - sys.exit(app.exec()) diff --git a/app/config/config.py b/src/config/config.py similarity index 100% rename from app/config/config.py rename to src/config/config.py diff --git a/src/config/resources/blue-folder--pencil.png b/src/config/resources/blue-folder--pencil.png new file mode 100755 index 0000000000000000000000000000000000000000..4df34b20de89ab86039efdd8862f578701531153 GIT binary patch literal 597 zcmV-b0;>IqP) zAO;J=f4HFR)~@2--@pIh)yc}r!r)!jTMXl~Fd$4|`u+Pi!}sss30Tev#Q&KP1|VF( z^zYw)1`x&v!1DhYkPSe%;P2o63?PgTfaU+=Z~^fK;BdjefBzUj7$0C_VnVn8sFew9 z00hHb0K(i?FEMD<LHd{&Ko&wU^PfNe7(n>*yEhDv z9^PRvbGBw+nLh&bL)O?TO$B$nO^DDC&f$BrhUBC>oh3&@~hUa&$Gh{auF%;f= z#qcg774CwMA3re&35mf1k{P5AISiQDew=1tem9SyG1i(PwXBsv!P<@Cmy8n7b&%-& z`}ZFMJgPwkfC4c@<~ReV5F^9gw<7Yaug)|0xmh#JS-O|Oz&MS8MMwdx2@?7s@BIPO zV6lIYfMf}lJ;5NT%xHh@nW%-IOESZpC3_iui6t>G@*AT>DTw{^=O4Itfc}TL0O%UE zZ(kY8(&Lg9=PujN@Ixetfq~Zy>}>QD`19v4xEKEa{m0Jm;VA>l^EZsKg=IIqYU-?B zNSO3Wu=APXh<|3V3)tD&8FE{v%x8FYW844RdpQ|F$sxg$ao6z=Ca-S&HDM+yGk<>e j`2Y2di-D|X009O7Cj%-mMsyDX00000NkvXXu0mjfe54l@ literal 0 HcmV?d00001 diff --git a/src/config/resources/chart-up-color.png b/src/config/resources/chart-up-color.png new file mode 100755 index 0000000000000000000000000000000000000000..7878b1ab29c0a9bb2ca41ec70bb63ae24a286c29 GIT binary patch literal 710 zcmV;%0y+JOP)rb9n<#4y zsiGnnsFGSTu?V6bgfybG7PSplsF6Yu@#I0oYi^===|K<$q2Qs?Qzat!Q-2PUKoe3; zV$u>5QiCWqv`Ly|v(8Kr)b`Lk_U)VZ^L_JXcAo)E_K85B0_-;dCIdhp=u{TFR zz6sV#Sj24$Eu@GRVST#XSjz!Zl#q;i{G?ni^OVtO#N*c!*Z>7DEe>(3(Kbqyq^1W^ z*QXvldl(i)5yfH=rBVqr_8);xK{Y+#?;Rn`a-SBVsJ26CVbjYvm}vDpjBMj-8PjQS`y}0YVf$p^Yj^e@sYK_3@ll^2aKL?ZDgi!DmT#^IH zH({u|Rpj+N+IF;IF_eT~J%zEZVQksfj-#KITu(|F6S@|p4=*MsA?_3rd-@)u+xu|O zb(7odbPQ6vgu?SA_x+A@C@nAJ`?ox_MniC?B#4L8%Hr`JFUB7|!PPxJTyb53L@$b2 zc2VOK|Hhd}l7hO{FtW8s7s55?MO^M2;z_mxQzk67QCt*FjDUYZQKL*&RYj#z#%4v9 z6=;7tsMhMHAB6(y_1dNhR%izd#|ernWwUCtHATRVz;Jxdx;u>5t&(9cnv|tgeSWEe sJ8aZisBUEg)&!pZ$M{8c^|t^60PM{NslKvjssI2007*qoM6N<$g3E9}_y7O^ literal 0 HcmV?d00001 diff --git a/src/config/resources/compile.png b/src/config/resources/compile.png new file mode 100755 index 0000000000000000000000000000000000000000..739efb5b9c12f68724977d2fc8eaed3aff7a8b15 GIT binary patch literal 668 zcmV;N0%QG&P)yDIUD}4+tKtAVR&V1*;VVMFlUSt$Hv^K@h~EB9ep} zb69Me-I?r+Z+2(bDCxkDH}mbAnfKnlVYojGGj^Oma?Yu@)>tl=!`>#T*)kyyFC z>_TFey_X+QQ%A{vE@^KX4~UmKg?R`$`|;*GH($&HgTPQ>2&=bTSL>*%c~qi;UM8lE z{T5xG7PUn7xHW?rt5W{FUuheyORPKEr5<)npRxt(^fI^#n zUT|vg3=v?B0yLT{7Bl;EImu8}t2{IFUY0^Yb4O?iifc1J27k5V$$FKm@>}!F+yzL@`vW zRF*VNJ1BUmxNA2jaBHx-y)9{6-sqR4J-RFhm+JLuDi%wqw!QGjvIb3Fv&Pmo>Rc?( zczs_weYnTx>#5Z1HQ6v8t~8q;LV-X8w(0i&=Ac6W_Oaer?8E_4l-3kweZw%GBjl%W zJo!ykr=os;7W!?Ar@KjDdwFLKqKikv;jCtwf6KD`3FjvYY;6y7bV}P3ZSB zJB)6@!(PMK7Fef^f*|aLVR(S(3c~&U7I~t|%fPB$aBdbph%*AgKBB%P(XIu?UUvxM xeB1;4p%%}~;yUBA + + MainWindow + + + + 0 + 0 + 1076 + 813 + + + + MainWindow + + + + + + + QTabWidget::West + + + 0 + + + + Market Config + + + + + + Market File Name + + + + + + + + + + QFrame::Box + + + + + + ClassName: + + + + + + + + + + + + + + + + + + + Quantity %: + + + + + + + Min Price: + + + + + + + + + + ... + + + + + + + Sell Price %: + + + + + + + + + + Min Stock: + + + + + + + Max Price: + + + + + + + + + + Max Stock: + + + + + + + + + + 1 + + + + Attachments + + + + + + + + + 0 + 0 + + + + + 16777215 + 61 + + + + Source File + + + + + + + + + + + + QFrame::Panel + + + 1 + + + + + + Available Attachments + + + + + + + Added Attachments + + + + + + + + + + >> + + + + + + + + 0 + 0 + + + + + + + + Remove + + + + + + + + + + + Variants + + + + + + QFrame::Panel + + + 1 + + + + + + Available Variants + + + + + + + Added Variants + + + + + + + + + + >> + + + + + + + + 0 + 0 + + + + + + + + Remove + + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 61 + + + + Source File + + + + + + + + + + + + + + + + &New + + + + + + + + + + + + + + 0 + 0 + + + + + + + + + Economy Config + + + + + 360 + 300 + 321 + 71 + + + + <html><head/><body><p><span style=" font-size:48pt; color:#e1be00;">Coming Soon</span></p></body></html> + + + + + + + + + + + toolBar + + + true + + + TopToolBarArea + + + false + + + + + + + + + 0 + 0 + 1076 + 24 + + + + + &File + + + + + + &Utilities + + + + + + + + + + + ../resources/cross-script.png../resources/cross-script.png + + + E&xit! + + + + + + ../resources/blue-folder--pencil.png../resources/blue-folder--pencil.png + + + Config! + + + Set Application Configuration + + + + + + ../resources/chart-up-color.png../resources/chart-up-color.png + + + &Validate! + + + Validate Configurations! + + + + + comboBox_market_filename + treeView + lineEdit_classname + pushButton_searchclasses + lineEdit_maxprice + lineEdit_minprice + lineEdit_maxstock + lineEdit_minstock + lineEdit_sellpricepercent + lineEdit_quantitypercent + tabWidget + comboBox_attachfile_source + listWidget_attachments_available + pushButton_attachment_add + listWidget_attachments_added + pushButton_attachment_remove + comboBox_variantsfile_source + listWidget_variants_available + pushButton_variants_add + listWidget_variants_added + pushButton_variants_remove + pushButton_newitem + tabWidget + + + + diff --git a/app/mainConfig.py b/src/forms/mainConfig.py similarity index 99% rename from app/mainConfig.py rename to src/forms/mainConfig.py index 8dfb89f..9b667ad 100644 --- a/app/mainConfig.py +++ b/src/forms/mainConfig.py @@ -4,14 +4,16 @@ # # WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. +import sys +import os +import json +from src.config import config from PyQt6 import QtCore, QtGui, QtWidgets #TODO: Added these Additional Imports from PyQt6.QtWidgets import QFileDialog, QWidget, QMessageBox, QMainWindow -from config import config -import os -import json + #TODO: Changed parent window to QMainWindow from object class Ui_MainWindow(QMainWindow): @@ -133,7 +135,7 @@ def setupUi(self, MainWindow): self.pushButton_removeJSON.clicked['bool'].connect(self._removeJSONLocation) # type: ignore self.pushButton_addXML.clicked['bool'].connect(self._addXMLLocation) # type: ignore self.pushButton_removeXML.clicked['bool'].connect(self._removeXMLLocation) # type: ignore - self.pushButton_Close.clicked['bool'].connect(self._closeForm) # type: ignore + self.pushButton_Close.clicked['bool'].connect(self._closeform) # type: ignore self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -234,7 +236,7 @@ def _removeXMLLocation(self): return - def _closeForm(self): + def _closeform(self): # Save Configuration File Info if self.lnProfileLocation.text() == "": return diff --git a/src/forms/mainUI.bak.py b/src/forms/mainUI.bak.py new file mode 100644 index 0000000..cd7073d --- /dev/null +++ b/src/forms/mainUI.bak.py @@ -0,0 +1,332 @@ +# Form implementation generated from reading ui file 'mainUI.ui' +# +# Created by: PyQt6 UI code generator 6.4.2 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt6 import QtCore, QtGui, QtWidgets +#TODO: Added these Additional Imports +from PyQt6.QtWidgets import QFileDialog, QWidget, QMessageBox, QMainWindow + + +#TODO: Changed parent window to QMainWindow from object +class Ui_MainWindow(QMainWindow): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(1076, 813) + #TODO: Added this next line + self._parent = MainWindow + self.centralwidget = QtWidgets.QWidget(parent=MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget) + self.tabWidget.setTabPosition(QtWidgets.QTabWidget.TabPosition.West) + self.tabWidget.setObjectName("tabWidget") + self.tab_market_config = QtWidgets.QWidget() + self.tab_market_config.setObjectName("tab_market_config") + self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_market_config) + self.gridLayout_4.setObjectName("gridLayout_4") + self.label_13 = QtWidgets.QLabel(parent=self.tab_market_config) + self.label_13.setObjectName("label_13") + self.gridLayout_4.addWidget(self.label_13, 0, 0, 1, 1) + self.widget = QtWidgets.QWidget(parent=self.tab_market_config) + self.widget.setObjectName("widget") + self.gridLayout_6 = QtWidgets.QGridLayout(self.widget) + self.gridLayout_6.setObjectName("gridLayout_6") + self.frame = QtWidgets.QFrame(parent=self.widget) + self.frame.setFrameShape(QtWidgets.QFrame.Shape.Box) + self.frame.setObjectName("frame") + self.gridLayout_2 = QtWidgets.QGridLayout(self.frame) + self.gridLayout_2.setObjectName("gridLayout_2") + self.label_className = QtWidgets.QLabel(parent=self.frame) + self.label_className.setObjectName("label_className") + self.gridLayout_2.addWidget(self.label_className, 0, 1, 1, 1) + self.lineEdit_maxstock = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_maxstock.setObjectName("lineEdit_maxstock") + self.gridLayout_2.addWidget(self.lineEdit_maxstock, 2, 2, 1, 1) + self.lineEdit_maxprice = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_maxprice.setObjectName("lineEdit_maxprice") + self.gridLayout_2.addWidget(self.lineEdit_maxprice, 1, 2, 1, 1) + self.lineEdit_classname = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_classname.setObjectName("lineEdit_classname") + self.gridLayout_2.addWidget(self.lineEdit_classname, 0, 2, 1, 3) + self.lineEdit_quantitypercent = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_quantitypercent.setObjectName("lineEdit_quantitypercent") + self.gridLayout_2.addWidget(self.lineEdit_quantitypercent, 3, 4, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.frame) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 3, 3, 1, 1) + self.label_minprice = QtWidgets.QLabel(parent=self.frame) + self.label_minprice.setObjectName("label_minprice") + self.gridLayout_2.addWidget(self.label_minprice, 1, 3, 1, 1) + self.lineEdit_sellpricepercent = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_sellpricepercent.setObjectName("lineEdit_sellpricepercent") + self.gridLayout_2.addWidget(self.lineEdit_sellpricepercent, 3, 2, 1, 1) + self.pushButton_searchclasses = QtWidgets.QPushButton(parent=self.frame) + self.pushButton_searchclasses.setObjectName("pushButton_searchclasses") + self.gridLayout_2.addWidget(self.pushButton_searchclasses, 0, 5, 1, 1) + self.label_sellpricepercent = QtWidgets.QLabel(parent=self.frame) + self.label_sellpricepercent.setObjectName("label_sellpricepercent") + self.gridLayout_2.addWidget(self.label_sellpricepercent, 3, 1, 1, 1) + self.lineEdit_minprice = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_minprice.setObjectName("lineEdit_minprice") + self.gridLayout_2.addWidget(self.lineEdit_minprice, 1, 4, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=self.frame) + self.label_5.setObjectName("label_5") + self.gridLayout_2.addWidget(self.label_5, 2, 3, 1, 1) + self.label_maxprice = QtWidgets.QLabel(parent=self.frame) + self.label_maxprice.setObjectName("label_maxprice") + self.gridLayout_2.addWidget(self.label_maxprice, 1, 1, 1, 1) + self.lineEdit_minstock = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_minstock.setObjectName("lineEdit_minstock") + self.gridLayout_2.addWidget(self.lineEdit_minstock, 2, 4, 1, 1) + self.label_maxstock = QtWidgets.QLabel(parent=self.frame) + self.label_maxstock.setObjectName("label_maxstock") + self.gridLayout_2.addWidget(self.label_maxstock, 2, 1, 1, 1) + self.gridLayout_6.addWidget(self.frame, 0, 0, 1, 1) + self.tabWidget1 = QtWidgets.QTabWidget(parent=self.widget) + self.tabWidget1.setObjectName("tabWidget1") + self.tabWidgetPage_attachments = QtWidgets.QWidget() + self.tabWidgetPage_attachments.setObjectName("tabWidgetPage_attachments") + self.gridLayout_8 = QtWidgets.QGridLayout(self.tabWidgetPage_attachments) + self.gridLayout_8.setObjectName("gridLayout_8") + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.label_sourceattachfile = QtWidgets.QLabel(parent=self.tabWidgetPage_attachments) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_sourceattachfile.sizePolicy().hasHeightForWidth()) + self.label_sourceattachfile.setSizePolicy(sizePolicy) + self.label_sourceattachfile.setMaximumSize(QtCore.QSize(16777215, 61)) + self.label_sourceattachfile.setObjectName("label_sourceattachfile") + self.horizontalLayout_5.addWidget(self.label_sourceattachfile) + self.comboBox_attachfile_source = QtWidgets.QComboBox(parent=self.tabWidgetPage_attachments) + self.comboBox_attachfile_source.setObjectName("comboBox_attachfile_source") + self.horizontalLayout_5.addWidget(self.comboBox_attachfile_source) + self.gridLayout_8.addLayout(self.horizontalLayout_5, 0, 0, 1, 1) + self.frame_attachments = QtWidgets.QFrame(parent=self.tabWidgetPage_attachments) + self.frame_attachments.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.frame_attachments.setLineWidth(1) + self.frame_attachments.setObjectName("frame_attachments") + self.gridLayout_3 = QtWidgets.QGridLayout(self.frame_attachments) + self.gridLayout_3.setObjectName("gridLayout_3") + self.label_availattach = QtWidgets.QLabel(parent=self.frame_attachments) + self.label_availattach.setObjectName("label_availattach") + self.gridLayout_3.addWidget(self.label_availattach, 0, 0, 1, 1) + self.label_addedattach = QtWidgets.QLabel(parent=self.frame_attachments) + self.label_addedattach.setObjectName("label_addedattach") + self.gridLayout_3.addWidget(self.label_addedattach, 0, 2, 1, 1) + self.listWidget_attachments_available = QtWidgets.QListWidget(parent=self.frame_attachments) + self.listWidget_attachments_available.setObjectName("listWidget_attachments_available") + self.gridLayout_3.addWidget(self.listWidget_attachments_available, 1, 0, 1, 1) + self.pushButton_attachment_add = QtWidgets.QPushButton(parent=self.frame_attachments) + self.pushButton_attachment_add.setObjectName("pushButton_attachment_add") + self.gridLayout_3.addWidget(self.pushButton_attachment_add, 1, 1, 1, 1, QtCore.Qt.AlignmentFlag.AlignTop) + self.listWidget_attachments_added = QtWidgets.QListWidget(parent=self.frame_attachments) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listWidget_attachments_added.sizePolicy().hasHeightForWidth()) + self.listWidget_attachments_added.setSizePolicy(sizePolicy) + self.listWidget_attachments_added.setObjectName("listWidget_attachments_added") + self.gridLayout_3.addWidget(self.listWidget_attachments_added, 1, 2, 1, 1) + self.pushButton_attachment_remove = QtWidgets.QPushButton(parent=self.frame_attachments) + self.pushButton_attachment_remove.setObjectName("pushButton_attachment_remove") + self.gridLayout_3.addWidget(self.pushButton_attachment_remove, 2, 2, 1, 1) + self.gridLayout_8.addWidget(self.frame_attachments, 1, 0, 1, 1) + self.tabWidget1.addTab(self.tabWidgetPage_attachments, "") + self.tabWidgetPage_variants = QtWidgets.QWidget() + self.tabWidgetPage_variants.setObjectName("tabWidgetPage_variants") + self.gridLayout_7 = QtWidgets.QGridLayout(self.tabWidgetPage_variants) + self.gridLayout_7.setObjectName("gridLayout_7") + self.frame_variants = QtWidgets.QFrame(parent=self.tabWidgetPage_variants) + self.frame_variants.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.frame_variants.setLineWidth(1) + self.frame_variants.setObjectName("frame_variants") + self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_variants) + self.gridLayout_5.setObjectName("gridLayout_5") + self.label_availvariants = QtWidgets.QLabel(parent=self.frame_variants) + self.label_availvariants.setObjectName("label_availvariants") + self.gridLayout_5.addWidget(self.label_availvariants, 0, 0, 1, 1) + self.label_addedvariants = QtWidgets.QLabel(parent=self.frame_variants) + self.label_addedvariants.setObjectName("label_addedvariants") + self.gridLayout_5.addWidget(self.label_addedvariants, 0, 2, 1, 1) + self.listWidget_variants_available = QtWidgets.QListWidget(parent=self.frame_variants) + self.listWidget_variants_available.setObjectName("listWidget_variants_available") + self.gridLayout_5.addWidget(self.listWidget_variants_available, 1, 0, 1, 1) + self.pushButton_variants_add = QtWidgets.QPushButton(parent=self.frame_variants) + self.pushButton_variants_add.setObjectName("pushButton_variants_add") + self.gridLayout_5.addWidget(self.pushButton_variants_add, 1, 1, 1, 1, QtCore.Qt.AlignmentFlag.AlignTop) + self.listWidget_variants_added = QtWidgets.QListWidget(parent=self.frame_variants) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listWidget_variants_added.sizePolicy().hasHeightForWidth()) + self.listWidget_variants_added.setSizePolicy(sizePolicy) + self.listWidget_variants_added.setObjectName("listWidget_variants_added") + self.gridLayout_5.addWidget(self.listWidget_variants_added, 1, 2, 1, 1) + self.pushButton_variants_remove = QtWidgets.QPushButton(parent=self.frame_variants) + self.pushButton_variants_remove.setObjectName("pushButton_variants_remove") + self.gridLayout_5.addWidget(self.pushButton_variants_remove, 2, 2, 1, 1) + self.gridLayout_7.addWidget(self.frame_variants, 1, 0, 1, 1) + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.label_sourcevariantsfile = QtWidgets.QLabel(parent=self.tabWidgetPage_variants) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_sourcevariantsfile.sizePolicy().hasHeightForWidth()) + self.label_sourcevariantsfile.setSizePolicy(sizePolicy) + self.label_sourcevariantsfile.setMaximumSize(QtCore.QSize(16777215, 61)) + self.label_sourcevariantsfile.setObjectName("label_sourcevariantsfile") + self.horizontalLayout_6.addWidget(self.label_sourcevariantsfile) + self.comboBox_variantsfile_source = QtWidgets.QComboBox(parent=self.tabWidgetPage_variants) + self.comboBox_variantsfile_source.setObjectName("comboBox_variantsfile_source") + self.horizontalLayout_6.addWidget(self.comboBox_variantsfile_source) + self.gridLayout_7.addLayout(self.horizontalLayout_6, 0, 0, 1, 1) + self.tabWidget1.addTab(self.tabWidgetPage_variants, "") + self.gridLayout_6.addWidget(self.tabWidget1, 1, 0, 1, 1) + self.pushButton_newitem = QtWidgets.QPushButton(parent=self.widget) + self.pushButton_newitem.setObjectName("pushButton_newitem") + self.gridLayout_6.addWidget(self.pushButton_newitem, 2, 0, 1, 1) + self.gridLayout_4.addWidget(self.widget, 0, 1, 3, 1) + self.comboBox_market_filename = QtWidgets.QComboBox(parent=self.tab_market_config) + self.comboBox_market_filename.setObjectName("comboBox_market_filename") + self.gridLayout_4.addWidget(self.comboBox_market_filename, 1, 0, 1, 1) + self.treeView = QtWidgets.QTreeView(parent=self.tab_market_config) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Maximum, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.treeView.sizePolicy().hasHeightForWidth()) + self.treeView.setSizePolicy(sizePolicy) + self.treeView.setObjectName("treeView") + self.gridLayout_4.addWidget(self.treeView, 2, 0, 1, 1) + self.tabWidget.addTab(self.tab_market_config, "") + self.tab_economy_config = QtWidgets.QWidget() + self.tab_economy_config.setObjectName("tab_economy_config") + self.label_comingsoon = QtWidgets.QLabel(parent=self.tab_economy_config) + self.label_comingsoon.setGeometry(QtCore.QRect(360, 300, 321, 71)) + self.label_comingsoon.setObjectName("label_comingsoon") + self.tabWidget.addTab(self.tab_economy_config, "") + self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.statusbar = QtWidgets.QStatusBar(parent=MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.toolBar = QtWidgets.QToolBar(parent=MainWindow) + self.toolBar.setMovable(True) + self.toolBar.setObjectName("toolBar") + MainWindow.addToolBar(QtCore.Qt.ToolBarArea.TopToolBarArea, self.toolBar) + self.menuBar = QtWidgets.QMenuBar(parent=MainWindow) + self.menuBar.setGeometry(QtCore.QRect(0, 0, 1076, 24)) + self.menuBar.setObjectName("menuBar") + self.menu_File = QtWidgets.QMenu(parent=self.menuBar) + self.menu_File.setObjectName("menu_File") + self.menu_Config = QtWidgets.QMenu(parent=self.menuBar) + self.menu_Config.setObjectName("menu_Config") + MainWindow.setMenuBar(self.menuBar) + self.actionExit = QtGui.QAction(parent=MainWindow) + icon = QtGui.QIcon() + #TODO: Updated path for config + icon.addPixmap(QtGui.QPixmap("../config/resources/cross-script.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionExit.setIcon(icon) + self.actionExit.setObjectName("actionExit") + self.actionConfig = QtGui.QAction(parent=MainWindow) + icon1 = QtGui.QIcon() + #TODO: Updated path for config + icon1.addPixmap(QtGui.QPixmap("../config/resources/blue-folder--pencil.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionConfig.setIcon(icon1) + self.actionConfig.setObjectName("actionConfig") + self.action_Validate = QtGui.QAction(parent=MainWindow) + icon2 = QtGui.QIcon() + #TODO: Updated path for config + icon2.addPixmap(QtGui.QPixmap("../config/resources/chart-up-color.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.action_Validate.setIcon(icon2) + self.action_Validate.setObjectName("action_Validate") + self.toolBar.addAction(self.actionExit) + self.toolBar.addAction(self.actionConfig) + self.toolBar.addAction(self.action_Validate) + self.menu_File.addAction(self.actionExit) + self.menu_Config.addAction(self.actionConfig) + self.menu_Config.addAction(self.action_Validate) + self.menuBar.addAction(self.menu_File.menuAction()) + self.menuBar.addAction(self.menu_Config.menuAction()) + + self.retranslateUi(MainWindow) + + # TODO: Added All the Push Button Responses + self.actionExit.triggered.connect(self._closeform) + # self.pushButton_ProfileLocation.clicked['bool'].connect(self._getProfileLocation) # type: ignore + # self.pushButton_marketdirectory.clicked['bool'].connect(self._getMarketLocation) # type: ignore + # self.pushButton_tradersdirectory.clicked['bool'].connect(self._getTraderLocation) # type: ignore + # self.pushButton_addJSON.clicked['bool'].connect(self._addJSONLocation) # type: ignore + # self.pushButton_removeJSON.clicked['bool'].connect(self._removeJSONLocation) # type: ignore + # self.pushButton_addXML.clicked['bool'].connect(self._addXMLLocation) # type: ignore + # self.pushButton_removeXML.clicked['bool'].connect(self._removeXMLLocation) # type: ignore + # self.pushButton_Close.clicked['bool'].connect(self._closeForm) # type: ignore + + self.tabWidget.setCurrentIndex(0) + self.tabWidget1.setCurrentIndex(1) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + #TODO: Changed the WindowTitle + MainWindow.setWindowTitle(_translate("MainWindow", "DayZ Admin Tool Manager")) + self.label_13.setText(_translate("MainWindow", "Market File Name")) + self.label_className.setText(_translate("MainWindow", "ClassName:")) + self.label_6.setText(_translate("MainWindow", "Quantity %:")) + self.label_minprice.setText(_translate("MainWindow", "Min Price:")) + self.pushButton_searchclasses.setText(_translate("MainWindow", "...")) + self.label_sellpricepercent.setText(_translate("MainWindow", "Sell Price %:")) + self.label_5.setText(_translate("MainWindow", "Min Stock:")) + self.label_maxprice.setText(_translate("MainWindow", "Max Price:")) + self.label_maxstock.setText(_translate("MainWindow", "Max Stock:")) + self.label_sourceattachfile.setText(_translate("MainWindow", "Source File")) + self.label_availattach.setText(_translate("MainWindow", "Available Attachments")) + self.label_addedattach.setText(_translate("MainWindow", "Added Attachments")) + self.pushButton_attachment_add.setText(_translate("MainWindow", ">>")) + self.pushButton_attachment_remove.setText(_translate("MainWindow", "Remove")) + self.tabWidget1.setTabText(self.tabWidget1.indexOf(self.tabWidgetPage_attachments), _translate("MainWindow", "Attachments")) + self.label_availvariants.setText(_translate("MainWindow", "Available Variants")) + self.label_addedvariants.setText(_translate("MainWindow", "Added Variants")) + self.pushButton_variants_add.setText(_translate("MainWindow", ">>")) + self.pushButton_variants_remove.setText(_translate("MainWindow", "Remove")) + self.label_sourcevariantsfile.setText(_translate("MainWindow", "Source File")) + self.tabWidget1.setTabText(self.tabWidget1.indexOf(self.tabWidgetPage_variants), _translate("MainWindow", "Variants")) + self.pushButton_newitem.setText(_translate("MainWindow", "New")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_market_config), _translate("MainWindow", "Market Config")) + self.label_comingsoon.setText(_translate("MainWindow", "

Coming Soon

")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_economy_config), _translate("MainWindow", "Economy Config")) + self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) + self.menu_File.setTitle(_translate("MainWindow", "&File")) + self.menu_Config.setTitle(_translate("MainWindow", "&Utilities")) + self.actionExit.setText(_translate("MainWindow", "E&xit!")) + self.actionConfig.setText(_translate("MainWindow", "Config!")) + self.actionConfig.setToolTip(_translate("MainWindow", "Set Application Configuration")) + self.action_Validate.setText(_translate("MainWindow", "&Validate!")) + self.action_Validate.setToolTip(_translate("MainWindow", "Validate Configurations!")) + + #TODO: Added all code down to Main + pass + + def _closeform(self): + # Save Configuration File Info + + self._parent.close() + + return + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + MainWindow = QtWidgets.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec()) diff --git a/src/forms/mainUI.py b/src/forms/mainUI.py new file mode 100644 index 0000000..708d547 --- /dev/null +++ b/src/forms/mainUI.py @@ -0,0 +1,353 @@ +# Form implementation generated from reading ui file 'mainUI.ui' +# +# Created by: PyQt6 UI code generator 6.4.2 +# +# WARNING: Any manual changes made to this file will be lost when pyuic6 is +# run again. Do not edit this file unless you know what you are doing. + +import os +from PyQt6 import QtCore, QtGui, QtWidgets +#TODO: Added these Additional Imports +from PyQt6.QtWidgets import QFileDialog, QWidget, QMessageBox, QMainWindow + + +#TODO: Changed parent window to QMainWindow from object +class Ui_MainWindow(QMainWindow): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(1076, 813) + #TODO: Added this next line + self._parent = MainWindow + self.centralwidget = QtWidgets.QWidget(parent=MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.tabWidget = QtWidgets.QTabWidget(parent=self.centralwidget) + self.tabWidget.setTabPosition(QtWidgets.QTabWidget.TabPosition.West) + self.tabWidget.setObjectName("tabWidget") + self.tab_market_config = QtWidgets.QWidget() + self.tab_market_config.setObjectName("tab_market_config") + self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_market_config) + self.gridLayout_4.setObjectName("gridLayout_4") + self.label_13 = QtWidgets.QLabel(parent=self.tab_market_config) + self.label_13.setObjectName("label_13") + self.gridLayout_4.addWidget(self.label_13, 0, 0, 1, 1) + self.widget = QtWidgets.QWidget(parent=self.tab_market_config) + self.widget.setObjectName("widget") + self.gridLayout_6 = QtWidgets.QGridLayout(self.widget) + self.gridLayout_6.setObjectName("gridLayout_6") + self.frame = QtWidgets.QFrame(parent=self.widget) + self.frame.setFrameShape(QtWidgets.QFrame.Shape.Box) + self.frame.setObjectName("frame") + self.gridLayout_2 = QtWidgets.QGridLayout(self.frame) + self.gridLayout_2.setObjectName("gridLayout_2") + self.label_className = QtWidgets.QLabel(parent=self.frame) + self.label_className.setObjectName("label_className") + self.gridLayout_2.addWidget(self.label_className, 0, 1, 1, 1) + self.lineEdit_maxstock = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_maxstock.setObjectName("lineEdit_maxstock") + self.gridLayout_2.addWidget(self.lineEdit_maxstock, 2, 2, 1, 1) + self.lineEdit_maxprice = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_maxprice.setObjectName("lineEdit_maxprice") + self.gridLayout_2.addWidget(self.lineEdit_maxprice, 1, 2, 1, 1) + self.lineEdit_classname = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_classname.setObjectName("lineEdit_classname") + self.gridLayout_2.addWidget(self.lineEdit_classname, 0, 2, 1, 3) + self.lineEdit_quantitypercent = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_quantitypercent.setObjectName("lineEdit_quantitypercent") + self.gridLayout_2.addWidget(self.lineEdit_quantitypercent, 3, 4, 1, 1) + self.label_6 = QtWidgets.QLabel(parent=self.frame) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 3, 3, 1, 1) + self.label_minprice = QtWidgets.QLabel(parent=self.frame) + self.label_minprice.setObjectName("label_minprice") + self.gridLayout_2.addWidget(self.label_minprice, 1, 3, 1, 1) + self.lineEdit_sellpricepercent = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_sellpricepercent.setObjectName("lineEdit_sellpricepercent") + self.gridLayout_2.addWidget(self.lineEdit_sellpricepercent, 3, 2, 1, 1) + self.pushButton_searchclasses = QtWidgets.QPushButton(parent=self.frame) + self.pushButton_searchclasses.setObjectName("pushButton_searchclasses") + self.gridLayout_2.addWidget(self.pushButton_searchclasses, 0, 5, 1, 1) + self.label_sellpricepercent = QtWidgets.QLabel(parent=self.frame) + self.label_sellpricepercent.setObjectName("label_sellpricepercent") + self.gridLayout_2.addWidget(self.label_sellpricepercent, 3, 1, 1, 1) + self.lineEdit_minprice = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_minprice.setObjectName("lineEdit_minprice") + self.gridLayout_2.addWidget(self.lineEdit_minprice, 1, 4, 1, 1) + self.label_5 = QtWidgets.QLabel(parent=self.frame) + self.label_5.setObjectName("label_5") + self.gridLayout_2.addWidget(self.label_5, 2, 3, 1, 1) + self.label_maxprice = QtWidgets.QLabel(parent=self.frame) + self.label_maxprice.setObjectName("label_maxprice") + self.gridLayout_2.addWidget(self.label_maxprice, 1, 1, 1, 1) + self.lineEdit_minstock = QtWidgets.QLineEdit(parent=self.frame) + self.lineEdit_minstock.setObjectName("lineEdit_minstock") + self.gridLayout_2.addWidget(self.lineEdit_minstock, 2, 4, 1, 1) + self.label_maxstock = QtWidgets.QLabel(parent=self.frame) + self.label_maxstock.setObjectName("label_maxstock") + self.gridLayout_2.addWidget(self.label_maxstock, 2, 1, 1, 1) + self.gridLayout_6.addWidget(self.frame, 0, 0, 1, 1) + self.tabWidget1 = QtWidgets.QTabWidget(parent=self.widget) + self.tabWidget1.setObjectName("tabWidget1") + self.tabWidgetPage_attachments = QtWidgets.QWidget() + self.tabWidgetPage_attachments.setObjectName("tabWidgetPage_attachments") + self.gridLayout_8 = QtWidgets.QGridLayout(self.tabWidgetPage_attachments) + self.gridLayout_8.setObjectName("gridLayout_8") + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.label_sourceattachfile = QtWidgets.QLabel(parent=self.tabWidgetPage_attachments) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_sourceattachfile.sizePolicy().hasHeightForWidth()) + self.label_sourceattachfile.setSizePolicy(sizePolicy) + self.label_sourceattachfile.setMaximumSize(QtCore.QSize(16777215, 61)) + self.label_sourceattachfile.setObjectName("label_sourceattachfile") + self.horizontalLayout_5.addWidget(self.label_sourceattachfile) + self.comboBox_attachfile_source = QtWidgets.QComboBox(parent=self.tabWidgetPage_attachments) + self.comboBox_attachfile_source.setObjectName("comboBox_attachfile_source") + self.horizontalLayout_5.addWidget(self.comboBox_attachfile_source) + self.gridLayout_8.addLayout(self.horizontalLayout_5, 0, 0, 1, 1) + self.frame_attachments = QtWidgets.QFrame(parent=self.tabWidgetPage_attachments) + self.frame_attachments.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.frame_attachments.setLineWidth(1) + self.frame_attachments.setObjectName("frame_attachments") + self.gridLayout_3 = QtWidgets.QGridLayout(self.frame_attachments) + self.gridLayout_3.setObjectName("gridLayout_3") + self.label_availattach = QtWidgets.QLabel(parent=self.frame_attachments) + self.label_availattach.setObjectName("label_availattach") + self.gridLayout_3.addWidget(self.label_availattach, 0, 0, 1, 1) + self.label_addedattach = QtWidgets.QLabel(parent=self.frame_attachments) + self.label_addedattach.setObjectName("label_addedattach") + self.gridLayout_3.addWidget(self.label_addedattach, 0, 2, 1, 1) + self.listWidget_attachments_available = QtWidgets.QListWidget(parent=self.frame_attachments) + self.listWidget_attachments_available.setObjectName("listWidget_attachments_available") + self.gridLayout_3.addWidget(self.listWidget_attachments_available, 1, 0, 1, 1) + self.pushButton_attachment_add = QtWidgets.QPushButton(parent=self.frame_attachments) + self.pushButton_attachment_add.setObjectName("pushButton_attachment_add") + self.gridLayout_3.addWidget(self.pushButton_attachment_add, 1, 1, 1, 1, QtCore.Qt.AlignmentFlag.AlignTop) + self.listWidget_attachments_added = QtWidgets.QListWidget(parent=self.frame_attachments) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listWidget_attachments_added.sizePolicy().hasHeightForWidth()) + self.listWidget_attachments_added.setSizePolicy(sizePolicy) + self.listWidget_attachments_added.setObjectName("listWidget_attachments_added") + self.gridLayout_3.addWidget(self.listWidget_attachments_added, 1, 2, 1, 1) + self.pushButton_attachment_remove = QtWidgets.QPushButton(parent=self.frame_attachments) + self.pushButton_attachment_remove.setObjectName("pushButton_attachment_remove") + self.gridLayout_3.addWidget(self.pushButton_attachment_remove, 2, 2, 1, 1) + self.gridLayout_8.addWidget(self.frame_attachments, 1, 0, 1, 1) + self.tabWidget1.addTab(self.tabWidgetPage_attachments, "") + self.tabWidgetPage_variants = QtWidgets.QWidget() + self.tabWidgetPage_variants.setObjectName("tabWidgetPage_variants") + self.gridLayout_7 = QtWidgets.QGridLayout(self.tabWidgetPage_variants) + self.gridLayout_7.setObjectName("gridLayout_7") + self.frame_variants = QtWidgets.QFrame(parent=self.tabWidgetPage_variants) + self.frame_variants.setFrameShape(QtWidgets.QFrame.Shape.Panel) + self.frame_variants.setLineWidth(1) + self.frame_variants.setObjectName("frame_variants") + self.gridLayout_5 = QtWidgets.QGridLayout(self.frame_variants) + self.gridLayout_5.setObjectName("gridLayout_5") + self.label_availvariants = QtWidgets.QLabel(parent=self.frame_variants) + self.label_availvariants.setObjectName("label_availvariants") + self.gridLayout_5.addWidget(self.label_availvariants, 0, 0, 1, 1) + self.label_addedvariants = QtWidgets.QLabel(parent=self.frame_variants) + self.label_addedvariants.setObjectName("label_addedvariants") + self.gridLayout_5.addWidget(self.label_addedvariants, 0, 2, 1, 1) + self.listWidget_variants_available = QtWidgets.QListWidget(parent=self.frame_variants) + self.listWidget_variants_available.setObjectName("listWidget_variants_available") + self.gridLayout_5.addWidget(self.listWidget_variants_available, 1, 0, 1, 1) + self.pushButton_variants_add = QtWidgets.QPushButton(parent=self.frame_variants) + self.pushButton_variants_add.setObjectName("pushButton_variants_add") + self.gridLayout_5.addWidget(self.pushButton_variants_add, 1, 1, 1, 1, QtCore.Qt.AlignmentFlag.AlignTop) + self.listWidget_variants_added = QtWidgets.QListWidget(parent=self.frame_variants) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.listWidget_variants_added.sizePolicy().hasHeightForWidth()) + self.listWidget_variants_added.setSizePolicy(sizePolicy) + self.listWidget_variants_added.setObjectName("listWidget_variants_added") + self.gridLayout_5.addWidget(self.listWidget_variants_added, 1, 2, 1, 1) + self.pushButton_variants_remove = QtWidgets.QPushButton(parent=self.frame_variants) + self.pushButton_variants_remove.setObjectName("pushButton_variants_remove") + self.gridLayout_5.addWidget(self.pushButton_variants_remove, 2, 2, 1, 1) + self.gridLayout_7.addWidget(self.frame_variants, 1, 0, 1, 1) + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + self.label_sourcevariantsfile = QtWidgets.QLabel(parent=self.tabWidgetPage_variants) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.label_sourcevariantsfile.sizePolicy().hasHeightForWidth()) + self.label_sourcevariantsfile.setSizePolicy(sizePolicy) + self.label_sourcevariantsfile.setMaximumSize(QtCore.QSize(16777215, 61)) + self.label_sourcevariantsfile.setObjectName("label_sourcevariantsfile") + self.horizontalLayout_6.addWidget(self.label_sourcevariantsfile) + self.comboBox_variantsfile_source = QtWidgets.QComboBox(parent=self.tabWidgetPage_variants) + self.comboBox_variantsfile_source.setObjectName("comboBox_variantsfile_source") + self.horizontalLayout_6.addWidget(self.comboBox_variantsfile_source) + self.gridLayout_7.addLayout(self.horizontalLayout_6, 0, 0, 1, 1) + self.tabWidget1.addTab(self.tabWidgetPage_variants, "") + self.gridLayout_6.addWidget(self.tabWidget1, 1, 0, 1, 1) + self.pushButton_newitem = QtWidgets.QPushButton(parent=self.widget) + self.pushButton_newitem.setObjectName("pushButton_newitem") + self.gridLayout_6.addWidget(self.pushButton_newitem, 2, 0, 1, 1) + self.gridLayout_4.addWidget(self.widget, 0, 1, 3, 1) + self.comboBox_market_filename = QtWidgets.QComboBox(parent=self.tab_market_config) + self.comboBox_market_filename.setObjectName("comboBox_market_filename") + self.gridLayout_4.addWidget(self.comboBox_market_filename, 1, 0, 1, 1) + self.treeView = QtWidgets.QTreeView(parent=self.tab_market_config) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Maximum, QtWidgets.QSizePolicy.Policy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.treeView.sizePolicy().hasHeightForWidth()) + self.treeView.setSizePolicy(sizePolicy) + self.treeView.setObjectName("treeView") + self.gridLayout_4.addWidget(self.treeView, 2, 0, 1, 1) + self.tabWidget.addTab(self.tab_market_config, "") + self.tab_economy_config = QtWidgets.QWidget() + self.tab_economy_config.setObjectName("tab_economy_config") + self.label_comingsoon = QtWidgets.QLabel(parent=self.tab_economy_config) + self.label_comingsoon.setGeometry(QtCore.QRect(360, 300, 321, 71)) + self.label_comingsoon.setObjectName("label_comingsoon") + self.tabWidget.addTab(self.tab_economy_config, "") + self.gridLayout.addWidget(self.tabWidget, 0, 0, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.statusbar = QtWidgets.QStatusBar(parent=MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.toolBar = QtWidgets.QToolBar(parent=MainWindow) + self.toolBar.setMovable(True) + self.toolBar.setObjectName("toolBar") + MainWindow.addToolBar(QtCore.Qt.ToolBarArea.TopToolBarArea, self.toolBar) + self.menuBar = QtWidgets.QMenuBar(parent=MainWindow) + self.menuBar.setGeometry(QtCore.QRect(0, 0, 1076, 24)) + self.menuBar.setObjectName("menuBar") + self.menu_File = QtWidgets.QMenu(parent=self.menuBar) + self.menu_File.setObjectName("menu_File") + self.menu_Config = QtWidgets.QMenu(parent=self.menuBar) + self.menu_Config.setObjectName("menu_Config") + MainWindow.setMenuBar(self.menuBar) + self.actionExit = QtGui.QAction(parent=MainWindow) + icon = QtGui.QIcon() + #TODO: Updated path for config + icon.addPixmap(QtGui.QPixmap(f"{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}/config/resources/cross-script.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionExit.setIcon(icon) + self.actionExit.setObjectName("actionExit") + self.actionConfig = QtGui.QAction(parent=MainWindow) + icon1 = QtGui.QIcon() + #TODO: Updated path for config + icon1.addPixmap(QtGui.QPixmap(f"{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}/config/resources/blue-folder--pencil.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.actionConfig.setIcon(icon1) + self.actionConfig.setObjectName("actionConfig") + self.action_Validate = QtGui.QAction(parent=MainWindow) + icon2 = QtGui.QIcon() + #TODO: Updated path for config + icon2.addPixmap(QtGui.QPixmap(f"{os.path.dirname(os.path.dirname(os.path.realpath(__file__)))}/config/resources/chart-up-color.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off) + self.action_Validate.setIcon(icon2) + self.action_Validate.setObjectName("action_Validate") + self.toolBar.addAction(self.actionExit) + self.toolBar.addAction(self.actionConfig) + self.toolBar.addAction(self.action_Validate) + self.menu_File.addAction(self.actionExit) + self.menu_Config.addAction(self.actionConfig) + self.menu_Config.addAction(self.action_Validate) + self.menuBar.addAction(self.menu_File.menuAction()) + self.menuBar.addAction(self.menu_Config.menuAction()) + + self.retranslateUi(MainWindow) + + # TODO: Added All the Push Button Responses + self.actionExit.triggered.connect(self._closeform) + # self.pushButton_ProfileLocation.clicked['bool'].connect(self._getProfileLocation) # type: ignore + # self.pushButton_marketdirectory.clicked['bool'].connect(self._getMarketLocation) # type: ignore + # self.pushButton_tradersdirectory.clicked['bool'].connect(self._getTraderLocation) # type: ignore + # self.pushButton_addJSON.clicked['bool'].connect(self._addJSONLocation) # type: ignore + # self.pushButton_removeJSON.clicked['bool'].connect(self._removeJSONLocation) # type: ignore + # self.pushButton_addXML.clicked['bool'].connect(self._addXMLLocation) # type: ignore + # self.pushButton_removeXML.clicked['bool'].connect(self._removeXMLLocation) # type: ignore + # self.pushButton_Close.clicked['bool'].connect(self._closeForm) # type: ignore + + self.tabWidget.setCurrentIndex(0) + self.tabWidget1.setCurrentIndex(1) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + MainWindow.setTabOrder(self.comboBox_market_filename, self.treeView) + MainWindow.setTabOrder(self.treeView, self.lineEdit_classname) + MainWindow.setTabOrder(self.lineEdit_classname, self.pushButton_searchclasses) + MainWindow.setTabOrder(self.pushButton_searchclasses, self.lineEdit_maxprice) + MainWindow.setTabOrder(self.lineEdit_maxprice, self.lineEdit_minprice) + MainWindow.setTabOrder(self.lineEdit_minprice, self.lineEdit_maxstock) + MainWindow.setTabOrder(self.lineEdit_maxstock, self.lineEdit_minstock) + MainWindow.setTabOrder(self.lineEdit_minstock, self.lineEdit_sellpricepercent) + MainWindow.setTabOrder(self.lineEdit_sellpricepercent, self.lineEdit_quantitypercent) + MainWindow.setTabOrder(self.lineEdit_quantitypercent, self.tabWidget) + MainWindow.setTabOrder(self.tabWidget, self.comboBox_attachfile_source) + MainWindow.setTabOrder(self.comboBox_attachfile_source, self.listWidget_attachments_available) + MainWindow.setTabOrder(self.listWidget_attachments_available, self.pushButton_attachment_add) + MainWindow.setTabOrder(self.pushButton_attachment_add, self.listWidget_attachments_added) + MainWindow.setTabOrder(self.listWidget_attachments_added, self.pushButton_attachment_remove) + MainWindow.setTabOrder(self.pushButton_attachment_remove, self.comboBox_variantsfile_source) + MainWindow.setTabOrder(self.comboBox_variantsfile_source, self.listWidget_variants_available) + MainWindow.setTabOrder(self.listWidget_variants_available, self.pushButton_variants_add) + MainWindow.setTabOrder(self.pushButton_variants_add, self.listWidget_variants_added) + MainWindow.setTabOrder(self.listWidget_variants_added, self.pushButton_variants_remove) + MainWindow.setTabOrder(self.pushButton_variants_remove, self.pushButton_newitem) + MainWindow.setTabOrder(self.pushButton_newitem, self.tabWidget) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + #TODO: Changed the WindowTitle + MainWindow.setWindowTitle(_translate("MainWindow", "DayZ Admin Tool Manager")) + self.label_13.setText(_translate("MainWindow", "Market File Name")) + self.label_className.setText(_translate("MainWindow", "ClassName:")) + self.label_6.setText(_translate("MainWindow", "Quantity %:")) + self.label_minprice.setText(_translate("MainWindow", "Min Price:")) + self.pushButton_searchclasses.setText(_translate("MainWindow", "...")) + self.label_sellpricepercent.setText(_translate("MainWindow", "Sell Price %:")) + self.label_5.setText(_translate("MainWindow", "Min Stock:")) + self.label_maxprice.setText(_translate("MainWindow", "Max Price:")) + self.label_maxstock.setText(_translate("MainWindow", "Max Stock:")) + self.label_sourceattachfile.setText(_translate("MainWindow", "Source File")) + self.label_availattach.setText(_translate("MainWindow", "Available Attachments")) + self.label_addedattach.setText(_translate("MainWindow", "Added Attachments")) + self.pushButton_attachment_add.setText(_translate("MainWindow", ">>")) + self.pushButton_attachment_remove.setText(_translate("MainWindow", "Remove")) + self.tabWidget1.setTabText(self.tabWidget1.indexOf(self.tabWidgetPage_attachments), _translate("MainWindow", "Attachments")) + self.label_availvariants.setText(_translate("MainWindow", "Available Variants")) + self.label_addedvariants.setText(_translate("MainWindow", "Added Variants")) + self.pushButton_variants_add.setText(_translate("MainWindow", ">>")) + self.pushButton_variants_remove.setText(_translate("MainWindow", "Remove")) + self.label_sourcevariantsfile.setText(_translate("MainWindow", "Source File")) + self.tabWidget1.setTabText(self.tabWidget1.indexOf(self.tabWidgetPage_variants), _translate("MainWindow", "Variants")) + self.pushButton_newitem.setText(_translate("MainWindow", "&New")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_market_config), _translate("MainWindow", "Market Config")) + self.label_comingsoon.setText(_translate("MainWindow", "

Coming Soon

")) + self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_economy_config), _translate("MainWindow", "Economy Config")) + self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) + self.menu_File.setTitle(_translate("MainWindow", "&File")) + self.menu_Config.setTitle(_translate("MainWindow", "&Utilities")) + self.actionExit.setText(_translate("MainWindow", "E&xit!")) + self.actionConfig.setText(_translate("MainWindow", "Config!")) + self.actionConfig.setToolTip(_translate("MainWindow", "Set Application Configuration")) + self.action_Validate.setText(_translate("MainWindow", "&Validate!")) + self.action_Validate.setToolTip(_translate("MainWindow", "Validate Configurations!")) + + #TODO: Added all code down to Main + pass + + def _closeform(self): + # Save Configuration File Info + + self._parent.close() + + return + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + MainWindow = QtWidgets.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec()) diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..9242e12 --- /dev/null +++ b/src/main.py @@ -0,0 +1,13 @@ +from PyQt6 import QtCore, QtGui, QtWidgets +#TODO: Added these Additional Imports +from PyQt6.QtWidgets import QFileDialog, QWidget, QMessageBox, QMainWindow +from src.forms import mainUI + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + MainWindow = QtWidgets.QMainWindow() + ui = mainUI.Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec()) \ No newline at end of file diff --git a/app/app.py b/src/qt.py similarity index 95% rename from app/app.py rename to src/qt.py index b8ff1f8..45a850c 100644 --- a/app/app.py +++ b/src/qt.py @@ -3,9 +3,10 @@ from standalone.types_loader import load_profiles from PyQt6.QtWidgets import QApplication, QMainWindow from dayz_admin_tools.utilities.economy.Types import Types -from config import config -import mainConfig +from src.config import config +from src.forms import mainConfig + import sys _profiles_directory = "" diff --git a/standalone/airdrop_loader.py b/standalone/airdrop_loader.py index 089a2a4..285e231 100644 --- a/standalone/airdrop_loader.py +++ b/standalone/airdrop_loader.py @@ -1,4 +1,4 @@ -from app.config import config +from src.config import config import json from jsonpath_ng import jsonpath from jsonpath_ng.ext import parser as json_parser