Added session log dialog window
This commit is contained in:
@@ -199,6 +199,12 @@ class GuiMainMenu(QMenuBar):
|
|||||||
menuItem.triggered.connect(self.theParent.exportProjectDialog)
|
menuItem.triggered.connect(self.theParent.exportProjectDialog)
|
||||||
self.projMenu.addAction(menuItem)
|
self.projMenu.addAction(menuItem)
|
||||||
|
|
||||||
|
# Project > Session Log
|
||||||
|
menuItem = QAction("Session Log", self)
|
||||||
|
menuItem.setStatusTip("Show the session log")
|
||||||
|
menuItem.triggered.connect(self.theParent.showTimeLineDialog)
|
||||||
|
self.projMenu.addAction(menuItem)
|
||||||
|
|
||||||
# Project > Separator
|
# Project > Separator
|
||||||
self.projMenu.addSeparator()
|
self.projMenu.addSeparator()
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""novelWriter GUI Session Log Viewer
|
||||||
|
|
||||||
|
novelWriter – GUI Session Log Viewer
|
||||||
|
======================================
|
||||||
|
Class holding the session log view window
|
||||||
|
|
||||||
|
File History:
|
||||||
|
Created: 2019-10-20 [0.3]
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import nw
|
||||||
|
|
||||||
|
from PyQt5.QtCore import Qt
|
||||||
|
from PyQt5.QtGui import QIcon, QColor, QPixmap
|
||||||
|
from PyQt5.QtWidgets import (
|
||||||
|
QDialog, QVBoxLayout, QHBoxLayout, QTableWidget, QTableWidgetItem,
|
||||||
|
QDialogButtonBox, QLabel, QPushButton, QHeaderView
|
||||||
|
)
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
class GuiSessionLogView(QDialog):
|
||||||
|
|
||||||
|
def __init__(self, theParent, theProject):
|
||||||
|
QDialog.__init__(self, theParent)
|
||||||
|
|
||||||
|
logger.debug("Initialising SessionLogView ...")
|
||||||
|
|
||||||
|
self.mainConf = nw.CONFIG
|
||||||
|
self.theProject = theProject
|
||||||
|
self.theParent = theParent
|
||||||
|
|
||||||
|
self.outerBox = QVBoxLayout()
|
||||||
|
self.bottomBox = QHBoxLayout()
|
||||||
|
|
||||||
|
self.setWindowTitle("Session Log")
|
||||||
|
|
||||||
|
self.setLayout(self.outerBox)
|
||||||
|
|
||||||
|
self.show()
|
||||||
|
|
||||||
|
logger.debug("SessionLogView initialisation complete")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
def _doClose(self):
|
||||||
|
self.close()
|
||||||
|
return
|
||||||
|
|
||||||
|
# END Class GuiSessionLogView
|
||||||
@@ -127,4 +127,4 @@ class GuiTimeLineView(QDialog):
|
|||||||
self.close()
|
self.close()
|
||||||
return
|
return
|
||||||
|
|
||||||
# END Class GuiItemEditor
|
# END Class GuiTimeLineView
|
||||||
|
|||||||
+5
-1
@@ -34,6 +34,7 @@ from nw.gui.export import GuiExport
|
|||||||
from nw.gui.itemeditor import GuiItemEditor
|
from nw.gui.itemeditor import GuiItemEditor
|
||||||
from nw.gui.statusbar import GuiMainStatus
|
from nw.gui.statusbar import GuiMainStatus
|
||||||
from nw.gui.timelineview import GuiTimeLineView
|
from nw.gui.timelineview import GuiTimeLineView
|
||||||
|
from nw.gui.sessionlog import GuiSessionLogView
|
||||||
from nw.project.project import NWProject
|
from nw.project.project import NWProject
|
||||||
from nw.project.document import NWDoc
|
from nw.project.document import NWDoc
|
||||||
from nw.project.item import NWItem
|
from nw.project.item import NWItem
|
||||||
@@ -521,10 +522,13 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
def showTimeLineDialog(self):
|
def showTimeLineDialog(self):
|
||||||
if self.hasProject:
|
if self.hasProject:
|
||||||
dlgTLine = GuiTimeLineView(self, self.theProject, self.theIndex)
|
dlgTLine = GuiSessionLogView(self, self.theProject)
|
||||||
dlgTLine.exec_()
|
dlgTLine.exec_()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def showSessionLogDialog(self):
|
||||||
|
return True
|
||||||
|
|
||||||
def makeAlert(self, theMessage, theLevel=nwAlert.INFO):
|
def makeAlert(self, theMessage, theLevel=nwAlert.INFO):
|
||||||
"""Alert both the user and the logger at the same time. Message can be either a string or an
|
"""Alert both the user and the logger at the same time. Message can be either a string or an
|
||||||
array of strings. Severity level is 0 = info, 1 = warning, and 2 = error.
|
array of strings. Severity level is 0 = info, 1 = warning, and 2 = error.
|
||||||
|
|||||||
Reference in New Issue
Block a user