Added the main dialog class for project management, and made some changes to the icon class.
This commit is contained in:
@@ -6,6 +6,7 @@ from nw.gui.dialogs.docsplit import GuiDocSplit
|
||||
from nw.gui.dialogs.export import GuiExport
|
||||
from nw.gui.dialogs.itemeditor import GuiItemEditor
|
||||
from nw.gui.dialogs.projecteditor import GuiProjectEditor
|
||||
from nw.gui.dialogs.projectload import GuiProjectLoad
|
||||
from nw.gui.dialogs.sessionlog import GuiSessionLogView
|
||||
from nw.gui.dialogs.timelineview import GuiTimeLineView
|
||||
|
||||
@@ -16,6 +17,7 @@ __all__ = [
|
||||
"GuiExport",
|
||||
"GuiItemEditor",
|
||||
"GuiProjectEditor",
|
||||
"GuiProjectLoad",
|
||||
"GuiSessionLogView",
|
||||
"GuiTimeLineView",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""novelWriter GUI Open Project
|
||||
|
||||
novelWriter – GUI Open Project
|
||||
================================
|
||||
New and open project dialog
|
||||
|
||||
File History:
|
||||
Created: 2020-02-26 [0.4.5]
|
||||
|
||||
"""
|
||||
|
||||
import logging
|
||||
import nw
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import (
|
||||
QDialog, QHBoxLayout, QVBoxLayout, QGridLayout, QPushButton, QListWidget,
|
||||
QAbstractItemView
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
class GuiProjectLoad(QDialog):
|
||||
|
||||
def __init__(self, theParent):
|
||||
QDialog.__init__(self, theParent)
|
||||
|
||||
logger.debug("Initialising GuiProjectLoad ...")
|
||||
|
||||
self.mainConf = nw.CONFIG
|
||||
self.theParent = theParent
|
||||
self.sourceItem = None
|
||||
|
||||
self.outerBox = QHBoxLayout()
|
||||
self.innerBox = QVBoxLayout()
|
||||
self.setWindowTitle("Manage Projects")
|
||||
self.setLayout(self.outerBox)
|
||||
|
||||
self.guiDeco = self.theParent.theTheme.loadDecoration("nwicon", (128, 128))
|
||||
|
||||
self.outerBox.addWidget(self.guiDeco, 0, Qt.AlignTop)
|
||||
self.outerBox.addLayout(self.innerBox)
|
||||
|
||||
self.projectForm = QGridLayout()
|
||||
self.projectForm.setContentsMargins(0, 0, 0, 0)
|
||||
|
||||
self.listBox = QListWidget()
|
||||
self.listBox.setDragDropMode(QAbstractItemView.NoDragDrop)
|
||||
|
||||
self.closeButton = QPushButton("Close")
|
||||
self.closeButton.clicked.connect(self._doClose)
|
||||
|
||||
self.projectForm.addWidget(self.listBox, 0, 0, 1, 3)
|
||||
self.projectForm.addWidget(self.closeButton, 1, 2)
|
||||
|
||||
self.innerBox.addLayout(self.projectForm)
|
||||
|
||||
self.rejected.connect(self._doClose)
|
||||
self.setModal(True)
|
||||
self.show()
|
||||
|
||||
self._populateList()
|
||||
|
||||
logger.debug("GuiProjectLoad initialisation complete")
|
||||
|
||||
return
|
||||
|
||||
##
|
||||
# Buttons
|
||||
##
|
||||
|
||||
def _doClose(self):
|
||||
"""Close the dialog window without doing anything.
|
||||
"""
|
||||
logger.verbose("GuiProjectLoad close button clicked")
|
||||
self.close()
|
||||
return
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
##
|
||||
|
||||
def _populateList(self):
|
||||
return
|
||||
|
||||
# END Class GuiProjectLoad
|
||||
Reference in New Issue
Block a user