Add a shortcut for marking a page as an ad
This commit is contained in:
parent
be698a17d6
commit
f31abe2df9
@ -27,6 +27,8 @@ from .coverimagewidget import CoverImageWidget
|
||||
from .genericmetadata import GenericMetadata, PageType
|
||||
from .settings import ComicTaggerSettings
|
||||
|
||||
import sys
|
||||
|
||||
# from pageloader import PageLoader
|
||||
|
||||
|
||||
@ -79,6 +81,7 @@ class PageListEditor(QWidget):
|
||||
|
||||
uic.loadUi(ComicTaggerSettings.getUIFile("pagelisteditor.ui"), self)
|
||||
|
||||
self.setEnabled(True)
|
||||
self.pageWidget = CoverImageWidget(self.pageContainer, CoverImageWidget.ArchiveMode)
|
||||
gridlayout = QGridLayout(self.pageContainer)
|
||||
gridlayout.addWidget(self.pageWidget)
|
||||
@ -109,6 +112,15 @@ class PageListEditor(QWidget):
|
||||
self.pre_move_row = -1
|
||||
self.first_front_page = None
|
||||
|
||||
def toggleAd(self):
|
||||
ad = self.comboBox.findData(PageType.Advertisement)
|
||||
if self.comboBox.currentIndex() == ad:
|
||||
self.comboBox.setCurrentIndex(0)
|
||||
self.changePageType(0)
|
||||
else:
|
||||
self.comboBox.setCurrentIndex(ad)
|
||||
self.changePageType(ad)
|
||||
|
||||
def resetPage(self):
|
||||
self.pageWidget.clear()
|
||||
self.comboBox.setDisabled(True)
|
||||
|
@ -411,6 +411,13 @@ class TaggerWindow(QtWidgets.QMainWindow):
|
||||
self.toolBar.addAction(self.actionClearEntryForm)
|
||||
self.toolBar.addAction(self.actionPageBrowser)
|
||||
|
||||
self.actionMarkAd.setShortcut("A")
|
||||
self.actionMarkAd.triggered.connect(self.toggleAd)
|
||||
|
||||
def toggleAd(self):
|
||||
if self.tabWidget.tabText(self.tabWidget.currentIndex()) == "Pages":
|
||||
self.pageListEditor.toggleAd()
|
||||
|
||||
def repackageArchive(self):
|
||||
ca_list = self.fileSelectionList.getSelectedArchiveList()
|
||||
rar_count = 0
|
||||
|
@ -1199,6 +1199,7 @@
|
||||
<addaction name="actionLiteralSearch"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionApplyCBLTransform"/>
|
||||
<addaction name="actionMarkAd"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuWindow">
|
||||
<property name="title">
|
||||
@ -1402,6 +1403,14 @@
|
||||
<string>perform a literal search on the series and return the first 50 results</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMarkAd">
|
||||
<property name="text">
|
||||
<string>Mark Advertisement</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>mark the current page as an advertisement</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
|
Loading…
Reference in New Issue
Block a user