Update MgrCalibreDB.py and UI.py
This commit is contained in:
19
UI.py
19
UI.py
@@ -1,6 +1,8 @@
|
||||
import sys
|
||||
import os
|
||||
import UtilPack as util
|
||||
import MgrCalibreDB as calDB
|
||||
import MgrCalibreLibs as calLib
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
@@ -21,6 +23,7 @@ class MyApp(QMainWindow):
|
||||
self.saveINI()
|
||||
event.accept()
|
||||
|
||||
|
||||
def resizeEvent(self, event):
|
||||
self.GetFitSize(self.label_Image.size())
|
||||
print( self.label_Image.size() )
|
||||
@@ -107,6 +110,7 @@ class MyApp(QMainWindow):
|
||||
|
||||
return layout
|
||||
|
||||
|
||||
def GetFitSize(self, szTarget):
|
||||
szDesktop = self.screen().size()
|
||||
szWindow = self.size()
|
||||
@@ -115,8 +119,6 @@ class MyApp(QMainWindow):
|
||||
nTrgWidth = szWindow.width() - ( self.list_ArcList.width() + self.list_Items.width() )
|
||||
|
||||
|
||||
|
||||
|
||||
def on_click_SrcAdd(self):
|
||||
# 폴더 선택 창을 띄움
|
||||
folder_path = QFileDialog.getExistingDirectory(self, '폴더 선택', '')
|
||||
@@ -163,8 +165,16 @@ class MyApp(QMainWindow):
|
||||
ItemName = os.path.join(FolderName, filename)
|
||||
item = QListWidgetItem(ItemName)
|
||||
# 전체 경로를 따로 저장
|
||||
item.setData(Qt.UserRole, pathFile)
|
||||
self.list_ArcList.addItem(item)
|
||||
#item.setData(Qt.UserRole, pathFile)
|
||||
#self.list_ArcList.addItem(item)
|
||||
print(pathFile)
|
||||
db = calDB.MgrCalibreDB(pathFile)
|
||||
db.init()
|
||||
listBooks = db.GetBookListforUI_ArcList()
|
||||
for book in listBooks:
|
||||
item.setData(Qt.UserRole, book[1])
|
||||
self.list_ArcList.addItem(book[0])
|
||||
|
||||
|
||||
# 이미지 파일이 들어있다면...
|
||||
if fileExt.lower() in [".jpg", ".webp", ".jpeg", ".png", ".gif"]:
|
||||
@@ -205,6 +215,7 @@ class MyApp(QMainWindow):
|
||||
for item in items:
|
||||
pathTarget = item.data(Qt.UserRole)
|
||||
|
||||
print(f"arc : {pathTarget}")
|
||||
if False == os.path.exists(pathTarget):
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user