From 6f893bf321a9c16157d9b8d2afabe067cf6ff62f Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 31 Oct 2019 13:56:00 +0100 Subject: [PATCH] Cleaned up the source files in the gui folder a bit. --- nw/gui/{ => dialogs}/configeditor.py | 0 nw/gui/{ => dialogs}/export.py | 0 nw/gui/{ => dialogs}/itemeditor.py | 0 nw/gui/{ => dialogs}/projecteditor.py | 0 nw/gui/{ => dialogs}/sessionlog.py | 0 nw/gui/{ => dialogs}/timelineview.py | 0 nw/gui/{ => elements}/docdetails.py | 0 nw/gui/{ => elements}/doceditor.py | 22 ++++++----- nw/gui/{ => elements}/doctree.py | 0 nw/gui/{ => elements}/docviewer.py | 0 nw/gui/{ => elements}/searchbar.py | 0 nw/gui/{ => tools}/dochighlight.py | 0 nw/gui/{ => tools}/wordcounter.py | 0 nw/gui/winmain.py | 53 ++++++++++++++------------- sample/sampleNovel/nwProject.nwx | 2 +- tests/test_gui.py | 9 +++-- 16 files changed, 45 insertions(+), 41 deletions(-) rename nw/gui/{ => dialogs}/configeditor.py (100%) rename nw/gui/{ => dialogs}/export.py (100%) rename nw/gui/{ => dialogs}/itemeditor.py (100%) rename nw/gui/{ => dialogs}/projecteditor.py (100%) rename nw/gui/{ => dialogs}/sessionlog.py (100%) rename nw/gui/{ => dialogs}/timelineview.py (100%) rename nw/gui/{ => elements}/docdetails.py (100%) rename nw/gui/{ => elements}/doceditor.py (97%) rename nw/gui/{ => elements}/doctree.py (100%) rename nw/gui/{ => elements}/docviewer.py (100%) rename nw/gui/{ => elements}/searchbar.py (100%) rename nw/gui/{ => tools}/dochighlight.py (100%) rename nw/gui/{ => tools}/wordcounter.py (100%) diff --git a/nw/gui/configeditor.py b/nw/gui/dialogs/configeditor.py similarity index 100% rename from nw/gui/configeditor.py rename to nw/gui/dialogs/configeditor.py diff --git a/nw/gui/export.py b/nw/gui/dialogs/export.py similarity index 100% rename from nw/gui/export.py rename to nw/gui/dialogs/export.py diff --git a/nw/gui/itemeditor.py b/nw/gui/dialogs/itemeditor.py similarity index 100% rename from nw/gui/itemeditor.py rename to nw/gui/dialogs/itemeditor.py diff --git a/nw/gui/projecteditor.py b/nw/gui/dialogs/projecteditor.py similarity index 100% rename from nw/gui/projecteditor.py rename to nw/gui/dialogs/projecteditor.py diff --git a/nw/gui/sessionlog.py b/nw/gui/dialogs/sessionlog.py similarity index 100% rename from nw/gui/sessionlog.py rename to nw/gui/dialogs/sessionlog.py diff --git a/nw/gui/timelineview.py b/nw/gui/dialogs/timelineview.py similarity index 100% rename from nw/gui/timelineview.py rename to nw/gui/dialogs/timelineview.py diff --git a/nw/gui/docdetails.py b/nw/gui/elements/docdetails.py similarity index 100% rename from nw/gui/docdetails.py rename to nw/gui/elements/docdetails.py diff --git a/nw/gui/doceditor.py b/nw/gui/elements/doceditor.py similarity index 97% rename from nw/gui/doceditor.py rename to nw/gui/elements/doceditor.py index 15688c1f..fc17001c 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/elements/doceditor.py @@ -13,18 +13,20 @@ import logging import nw -from time import time +from time import time -from PyQt5.QtCore import Qt, QTimer, QSizeF -from PyQt5.QtWidgets import qApp, QTextEdit, QAction, QMenu, QShortcut -from PyQt5.QtGui import QTextCursor, QTextOption, QIcon, QKeySequence, QFont, QColor, QPalette, QTextDocument +from PyQt5.QtCore import Qt, QTimer, QSizeF +from PyQt5.QtWidgets import qApp, QTextEdit, QAction, QMenu, QShortcut +from PyQt5.QtGui import ( + QTextCursor, QTextOption, QIcon, QKeySequence, QFont, QColor, QPalette, QTextDocument +) -from nw.project.document import NWDoc -from nw.gui.dochighlight import GuiDocHighlighter -from nw.gui.wordcounter import WordCounter -from nw.tools.spellcheck import NWSpellCheck -from nw.constants import nwFiles, nwUnicode -from nw.enum import nwDocAction, nwAlert +from nw.project.document import NWDoc +from nw.gui.tools.dochighlight import GuiDocHighlighter +from nw.gui.tools.wordcounter import WordCounter +from nw.tools.spellcheck import NWSpellCheck +from nw.constants import nwFiles, nwUnicode +from nw.enum import nwDocAction, nwAlert logger = logging.getLogger(__name__) diff --git a/nw/gui/doctree.py b/nw/gui/elements/doctree.py similarity index 100% rename from nw/gui/doctree.py rename to nw/gui/elements/doctree.py diff --git a/nw/gui/docviewer.py b/nw/gui/elements/docviewer.py similarity index 100% rename from nw/gui/docviewer.py rename to nw/gui/elements/docviewer.py diff --git a/nw/gui/searchbar.py b/nw/gui/elements/searchbar.py similarity index 100% rename from nw/gui/searchbar.py rename to nw/gui/elements/searchbar.py diff --git a/nw/gui/dochighlight.py b/nw/gui/tools/dochighlight.py similarity index 100% rename from nw/gui/dochighlight.py rename to nw/gui/tools/dochighlight.py diff --git a/nw/gui/wordcounter.py b/nw/gui/tools/wordcounter.py similarity index 100% rename from nw/gui/wordcounter.py rename to nw/gui/tools/wordcounter.py diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index 53a882d9..1349e467 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -14,36 +14,37 @@ import logging import time import nw -from os import path -from PyQt5.QtCore import Qt, QTimer -from PyQt5.QtGui import QIcon, QPixmap, QColor -from PyQt5.QtWidgets import ( +from os import path + +from PyQt5.QtCore import Qt, QTimer +from PyQt5.QtGui import QIcon, QPixmap, QColor +from PyQt5.QtWidgets import ( qApp, QWidget, QMainWindow, QVBoxLayout, QFrame, QSplitter, QFileDialog, QShortcut, QMessageBox, QProgressDialog, QDialog ) -from nw.gui.doctree import GuiDocTree -from nw.gui.doceditor import GuiDocEditor -from nw.gui.docviewer import GuiDocViewer -from nw.gui.docdetails import GuiDocDetails -from nw.gui.searchbar import GuiSearchBar -from nw.gui.mainmenu import GuiMainMenu -from nw.gui.configeditor import GuiConfigEditor -from nw.gui.projecteditor import GuiProjectEditor -from nw.gui.export import GuiExport -from nw.gui.itemeditor import GuiItemEditor -from nw.gui.statusbar import GuiMainStatus -from nw.gui.timelineview import GuiTimeLineView -from nw.gui.sessionlog import GuiSessionLogView -from nw.project.project import NWProject -from nw.project.document import NWDoc -from nw.project.item import NWItem -from nw.project.index import NWIndex -from nw.project.backup import NWBackup -from nw.tools.wordcount import countWords -from nw.theme import Theme -from nw.enum import nwItemType, nwAlert -from nw.constants import nwFiles +from nw.gui.mainmenu import GuiMainMenu +from nw.gui.statusbar import GuiMainStatus +from nw.gui.elements.doctree import GuiDocTree +from nw.gui.elements.doceditor import GuiDocEditor +from nw.gui.elements.docviewer import GuiDocViewer +from nw.gui.elements.docdetails import GuiDocDetails +from nw.gui.elements.searchbar import GuiSearchBar +from nw.gui.dialogs.configeditor import GuiConfigEditor +from nw.gui.dialogs.projecteditor import GuiProjectEditor +from nw.gui.dialogs.export import GuiExport +from nw.gui.dialogs.itemeditor import GuiItemEditor +from nw.gui.dialogs.timelineview import GuiTimeLineView +from nw.gui.dialogs.sessionlog import GuiSessionLogView +from nw.project.project import NWProject +from nw.project.document import NWDoc +from nw.project.item import NWItem +from nw.project.index import NWIndex +from nw.project.backup import NWBackup +from nw.tools.wordcount import countWords +from nw.theme import Theme +from nw.enum import nwItemType, nwAlert +from nw.constants import nwFiles logger = logging.getLogger(__name__) diff --git a/sample/sampleNovel/nwProject.nwx b/sample/sampleNovel/nwProject.nwx index fe8d3b52..af138bec 100644 --- a/sample/sampleNovel/nwProject.nwx +++ b/sample/sampleNovel/nwProject.nwx @@ -1,5 +1,5 @@ - + Sample Project Sample Project diff --git a/tests/test_gui.py b/tests/test_gui.py index 9c5ad51c..16723feb 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -8,10 +8,11 @@ from nwtools import * from os import path, unlink from PyQt5.QtCore import Qt -from nw.gui.projecteditor import GuiProjectEditor -from nw.gui.timelineview import GuiTimeLineView -from nw.gui.itemeditor import GuiItemEditor -from nw.enum import * +from nw.gui.dialogs.projecteditor import GuiProjectEditor +from nw.gui.dialogs.timelineview import GuiTimeLineView +from nw.gui.dialogs.itemeditor import GuiItemEditor + +from nw.enum import * keyDelay = 10 stepDelay = 50