Skip to content

Commit

Permalink
fix installer not launching
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Sep 3, 2024
1 parent 24c92b8 commit 0b2f436
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
8 changes: 5 additions & 3 deletions src/Backendhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ def enableCorrectBackends(self):
self.parent.downloadTensorRTBtn.setEnabled(False)

#disable as it is not complete
self.parent.downloadDirectMLBtn.setEnabled(False)
if getPlatform() != "win32":
try:
self.parent.downloadDirectMLBtn.setEnabled(False)

if getPlatform() != "win32":
self.parent.downloadDirectMLBtn.setEnabled(False)
except Exception as e:
print(e)
def setupBackendDeps(self):
# need pop up window
from .DownloadDeps import DownloadDependencies
Expand Down
53 changes: 35 additions & 18 deletions src/ui/QTcustom.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,16 @@ def __init__(
directmlBtnFunc=None,
):
super().__init__()
self.setupUi(self)
self.setupUi()
self.closeEventOrig = self.closeEvent
self.closeEvent = self.closeEventExit
# pair btns
self.downloadDirectMLBtn.clicked.connect(directmlBtnFunc)
self.downloadNCNNBtn.clicked.connect(ncnnDownloadBtnFunc)
self.downloadTorchCUDABtn.clicked.connect(pytorchCUDABtnFunc)
self.downloadTorchROCmBtn.clicked.connect(pytorchROCMBtnFunc)
self.downloadTensorRTBtn.clicked.connect(trtBtnFunc)
self.downloadDirectMLBtn.clicked.connect(directmlBtnFunc)

self.pushButton.clicked.connect(self.doneEvent)
self.setStyleSheet(styleSheet())
self.setWindowTitle("Select Dependencies")
Expand All @@ -465,11 +466,34 @@ def closeEventExit(self, x):
def doneEvent(self):
self.closeEventOrig(QtGui.QCloseEvent())

def setupUi(self, Dialog):
self.verticalLayout = QVBoxLayout(self)
self.verticalLayout.setObjectName("verticalLayout")
def setupUi(self):
self.backendSelectContainer = QWidget(self)
self.backendSelectContainer.setObjectName("backendSelectContainer")
self.pytorchBackendInstallerContainer_5 = QWidget(self.backendSelectContainer)
self.pytorchBackendInstallerContainer_5.setObjectName(
"pytorchBackendInstallerContainer_4"
)
self.downloadDirectMLBtn = QPushButton(self.pytorchBackendInstallerContainer_5)
icon = QIcon()
icon.addFile(":/icons/icons/download.svg", QSize(), QIcon.Normal, QIcon.Off)


sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)


self.downloadDirectMLBtn.setObjectName("downloadDirectMLBtn")
sizePolicy.setHeightForWidth(
self.downloadDirectMLBtn.sizePolicy().hasHeightForWidth()
)
self.downloadDirectMLBtn.setSizePolicy(sizePolicy)
self.downloadDirectMLBtn.setMaximumSize(QSize(50, 16777215))
self.downloadDirectMLBtn.setIcon(icon)
self.downloadDirectMLBtn.setIconSize(QSize(30, 30))
self.verticalLayout = QVBoxLayout(self)
self.verticalLayout.setObjectName("verticalLayout")

self.verticalLayout_11 = QVBoxLayout(self.backendSelectContainer)
self.verticalLayout_11.setObjectName("verticalLayout_11")
self.label_4 = QLabel(self.backendSelectContainer)
Expand All @@ -496,9 +520,13 @@ def setupUi(self, Dialog):
)
self.downloadTorchCUDABtn.setSizePolicy(sizePolicy)
self.downloadTorchCUDABtn.setMaximumSize(QSize(50, 16777215))
sizePolicy.setHeightForWidth(
self.downloadTorchCUDABtn.sizePolicy().hasHeightForWidth()
)
icon = QIcon()
icon.addFile(":/icons/icons/download.svg", QSize(), QIcon.Normal, QIcon.Off)
self.downloadTorchCUDABtn.setIcon(icon)

self.downloadTorchCUDABtn.setIconSize(QSize(30, 30))

self.horizontalLayout_6.addWidget(self.downloadTorchCUDABtn)
Expand Down Expand Up @@ -584,21 +612,10 @@ def setupUi(self, Dialog):
self.label_10.setObjectName("label_10")
self.horizontalLayout_10.addWidget(self.label_10)

self.pytorchBackendInstallerContainer_5 = QWidget(self.backendSelectContainer)
self.pytorchBackendInstallerContainer_5.setObjectName(
"pytorchBackendInstallerContainer_4"
)

self.horizontalLayout_11 = QHBoxLayout(self.pytorchBackendInstallerContainer_5)
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
self.downloadDirectMLBtn = QPushButton(self.pytorchBackendInstallerContainer_5)
self.downloadDirectMLBtn.setObjectName("downloadDirectMLBtn")
sizePolicy.setHeightForWidth(
self.downloadDirectMLBtn.sizePolicy().hasHeightForWidth()
)
self.downloadDirectMLBtn.setSizePolicy(sizePolicy)
self.downloadDirectMLBtn.setMaximumSize(QSize(50, 16777215))
self.downloadDirectMLBtn.setIcon(icon)
self.downloadDirectMLBtn.setIconSize(QSize(30, 30))


self.horizontalLayout_11.addWidget(self.downloadDirectMLBtn)

Expand Down

0 comments on commit 0b2f436

Please sign in to comment.