Files
novelWriter/nw/gui/doctabs.py
T
2018-09-29 18:14:44 +02:00

50 lines
1.0 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.
# -*- coding: utf-8 -*
"""novelWriter GUI Document Tabs
novelWriter GUI Document Tabs
=================================
Class holding the document tab view
File History:
Created: 2018-09-29 [0.1.0]
"""
import logging
import nw
from os import path
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QTabWidget, QWidget, QVBoxLayout
from nw.gui.doceditor import GuiDocEditor
logger = logging.getLogger(__name__)
class GuiDocTabs(QTabWidget):
def __init__(self):
QTabWidget.__init__(self)
logger.debug("Initialising DocTabs ...")
self.mainConf = nw.CONFIG
self.tabList = []
self.resize(900,500)
logger.debug("DocTabs initialisation complete")
return
def createTab(self, docFile=None):
if docFile is None:
tabName = "New Document"
else:
tabName = docFile
thisTab = GuiDocEditor()
self.tabList.append(thisTab)
self.addTab(self.tabList[-1],tabName)
return True
# END Class GuiDocTabs