Update UI.py and UtilPack.py
This commit is contained in:
24
UI.py
24
UI.py
@@ -20,6 +20,10 @@ class MyApp(QMainWindow):
|
||||
def closeEvent(self, event):
|
||||
self.saveINI()
|
||||
event.accept()
|
||||
|
||||
def resizeEvent(self, event):
|
||||
self.GetFitSize(self.label_Image.size())
|
||||
print( self.label_Image.size() )
|
||||
|
||||
|
||||
def initUI(self):
|
||||
@@ -101,6 +105,13 @@ class MyApp(QMainWindow):
|
||||
|
||||
return layout
|
||||
|
||||
def GetFitSize(self, szTarget):
|
||||
szDesktop = self.screen().size()
|
||||
szWindow = self.size()
|
||||
|
||||
print(f"{szDesktop}, {szWindow}")
|
||||
|
||||
|
||||
|
||||
def on_click_SrcAdd(self):
|
||||
# 폴더 선택 창을 띄움
|
||||
@@ -115,6 +126,9 @@ class MyApp(QMainWindow):
|
||||
# 폴더 내의 자식 폴더 목록을 가져온다.
|
||||
listFolders = util.ListSubDirectories(folder_path)
|
||||
|
||||
# 선택한 폴더도 리스트에 추가한다.
|
||||
listFolders.append(folder_path)
|
||||
|
||||
for folder in listFolders:
|
||||
# 폴더 내의 파일 목록을 가져온다.
|
||||
listFiles = util.ListContainFiles(folder)
|
||||
@@ -156,7 +170,9 @@ class MyApp(QMainWindow):
|
||||
if not items:
|
||||
return
|
||||
|
||||
selItemText = ""
|
||||
for item in items:
|
||||
selItemText = item.text()
|
||||
row = self.list_SrcPath.row(item)
|
||||
self.list_SrcPath.takeItem(row)
|
||||
|
||||
@@ -184,19 +200,16 @@ class MyApp(QMainWindow):
|
||||
# 일단 zip 만...
|
||||
if fileExt.lower() in [".zip", ".cbz"]:
|
||||
listContents = util.GetZipContentList(pathTarget)
|
||||
print("zip")
|
||||
elif fileExt.lower() == ".rar":
|
||||
listContents = []
|
||||
elif True == os.path.isdir(pathTarget):
|
||||
print("folder")
|
||||
listContents = util.ListFileExtRcr(pathTarget, [".jpg", ".jpeg", ".png", ".webp"])
|
||||
|
||||
|
||||
self.list_Infos.addItem( QListWidgetItem(pathTarget) )
|
||||
self.list_Infos.addItem( QListWidgetItem( f"{len(listContents)}" ) )
|
||||
|
||||
self.list_Items.clear()
|
||||
self.list_Items.addItems( listContents )
|
||||
self.list_Items.addItems( sorted( listContents ) )
|
||||
|
||||
|
||||
def on_Item_SelChanged_Items(self):
|
||||
@@ -216,13 +229,10 @@ class MyApp(QMainWindow):
|
||||
elif True == os.path.isdir(pathTarget):
|
||||
if True == os.path.exists(selItemText):
|
||||
pixmap.load(selItemText)
|
||||
|
||||
szLabel = self.label_Image.size()
|
||||
|
||||
self.label_Image.setPixmap(pixmap)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user