Skip to content

Commit

Permalink
Merge pull request #11 from JeffersonQin/main
Browse files Browse the repository at this point in the history
增加功能以及Bug修复
  • Loading branch information
tonquer authored May 11, 2021
2 parents 2e87055 + 936c3bf commit 63b4516
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,9 @@ dmypy.json

# Pyre type checker
.pyre/

# Cache Files for picacg
cache/
config.ini
download.db
history.db
6 changes: 6 additions & 0 deletions src/qt/read/qtreadimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ def zoom(self, factor):
self.graphicsView.scale(factor, factor)

def keyReleaseEvent(self, ev):
if ev.modifiers() == Qt.ShiftModifier and ev.key() == Qt.Key_Left:
self.qtTool.OpenLastEps()
return
if ev.modifiers() == Qt.ShiftModifier and ev.key() == Qt.Key_Right:
self.qtTool.OpenNextEps()
return
if ev.key() == Qt.Key_Left:
self.qtTool.LastPage()
return
Expand Down
18 changes: 17 additions & 1 deletion src/qt/read/qtreadimg_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ def scaleCnt(self, value):
self.imgFrame.scaleCnt = value

def NextPage(self):
epsId = self.readImg.epsId
bookId = self.readImg.bookId
bookInfo = BookMgr().books.get(bookId)

if self.curIndex >= self.maxPic -1:
if epsId + 1 < len(bookInfo.eps):
QtBubbleLabel.ShowMsgEx(self.readImg, "自动跳转到下一章")
self.OpenNextEps()
return
QtBubbleLabel.ShowMsgEx(self.readImg, "已经最后一页")
return
t = CTime()
Expand All @@ -163,7 +171,15 @@ def NextPage(self):
return

def LastPage(self):
epsId = self.readImg.epsId
bookId = self.readImg.bookId
bookInfo = BookMgr().books.get(bookId)

if self.curIndex <= 0:
if epsId - 1 >= 0:
QtBubbleLabel.ShowMsgEx(self.readImg, "自动跳转到上一章")
self.OpenLastEps()
return
QtBubbleLabel.ShowMsgEx(self.readImg, "已经是第一页")
return
self.curIndex -= 1
Expand Down Expand Up @@ -305,7 +321,7 @@ def OpenLastEps(self):
bookInfo = BookMgr().books.get(bookId)

epsId -= 1
if epsId <= 0:
if epsId < 0:
QtBubbleLabel.ShowMsgEx(self.readImg, "已经是第一章")
return

Expand Down

0 comments on commit 63b4516

Please sign in to comment.