diff --git a/src/models/outlineModel.py b/src/models/outlineModel.py index d99952f7..37456b82 100644 --- a/src/models/outlineModel.py +++ b/src/models/outlineModel.py @@ -522,7 +522,7 @@ class outlineItem(): item = ET.Element("outlineItem") # We don't want to write some datas (computed) - exclude = [Outline.goal, Outline.goalPercentage] + exclude = [Outline.wordCount, Outline.goal, Outline.goalPercentage] # We want to force some data even if they're empty force = [Outline.compile] diff --git a/src/ui/editors/editorWidget.py b/src/ui/editors/editorWidget.py index a8eeb58f..c56f4434 100644 --- a/src/ui/editors/editorWidget.py +++ b/src/ui/editors/editorWidget.py @@ -171,7 +171,7 @@ class editorWidget(QWidget, Ui_editorWidget_ui): else: - self.stack.setCurrentIndex(0) + self.stack.setCurrentIndex(0) # Single text item self._model.dataChanged.connect(self.modelDataChanged) self.updateStatusBar() @@ -194,8 +194,15 @@ class editorWidget(QWidget, Ui_editorWidget_ui): def updateStatusBar(self): # Update progress - if self.currentIndex and self.currentIndex.isValid(): - item = self.currentIndex.internalPointer() + #if self.currentIndex and self.currentIndex.isValid(): + if self._model: + if self.currentIndex: + item = self.currentIndex.internalPointer() + else: + item = self._model.rootItem + + if not item: + item = self._model.rootItem wc = item.data(Outline.wordCount.value) goal = item.data(Outline.goal.value) diff --git a/test_project/outline.xml b/test_project/outline.xml index 3060a356..2047bc7f 100644 --- a/test_project/outline.xml +++ b/test_project/outline.xml @@ -1,63 +1,63 @@ - - - + + + - - - + + + - - - + + + - - + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - + diff --git a/test_project/settings.pickle b/test_project/settings.pickle index a3ed079d..69b20bea 100644 Binary files a/test_project/settings.pickle and b/test_project/settings.pickle differ