mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-01 10:39:34 +12:00
Minor ui updates and changes
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
995a78058c
commit
0f68c24b84
|
@ -6,7 +6,9 @@ import os
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from enum import Enum, unique
|
from enum import Enum, unique
|
||||||
from manuskript.data.goal import Goal
|
from manuskript.data.goal import Goal
|
||||||
|
from manuskript.data.labels import LabelHost
|
||||||
from manuskript.data.plots import Plots
|
from manuskript.data.plots import Plots
|
||||||
|
from manuskript.data.status import StatusHost
|
||||||
from manuskript.data.unique_id import UniqueIDHost
|
from manuskript.data.unique_id import UniqueIDHost
|
||||||
from manuskript.io.mmdFile import MmdFile
|
from manuskript.io.mmdFile import MmdFile
|
||||||
from manuskript.util import CounterKind, countText, validString
|
from manuskript.util import CounterKind, countText, validString
|
||||||
|
@ -207,10 +209,12 @@ class OutlineFolder(OutlineItem):
|
||||||
|
|
||||||
class Outline:
|
class Outline:
|
||||||
|
|
||||||
def __init__(self, path, plots: Plots):
|
def __init__(self, path, plots: Plots, labels: LabelHost, statuses: StatusHost):
|
||||||
self.dir_path = os.path.join(path, "outline")
|
self.dir_path = os.path.join(path, "outline")
|
||||||
self.host = UniqueIDHost()
|
self.host = UniqueIDHost()
|
||||||
self.plots = plots
|
self.plots = plots
|
||||||
|
self.labels = labels
|
||||||
|
self.statuses = statuses
|
||||||
self.items = list()
|
self.items = list()
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Project:
|
||||||
self.characters = Characters(self.file.dir_path)
|
self.characters = Characters(self.file.dir_path)
|
||||||
self.plots = Plots(self.file.dir_path, self.characters)
|
self.plots = Plots(self.file.dir_path, self.characters)
|
||||||
self.world = World(self.file.dir_path)
|
self.world = World(self.file.dir_path)
|
||||||
self.outline = Outline(self.file.dir_path, self.plots)
|
self.outline = Outline(self.file.dir_path, self.plots, self.labels, self.statuses)
|
||||||
self.revisions = Revisions(self.file.dir_path)
|
self.revisions = Revisions(self.file.dir_path)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
|
|
@ -55,11 +55,10 @@ class StatusHost:
|
||||||
self.statuses.clear()
|
self.statuses.clear()
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(text) <= 1:
|
if (len(text) <= 1) or (text[len(text) - 1] != "\n"):
|
||||||
return
|
return
|
||||||
|
|
||||||
text = text[:-1]
|
text = text[:-1]
|
||||||
|
|
||||||
if len(text) <= 0:
|
if len(text) <= 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,12 @@ class OutlineView:
|
||||||
|
|
||||||
self.widget = builder.get_object("outline_view")
|
self.widget = builder.get_object("outline_view")
|
||||||
|
|
||||||
|
self.labelStore = builder.get_object("label_store")
|
||||||
|
self.refreshLabelStore()
|
||||||
|
|
||||||
|
self.statusStore = builder.get_object("status_store")
|
||||||
|
self.refreshStatusStore()
|
||||||
|
|
||||||
self.plotsStore = builder.get_object("plots_store")
|
self.plotsStore = builder.get_object("plots_store")
|
||||||
self.refreshPlotsStore()
|
self.refreshPlotsStore()
|
||||||
|
|
||||||
|
@ -83,6 +89,29 @@ class OutlineView:
|
||||||
|
|
||||||
self.unloadOutlineData()
|
self.unloadOutlineData()
|
||||||
|
|
||||||
|
def refreshLabelStore(self):
|
||||||
|
self.labelStore.clear()
|
||||||
|
|
||||||
|
for label in self.outline.labels:
|
||||||
|
tree_iter = self.labelStore.append()
|
||||||
|
|
||||||
|
if tree_iter is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.labelStore.set_value(tree_iter, 0, validString(label.name))
|
||||||
|
self.labelStore.set_value(tree_iter, 1, pixbufFromColor(label.color))
|
||||||
|
|
||||||
|
def refreshStatusStore(self):
|
||||||
|
self.statusStore.clear()
|
||||||
|
|
||||||
|
for status in self.outline.statuses:
|
||||||
|
tree_iter = self.statusStore.append()
|
||||||
|
|
||||||
|
if tree_iter is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
self.statusStore.set_value(tree_iter, 0, validString(status.name))
|
||||||
|
|
||||||
def refreshPlotsStore(self):
|
def refreshPlotsStore(self):
|
||||||
self.plotsStore.clear()
|
self.plotsStore.clear()
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -963,7 +963,7 @@ summary</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -38,6 +38,14 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
<object class="GtkTextBuffer" id="few_sentences_summary"/>
|
<object class="GtkTextBuffer" id="few_sentences_summary"/>
|
||||||
<object class="GtkEntryBuffer" id="filter_outline"/>
|
<object class="GtkEntryBuffer" id="filter_outline"/>
|
||||||
<object class="GtkEntryBuffer" id="goal"/>
|
<object class="GtkEntryBuffer" id="goal"/>
|
||||||
|
<object class="GtkListStore" id="label_store">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name name -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name color -->
|
||||||
|
<column type="GdkPixbuf"/>
|
||||||
|
</columns>
|
||||||
|
</object>
|
||||||
<object class="GtkEntryBuffer" id="one_line_summary"/>
|
<object class="GtkEntryBuffer" id="one_line_summary"/>
|
||||||
<object class="GtkTreeStore" id="outline_store">
|
<object class="GtkTreeStore" id="outline_store">
|
||||||
<columns>
|
<columns>
|
||||||
|
@ -81,6 +89,12 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
<object class="GtkTreeModelFilter" id="secondary_plots_store">
|
<object class="GtkTreeModelFilter" id="secondary_plots_store">
|
||||||
<property name="child-model">plots_store</property>
|
<property name="child-model">plots_store</property>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkListStore" id="status_store">
|
||||||
|
<columns>
|
||||||
|
<!-- column-name name -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
</columns>
|
||||||
|
</object>
|
||||||
<object class="GtkScrolledWindow" id="outline_view">
|
<object class="GtkScrolledWindow" id="outline_view">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
|
@ -220,7 +234,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -261,9 +275,14 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Title</property>
|
<property name="title" translatable="yes">Title</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText"/>
|
<object class="GtkCellRendererText">
|
||||||
|
<property name="editable">True</property>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="text">1</attribute>
|
<attribute name="text">1</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -272,9 +291,15 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Label</property>
|
<property name="title" translatable="yes">Label</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererCombo"/>
|
<object class="GtkCellRendererCombo">
|
||||||
|
<property name="editable">True</property>
|
||||||
|
<property name="model">label_store</property>
|
||||||
|
<property name="text-column">0</property>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="text">2</attribute>
|
<attribute name="text">2</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -283,9 +308,15 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Status</property>
|
<property name="title" translatable="yes">Status</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererCombo"/>
|
<object class="GtkCellRendererCombo">
|
||||||
|
<property name="editable">True</property>
|
||||||
|
<property name="model">status_store</property>
|
||||||
|
<property name="text-column">0</property>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="text">3</attribute>
|
<attribute name="text">3</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -294,6 +325,8 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Compile</property>
|
<property name="title" translatable="yes">Compile</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererToggle"/>
|
<object class="GtkCellRendererToggle"/>
|
||||||
|
@ -305,9 +338,13 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Word count</property>
|
<property name="title" translatable="yes">Word count</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererSpin"/>
|
<object class="GtkCellRendererSpin">
|
||||||
|
<property name="editable">True</property>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="text">5</attribute>
|
<attribute name="text">5</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -316,9 +353,13 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="resizable">True</property>
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">Goal</property>
|
<property name="title" translatable="yes">Goal</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererSpin"/>
|
<object class="GtkCellRendererSpin">
|
||||||
|
<property name="editable">True</property>
|
||||||
|
</object>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="text">6</attribute>
|
<attribute name="text">6</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -327,6 +368,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn">
|
<object class="GtkTreeViewColumn">
|
||||||
|
<property name="min-width">50</property>
|
||||||
<property name="title" translatable="yes">%</property>
|
<property name="title" translatable="yes">%</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererProgress"/>
|
<object class="GtkCellRendererProgress"/>
|
||||||
|
@ -589,7 +631,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -330,7 +330,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -850,7 +850,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
|
@ -175,7 +175,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -408,7 +408,7 @@ along with Manuskript. If not, see <http://www.gnu.org/licenses/>.
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="resize">True</property>
|
<property name="resize">True</property>
|
||||||
<property name="shrink">False</property>
|
<property name="shrink">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|
Loading…
Reference in a new issue