Drop the noticebar class as well

This commit is contained in:
Veronica K. B. Olsen
2020-06-07 23:21:27 +02:00
parent 1fc76b0d95
commit 6cb17a185a
4 changed files with 2 additions and 60 deletions
+1 -2
View File
@@ -2,7 +2,7 @@
from nw.gui.about import GuiAbout from nw.gui.about import GuiAbout
from nw.gui.build import GuiBuildNovel from nw.gui.build import GuiBuildNovel
from nw.gui.docbars import GuiDocTitleBar, GuiNoticeBar, GuiSearchBar from nw.gui.docbars import GuiDocTitleBar, GuiSearchBar
from nw.gui.docdetails import GuiDocViewDetails from nw.gui.docdetails import GuiDocViewDetails
from nw.gui.doceditor import GuiDocEditor from nw.gui.doceditor import GuiDocEditor
from nw.gui.docmerge import GuiDocMerge from nw.gui.docmerge import GuiDocMerge
@@ -25,7 +25,6 @@ __all__ = [
"GuiAbout", "GuiAbout",
"GuiBuildNovel", "GuiBuildNovel",
"GuiDocTitleBar", "GuiDocTitleBar",
"GuiNoticeBar",
"GuiSearchBar", "GuiSearchBar",
"GuiDocViewDetails", "GuiDocViewDetails",
"GuiDocEditor", "GuiDocEditor",
-54
View File
@@ -7,7 +7,6 @@
File History: File History:
Created: 2019-09-29 [0.2.1] GuiSearchBar Created: 2019-09-29 [0.2.1] GuiSearchBar
Created: 2019-10-31 [0.3.2] GuiNoticeBar
Created: 2020-04-25 [0.4.5] GuiDocTitleBar Created: 2020-04-25 [0.4.5] GuiDocTitleBar
This file is a part of novelWriter This file is a part of novelWriter
@@ -169,59 +168,6 @@ class GuiSearchBar(QFrame):
# END Class GuiSearchBar # END Class GuiSearchBar
class GuiNoticeBar(QFrame):
def __init__(self, theParent):
QFrame.__init__(self, theParent)
logger.debug("Initialising GuiNoticeBar ...")
self.mainConf = nw.CONFIG
self.theParent = theParent
self.theTheme = theParent.theTheme
self.setContentsMargins(0, 0, 0, 0)
self.setFrameShape(QFrame.Box)
m8 = self.mainConf.pxInt(8)
m2 = self.mainConf.pxInt(2)
self.mainBox = QHBoxLayout(self)
self.mainBox.setContentsMargins(m8, m2, m2, m2)
self.noteLabel = QLabel("")
self.closeButton = QPushButton(self.theTheme.getIcon("close"),"")
self.closeButton.clicked.connect(self.hideNote)
self.mainBox.addWidget(self.noteLabel)
self.mainBox.addWidget(self.closeButton)
self.mainBox.setStretch(0, 1)
self.setLayout(self.mainBox)
self.hideNote()
logger.debug("GuiNoticeBar initialisation complete")
return
def showNote(self, theNote):
"""Show the note on the noticebar.
"""
self.noteLabel.setText("<b>Note:</b> %s" % theNote)
self.setVisible(True)
return
def hideNote(self):
"""Clear the noticebar and hide it.
"""
self.noteLabel.setText("")
self.setVisible(False)
return
# END Class GuiNoticeBar
class GuiDocTitleBar(QLabel): class GuiDocTitleBar(QLabel):
def __init__(self, theParent, theProject): def __init__(self, theParent, theProject):
-1
View File
@@ -158,7 +158,6 @@ class GuiDocEditor(QTextEdit):
self.hasSelection = False self.hasSelection = False
self.setDocumentChanged(False) self.setDocumentChanged(False)
self.theParent.noticeBar.hideNote()
self.docTitle.setTitleFromHandle(self.theHandle) self.docTitle.setTitleFromHandle(self.theHandle)
return True return True
+1 -3
View File
@@ -42,7 +42,7 @@ from PyQt5.QtWidgets import (
from nw.gui import ( from nw.gui import (
GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, GuiDocViewDetails, GuiBuildNovel, GuiDocEditor, GuiDocMerge, GuiDocSplit, GuiDocViewDetails,
GuiDocViewer, GuiItemDetails, GuiItemEditor, GuiMainMenu, GuiMainStatus, GuiDocViewer, GuiItemDetails, GuiItemEditor, GuiMainMenu, GuiMainStatus,
GuiNoticeBar, GuiOutline, GuiOutlineDetails, GuiPreferences, GuiProjectLoad, GuiOutline, GuiOutlineDetails, GuiPreferences, GuiProjectLoad,
GuiProjectSettings, GuiProjectTree, GuiSearchBar, GuiSessionLogView, GuiTheme GuiProjectSettings, GuiProjectTree, GuiSearchBar, GuiSessionLogView, GuiTheme
) )
from nw.core import NWProject, NWDoc, NWIndex from nw.core import NWProject, NWDoc, NWIndex
@@ -90,7 +90,6 @@ class GuiMain(QMainWindow):
# Main GUI Elements # Main GUI Elements
self.statusBar = GuiMainStatus(self) self.statusBar = GuiMainStatus(self)
self.noticeBar = GuiNoticeBar(self)
self.treeView = GuiProjectTree(self) self.treeView = GuiProjectTree(self)
self.docEditor = GuiDocEditor(self) self.docEditor = GuiDocEditor(self)
self.docViewer = GuiDocViewer(self) self.docViewer = GuiDocViewer(self)
@@ -118,7 +117,6 @@ class GuiMain(QMainWindow):
self.docEdit.setContentsMargins(0, 0, 0, 0) self.docEdit.setContentsMargins(0, 0, 0, 0)
self.docEdit.setSpacing(self.mainConf.pxInt(2)) self.docEdit.setSpacing(self.mainConf.pxInt(2))
self.docEdit.addWidget(self.searchBar) self.docEdit.addWidget(self.searchBar)
self.docEdit.addWidget(self.noticeBar)
self.docEdit.addWidget(self.docEditor) self.docEdit.addWidget(self.docEditor)
self.editPane.setLayout(self.docEdit) self.editPane.setLayout(self.docEdit)