Added a menu option to show storage details about the currently open file

This commit is contained in:
Veronica K. B. Olsen
2019-11-02 22:14:57 +01:00
parent 4caa17f5ae
commit dfb790e73d
6 changed files with 33 additions and 8 deletions
+15 -2
View File
@@ -16,9 +16,9 @@ import nw
from time import time
from PyQt5.QtCore import Qt, QTimer, QSizeF
from PyQt5.QtWidgets import qApp, QTextEdit, QAction, QMenu, QShortcut
from PyQt5.QtWidgets import qApp, QTextEdit, QAction, QMenu, QShortcut, QMessageBox
from PyQt5.QtGui import (
QTextCursor, QTextOption, QIcon, QKeySequence, QFont, QColor, QPalette, QTextDocument
QTextCursor, QTextOption, QIcon, QKeySequence, QFont, QColor, QPalette, QTextDocument,
)
from nw.project.document import NWDoc
@@ -332,6 +332,19 @@ class GuiDocEditor(QTextEdit):
def isEmpty(self):
return self.qDocument.isEmpty()
def revealLocation(self):
if self.theHandle is not None:
msgBox = QMessageBox()
msgBox.information(self, "File Location", (
"File details for the currently open file<br>"
"Handle: {handle:s}<br>"
"Location: {fileLoc:s}"
).format(
handle = self.theHandle,
fileLoc = str(self.nwDocument.fileLoc)
))
return
##
# Document Events and Maintenance
##
+1 -1
View File
@@ -117,7 +117,7 @@ class GuiDocViewer(QTextBrowser):
self.theHandle = tHandle
self.theProject.setLastViewed(tHandle)
self.theParent.docMeta.refreshReferences(tHandle)
self.theParent.viewMeta.refreshReferences(tHandle)
return True
+2 -2
View File
@@ -6,7 +6,7 @@
Class holding the document view details panel
File History:
Created: 2019-09-31 [0.3.2]
Created: 2019-10-31 [0.3.2]
"""
@@ -20,7 +20,7 @@ from PyQt5.QtWidgets import (
QSizePolicy, QCheckBox, QGridLayout
)
from nw.constants import nwLabels
from nw.constants import nwLabels
logger = logging.getLogger(__name__)