-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexportingWindow.py
More file actions
54 lines (47 loc) · 1.73 KB
/
exportingWindow.py
File metadata and controls
54 lines (47 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from uip import ui_exportingWindow
from PySide6 import QtWidgets
import os
class ExportingWindow(ui_exportingWindow.Ui_Dialog, QtWidgets.QDialog):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setupUi(self)
self.progressBar.setRange(0, 100)
def setValue(self, now: int, all: int, text: str):
if now != None:
self.label_exported_num.setText(str(now))
if all != None:
self.label_allNum.setText(str(all))
if now != None and all != None:
percent = now / all * 100
self.progressBar.setValue(int(percent))
self.label_fileName.setText(text)
if text == "Finished Exporting":
self.buttonBox.buttons()[0].setText("OK")
os.system(
f'explorer.exe /Select,"{self.parent().lineEdit.text()}"'
) # 打开文件夹
def stop(self):
is_ok = (
QtWidgets.QMessageBox.question(
self,
"Cancel Exporting",
"Cancelling Exporting is not supported in Asset Ripper.You need to restart the application after cancelling,are you sure?",
)
== 16384
)
if is_ok and self.parent():
self.close()
self.parent().close()
self.parent().parent().close()
return is_ok
def reject(self):
if self.label_fileName.text() == "Finished Exporting":
return super().reject()
if not self.stop():
return False
return super().reject()
if __name__ == "__main__":
qa = QtWidgets.QApplication(list())
ew = ExportingWindow()
ew.show()
qa.exec()