Files
novelWriter/novelwriter/tools/novelinfo.py
T
Veronica Berglyd Olsen ce2ac9b1a1 Add a novel info dialog
2024-01-18 23:34:27 +01:00

72 lines
1.8 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
novelWriter GUI Novel Info
============================
File History:
Created: 2024-01-18 [2.3b1] GuiNovelInfo
This file is a part of novelWriter
Copyright 20182024, Veronica Berglyd Olsen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from __future__ import annotations
import logging
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtWidgets import QDialog, QWidget
logger = logging.getLogger(__name__)
class GuiNovelInfo(QDialog):
def __init__(self, parent: QWidget) -> None:
super().__init__(parent=parent)
logger.debug("Create: GuiNovelInfo")
self.setObjectName("GuiNovelInfo")
self.setWindowTitle(self.tr("Novel Info"))
logger.debug("Ready: GuiNovelInfo")
return
def __del__(self) -> None: # pragma: no cover
logger.debug("Delete: GuiNovelInfo")
return
##
# Events
##
def closeEvent(self, event: QCloseEvent) -> None:
"""Capture the user closing the window and save settings."""
self._saveSettings()
event.accept()
self.deleteLater()
return
##
# Internal Functions
##
def _saveSettings(self) -> None:
"""Save the user GUI settings."""
logger.debug("Saving State: GuiNovelInfo")
return
# END Class GuiNovelInfo