Update MgrCalibreDB.py, UI.py, and 4 more files...
This commit is contained in:
42
UI.py
42
UI.py
@@ -3,6 +3,7 @@ import os
|
||||
import UtilPack as util
|
||||
import MgrCalibreDB as calDB
|
||||
import MgrCalibreLibs as calLib
|
||||
import pupildata as pupil
|
||||
|
||||
from io import BytesIO
|
||||
|
||||
@@ -13,6 +14,7 @@ from PyQt5.QtGui import QPixmap, QKeyEvent
|
||||
QApplication.setAttribute(Qt.AA_ShareOpenGLContexts)
|
||||
|
||||
class MyApp(QMainWindow):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.initUI()
|
||||
@@ -25,8 +27,7 @@ class MyApp(QMainWindow):
|
||||
|
||||
|
||||
def resizeEvent(self, event):
|
||||
self.GetFitSize(self.label_Image.size())
|
||||
print( self.label_Image.size() )
|
||||
super().resizeEvent(event)
|
||||
|
||||
|
||||
def initUI(self):
|
||||
@@ -58,8 +59,6 @@ class MyApp(QMainWindow):
|
||||
|
||||
def MakeUI_Left(self):
|
||||
self.list_SrcPath = QListWidget()
|
||||
self.list_SrcPath.setMaximumHeight(400)
|
||||
self.list_SrcPath.setMaximumWidth(300)
|
||||
|
||||
btn_Add = QPushButton("Add", self)
|
||||
btn_Add.clicked.connect(self.on_click_SrcAdd)
|
||||
@@ -88,6 +87,20 @@ class MyApp(QMainWindow):
|
||||
return layout
|
||||
|
||||
|
||||
def MakeUI_Right(self):
|
||||
self.list_Items = QListWidget(self)
|
||||
self.list_Items.setFixedWidth(300)
|
||||
self.list_Items.itemSelectionChanged.connect(self.on_Item_SelChanged_Items)
|
||||
|
||||
self.list_BookDetail = QListWidget(self)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.addWidget(self.list_Items, stretch = 2)
|
||||
layout.addWidget(self.list_BookDetail, stretch = 1)
|
||||
|
||||
return layout
|
||||
|
||||
|
||||
def MakeUI(self):
|
||||
layout_L = self.MakeUI_Left()
|
||||
|
||||
@@ -98,15 +111,13 @@ class MyApp(QMainWindow):
|
||||
pixmap = QPixmap("layoutImg.jpeg")
|
||||
self.label_Image.setMaximumWidth(self.screen().size().width()-(self.list_ArcList.width()+400))
|
||||
|
||||
self.list_Items = QListWidget(self)
|
||||
self.list_Items.setFixedWidth(300)
|
||||
self.list_Items.itemSelectionChanged.connect(self.on_Item_SelChanged_Items)
|
||||
layout_R = self.MakeUI_Right()
|
||||
|
||||
# 레이아웃 설정
|
||||
layout = QHBoxLayout()
|
||||
layout.addLayout(layout_L)
|
||||
layout.addWidget(self.label_Image)
|
||||
layout.addWidget(self.list_Items)
|
||||
layout.addLayout(layout_L, stretch = 1)
|
||||
layout.addWidget(self.label_Image, stretch= 4)
|
||||
layout.addLayout(layout_R, stretch = 1)
|
||||
|
||||
return layout
|
||||
|
||||
@@ -215,7 +226,6 @@ class MyApp(QMainWindow):
|
||||
for item in items:
|
||||
pathTarget = item.data(Qt.UserRole)
|
||||
|
||||
print(pathTarget)
|
||||
if None == pathTarget or False == os.path.exists(pathTarget):
|
||||
return
|
||||
|
||||
@@ -226,6 +236,14 @@ class MyApp(QMainWindow):
|
||||
# 일단 zip 만...
|
||||
if fileExt.lower() in [".zip", ".cbz"]:
|
||||
listContents = util.GetZipContentList(pathTarget)
|
||||
|
||||
for item in listContents:
|
||||
if ".metadata" in item:
|
||||
pBytes = util.GetZippedFileByte(pathTarget, item)
|
||||
print(pBytes.decode("utf-8"))
|
||||
pupildata = pupil.PupuilInfoFile(pBytes.decode("utf-8"))
|
||||
print(pupildata.GetInfo())
|
||||
|
||||
elif fileExt.lower() == ".rar":
|
||||
listContents = []
|
||||
elif True == os.path.isdir(pathTarget):
|
||||
@@ -257,6 +275,8 @@ class MyApp(QMainWindow):
|
||||
pixmap.load(selItemText)
|
||||
|
||||
self.label_Image.setPixmap(pixmap)
|
||||
scaled_pixmap = pixmap.scaled(self.label_Image.size(), Qt.KeepAspectRatio, Qt.SmoothTransformation)
|
||||
self.label_Image.setPixmap(scaled_pixmap)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user