def openFile(self): fd = QFileDialog() f_dir = fd.getOpenFileName(self, "Install Mod", expanduser("~"), "(*.rar *.zip *.7z)") if f_dir[0] != "": sig.status_bar_message.emit("Installing Mod") modinstaller.install(f_dir[0]) sig.status_bar_message.emit( "New Installed Mod will only be shown after restart") self.close()
def openFolder(self): fd = QFileDialog() f_dir = fd.getExistingDirectory(self, "Install Mod", expanduser("~"), fd.ShowDirsOnly) if f_dir != "": sig.status_bar_message.emit("Installing Mod") modinstaller.install(f_dir) sig.status_bar_message.emit( "New Installed Mod will only be shown after restart") self.close()
def dropEvent(self, event): if event.mimeData().hasUrls: event.setDropAction(Qt.CopyAction) event.accept() links = [] for url in event.mimeData().urls(): if url.isLocalFile(): links.append(os.path.normpath(url.toLocalFile())) a = False for link in links: sig.status_bar_message.emit("Installing Mod") modinstaller.install(link) a = True if a: sig.status_bar_message.emit( "New Installed Mod will only be shown after restart") else: event.ignore() self.close()