mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-14 18:02:23 +12:00
World building and references improvements
This commit is contained in:
parent
625b66ec74
commit
110a96073e
|
@ -21,6 +21,7 @@ SOURCES += ../src/settingsWindow.py
|
|||
SOURCES += ../src/models/outlineModel.py
|
||||
SOURCES += ../src/models/persosProxyModel.py
|
||||
SOURCES += ../src/models/plotModel.py
|
||||
SOURCES += ../src/models/worldModel.py
|
||||
SOURCES += ../src/models/persosModel.py
|
||||
SOURCES += ../src/models/references.py
|
||||
|
||||
|
|
Binary file not shown.
|
@ -49,7 +49,7 @@
|
|||
<translation>Informations sur l'auteur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="733"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1479"/>
|
||||
<source>Name</source>
|
||||
<translation>Nom</translation>
|
||||
</message>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<translation>Noms</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1056"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1434"/>
|
||||
<source>Filter</source>
|
||||
<translation>Filtre</translation>
|
||||
</message>
|
||||
|
@ -179,7 +179,7 @@
|
|||
<translation>Informations détaillées</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1723"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1881"/>
|
||||
<source>Plots</source>
|
||||
<translation>Intrigues</translation>
|
||||
</message>
|
||||
|
@ -194,7 +194,7 @@
|
|||
<translation>Personnage(s)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1126"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1489"/>
|
||||
<source>Description</source>
|
||||
<translation>Description</translation>
|
||||
</message>
|
||||
|
@ -209,202 +209,197 @@
|
|||
<translation>Étapes de résolution</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1372"/>
|
||||
<source>Context</source>
|
||||
<translation>Contexte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1071"/>
|
||||
<location filename="../src/mainWindow.py" line="1127"/>
|
||||
<source>Outline</source>
|
||||
<translation>Plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1515"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1673"/>
|
||||
<source>Redaction</source>
|
||||
<translation>Rédaction</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1824"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1992"/>
|
||||
<source>Tools</source>
|
||||
<translation>Outils</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1631"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1789"/>
|
||||
<source>Cheat sheet</source>
|
||||
<translation>Aide-mémoire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1687"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1845"/>
|
||||
<source>Debug</source>
|
||||
<translation>Debug</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1700"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1858"/>
|
||||
<source>FlatData</source>
|
||||
<translation>FlatData</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1710"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1868"/>
|
||||
<source>Persos</source>
|
||||
<translation>Persos</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1791"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1959"/>
|
||||
<source>File</source>
|
||||
<translation>Fichier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1818"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1986"/>
|
||||
<source>Help</source>
|
||||
<translation>Aide</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1855"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2023"/>
|
||||
<source>Open</source>
|
||||
<translation>Ouvrir</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1858"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2026"/>
|
||||
<source>Ctrl+O</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1795"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1963"/>
|
||||
<source>Recents</source>
|
||||
<translation>Récents</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1867"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2035"/>
|
||||
<source>Save</source>
|
||||
<translation>Enregistrer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1870"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2038"/>
|
||||
<source>Ctrl+S</source>
|
||||
<translation>Ctrl+S</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1879"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2047"/>
|
||||
<source>Save as...</source>
|
||||
<translation>Enregistrer sous...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1882"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2050"/>
|
||||
<source>Ctrl+Shift+S</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1891"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2059"/>
|
||||
<source>Quit</source>
|
||||
<translation>Quitter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1894"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2062"/>
|
||||
<source>Ctrl+Q</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1909"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2077"/>
|
||||
<source>Show help texts</source>
|
||||
<translation>Montrer les bulles d'aides</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1912"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2080"/>
|
||||
<source>Ctrl+Shift+B</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1927"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2095"/>
|
||||
<source>Spellcheck</source>
|
||||
<translation>Correcteur orthographique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1994"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2162"/>
|
||||
<source>F8</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1810"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1978"/>
|
||||
<source>Mode</source>
|
||||
<translation>Mode</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="904"/>
|
||||
<location filename="../src/mainWindow.py" line="951"/>
|
||||
<source> (~{} pages)</source>
|
||||
<translation> (~{} pages)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="930"/>
|
||||
<location filename="../src/mainWindow.py" line="986"/>
|
||||
<source>Enter infos about your book, and yourself.</source>
|
||||
<translation>Entrez toutes les informations relatives au livre, ainsi qu'à vous.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="936"/>
|
||||
<location filename="../src/mainWindow.py" line="992"/>
|
||||
<source>Take time to think about a one sentance (~50 words) summary of your book. Then expand it to a paragraph, then to a page, then to a full summary.</source>
|
||||
<translation>Prenez le temps de réfléchir à un résumé de votre livre, en une phrase (~50 mots). Puis augmentez cette phrase en un paragraphe, puis en une page, puis en un résumé complet.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="939"/>
|
||||
<location filename="../src/mainWindow.py" line="995"/>
|
||||
<source>Create your characters.</source>
|
||||
<translation>Créez ici vos personnage.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="942"/>
|
||||
<location filename="../src/mainWindow.py" line="998"/>
|
||||
<source>Develop plots.</source>
|
||||
<translation>Développez vos intrigues.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="945"/>
|
||||
<location filename="../src/mainWindow.py" line="1001"/>
|
||||
<source>Create the outline of your masterpiece.</source>
|
||||
<translation>Créez le plan de votre chef-d'œuvre.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="948"/>
|
||||
<location filename="../src/mainWindow.py" line="1004"/>
|
||||
<source>Write.</source>
|
||||
<translation>Écrivez.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="951"/>
|
||||
<location filename="../src/mainWindow.py" line="1007"/>
|
||||
<source>Debug infos. Sometimes useful.</source>
|
||||
<translation>Des infos pour débugger des fois pendant qu'on code c'est utile.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="965"/>
|
||||
<location filename="../src/mainWindow.py" line="1021"/>
|
||||
<source>Dictionary</source>
|
||||
<translation>Dictionnaire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="978"/>
|
||||
<location filename="../src/mainWindow.py" line="1034"/>
|
||||
<source>Install PyEnchant to use spellcheck</source>
|
||||
<translation>Installez PyEnchant pour profiter du correcteur orthographique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="908"/>
|
||||
<location filename="../src/mainWindow.py" line="955"/>
|
||||
<source>Words: {}{}</source>
|
||||
<translation>Mots: {}{}</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1082"/>
|
||||
<location filename="../src/mainWindow.py" line="1138"/>
|
||||
<source>Text</source>
|
||||
<translation>Texte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1757"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1925"/>
|
||||
<source>Labels</source>
|
||||
<translation>Labels</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1830"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1998"/>
|
||||
<source>Edit</source>
|
||||
<translation>Édition</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1935"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2103"/>
|
||||
<source>Labels...</source>
|
||||
<translation>Labels...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1940"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2108"/>
|
||||
<source>Status...</source>
|
||||
<translation>Status...</translation>
|
||||
</message>
|
||||
|
@ -424,160 +419,190 @@
|
|||
<translation>Et si...?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1070"/>
|
||||
<location filename="../src/mainWindow.py" line="1126"/>
|
||||
<source>Index cards</source>
|
||||
<translation>Cartes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1600"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1758"/>
|
||||
<source>Metadata</source>
|
||||
<translation>Métadonnées</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1838"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2006"/>
|
||||
<source>View</source>
|
||||
<translation>Vue</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1930"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2098"/>
|
||||
<source>F9</source>
|
||||
<translation>F9</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1069"/>
|
||||
<location filename="../src/mainWindow.py" line="1125"/>
|
||||
<source>Tree</source>
|
||||
<translation>Arbre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1956"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2124"/>
|
||||
<source>Normal</source>
|
||||
<translation>Normal</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1964"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2132"/>
|
||||
<source>Simple</source>
|
||||
<translation>Simple</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1972"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2140"/>
|
||||
<source>Fractal</source>
|
||||
<translation>Fractal</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1991"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2159"/>
|
||||
<source>Settings</source>
|
||||
<translation>Réglages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="557"/>
|
||||
<location filename="../src/mainWindow.py" line="577"/>
|
||||
<source>Project {} saved.</source>
|
||||
<translation>Le projet {} a été enregistré.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="628"/>
|
||||
<location filename="../src/mainWindow.py" line="654"/>
|
||||
<source>Project {} loaded.</source>
|
||||
<translation>Le projet {} a été chargé.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="933"/>
|
||||
<location filename="../src/mainWindow.py" line="989"/>
|
||||
<source>The basic situation, in the form of a 'What if...?' question. Ex: 'What if the most dangerous evil wizard could wasn't abled to kill a baby?' (Harry Potter)</source>
|
||||
<translation>La situation de base, sous la forme d'une question: "Et si...?" Par exemple: "Et si le plus dangereux magiciens mauvais n'était pas capable de tuer un bébé?" (Harry Potter)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1061"/>
|
||||
<location filename="../src/mainWindow.py" line="1117"/>
|
||||
<source>Nothing</source>
|
||||
<translation>Rien</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1062"/>
|
||||
<location filename="../src/mainWindow.py" line="1118"/>
|
||||
<source>POV</source>
|
||||
<translation>POV</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1063"/>
|
||||
<location filename="../src/mainWindow.py" line="1119"/>
|
||||
<source>Label</source>
|
||||
<translation>Label</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1064"/>
|
||||
<location filename="../src/mainWindow.py" line="1120"/>
|
||||
<source>Progress</source>
|
||||
<translation>Progrès</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1065"/>
|
||||
<location filename="../src/mainWindow.py" line="1121"/>
|
||||
<source>Compile</source>
|
||||
<translation>Compilation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1088"/>
|
||||
<location filename="../src/mainWindow.py" line="1144"/>
|
||||
<source>Icon color</source>
|
||||
<translation>Couleur de l'icone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1089"/>
|
||||
<location filename="../src/mainWindow.py" line="1145"/>
|
||||
<source>Text color</source>
|
||||
<translation>Couleur du texte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1090"/>
|
||||
<location filename="../src/mainWindow.py" line="1146"/>
|
||||
<source>Background color</source>
|
||||
<translation>Couleur de l'arrière-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1081"/>
|
||||
<location filename="../src/mainWindow.py" line="1137"/>
|
||||
<source>Icon</source>
|
||||
<translation>Icone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1083"/>
|
||||
<location filename="../src/mainWindow.py" line="1139"/>
|
||||
<source>Background</source>
|
||||
<translation>Arrière-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1084"/>
|
||||
<location filename="../src/mainWindow.py" line="1140"/>
|
||||
<source>Border</source>
|
||||
<translation>Bordure</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="1085"/>
|
||||
<location filename="../src/mainWindow.py" line="1141"/>
|
||||
<source>Corner</source>
|
||||
<translation>Coin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2004"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2172"/>
|
||||
<source>Close project</source>
|
||||
<translation>Fermer le projet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="370"/>
|
||||
<location filename="../src/mainWindow.py" line="388"/>
|
||||
<source>The file {} does not exist. Try again.</source>
|
||||
<translation>Le fichier {} n'existe pas. Essayez encore.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="631"/>
|
||||
<location filename="../src/mainWindow.py" line="657"/>
|
||||
<source>Project {} loaded with some errors:</source>
|
||||
<translation>Le projet {} a été chargé, avec des erreurs:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="633"/>
|
||||
<location filename="../src/mainWindow.py" line="659"/>
|
||||
<source> * {} wasn't found in project file.</source>
|
||||
<translation>* {} n'a pas été trouvé dans le fichier du projet.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/mainWindow.py" line="634"/>
|
||||
<location filename="../src/mainWindow.py" line="660"/>
|
||||
<source>Project {} loaded with some errors.</source>
|
||||
<translation>Le projet {} a été chargé avec des erreurs.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1659"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1817"/>
|
||||
<source>Search</source>
|
||||
<translation>Recherche</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2012"/>
|
||||
<location filename="../src/ui/mainWindow.ui" line="2180"/>
|
||||
<source>F6</source>
|
||||
<translation>F6</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1901"/>
|
||||
<source>World</source>
|
||||
<translation>Monde</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1447"/>
|
||||
<source>Populates with empty data</source>
|
||||
<translation>Remplir avec des catégories vides</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1470"/>
|
||||
<source>General</source>
|
||||
<translation>Général</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1500"/>
|
||||
<source>More</source>
|
||||
<translation>Plus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1509"/>
|
||||
<source>Source of passion</source>
|
||||
<translation>Source de passion</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/mainWindow.ui" line="1519"/>
|
||||
<source>Source of conflict</source>
|
||||
<translation>Source de conflit</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>Settings</name>
|
||||
|
@ -1106,7 +1131,7 @@ des lignes:</translation>
|
|||
<context>
|
||||
<name>SpellAction</name>
|
||||
<message>
|
||||
<location filename="../src/ui/views/textEditView.py" line="445"/>
|
||||
<location filename="../src/ui/views/textEditView.py" line="443"/>
|
||||
<source>Spelling Suggestions</source>
|
||||
<translation>Suggestions</translation>
|
||||
</message>
|
||||
|
@ -1170,35 +1195,40 @@ des lignes:</translation>
|
|||
<translation>Filtre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="87"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="92"/>
|
||||
<source>Minor</source>
|
||||
<translation>Mineur</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="87"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="92"/>
|
||||
<source>Secondary</source>
|
||||
<translation>Secondaire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="87"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="92"/>
|
||||
<source>Main</source>
|
||||
<translation>Principal</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="65"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="70"/>
|
||||
<source>Characters</source>
|
||||
<translation>Personnages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="78"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="83"/>
|
||||
<source>Texts</source>
|
||||
<translation>Textes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="90"/>
|
||||
<location filename="../src/ui/cheatSheet.py" line="95"/>
|
||||
<source>Plots</source>
|
||||
<translation>Intrigues</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/ui/cheatSheet.py" line="99"/>
|
||||
<source>World</source>
|
||||
<translation>Monde</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>cmbOutlineLabelChoser</name>
|
||||
|
@ -1375,7 +1405,7 @@ des lignes:</translation>
|
|||
<context>
|
||||
<name>lineEditView</name>
|
||||
<message>
|
||||
<location filename="../src/ui/views/lineEditView.py" line="110"/>
|
||||
<location filename="../src/ui/views/lineEditView.py" line="112"/>
|
||||
<source>Various</source>
|
||||
<translation>Différentes valeurs</translation>
|
||||
</message>
|
||||
|
@ -1786,145 +1816,155 @@ des lignes:</translation>
|
|||
<context>
|
||||
<name>references</name>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="348"/>
|
||||
<location filename="../src/models/references.py" line="408"/>
|
||||
<source>Unknown reference: {}.</source>
|
||||
<translation>Référence inconnue: {}.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="332"/>
|
||||
<location filename="../src/models/references.py" line="383"/>
|
||||
<source>Text: <b>{}</b></source>
|
||||
<translation>Texte: <b>{}</b></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="340"/>
|
||||
<location filename="../src/models/references.py" line="391"/>
|
||||
<source>Character: <b>{}</b></source>
|
||||
<translation>Personnage: <b>{}</b></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="153"/>
|
||||
<location filename="../src/models/references.py" line="157"/>
|
||||
<source>Basic infos</source>
|
||||
<translation>Informations générales</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="154"/>
|
||||
<location filename="../src/models/references.py" line="158"/>
|
||||
<source>Detailed infos</source>
|
||||
<translation>Informations détaillées</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="155"/>
|
||||
<location filename="../src/models/references.py" line="159"/>
|
||||
<source>POV of:</source>
|
||||
<translation>POV de:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="156"/>
|
||||
<location filename="../src/models/references.py" line="321"/>
|
||||
<source>Referenced in:</source>
|
||||
<translation>Référencé dans:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="165"/>
|
||||
<location filename="../src/models/references.py" line="169"/>
|
||||
<source>Motivation</source>
|
||||
<translation>Motivation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="166"/>
|
||||
<location filename="../src/models/references.py" line="170"/>
|
||||
<source>Goal</source>
|
||||
<translation>Goal</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="167"/>
|
||||
<location filename="../src/models/references.py" line="320"/>
|
||||
<source>Conflict</source>
|
||||
<translation>Conflit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="168"/>
|
||||
<location filename="../src/models/references.py" line="172"/>
|
||||
<source>Epiphany</source>
|
||||
<translation>Épiphanie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="169"/>
|
||||
<location filename="../src/models/references.py" line="173"/>
|
||||
<source>Short summary</source>
|
||||
<translation>Résumé court</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="170"/>
|
||||
<location filename="../src/models/references.py" line="174"/>
|
||||
<source>Longer summary</source>
|
||||
<translation>Résumé long</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="62"/>
|
||||
<location filename="../src/models/references.py" line="66"/>
|
||||
<source>Path:</source>
|
||||
<translation>Chemin:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="63"/>
|
||||
<location filename="../src/models/references.py" line="67"/>
|
||||
<source>Stats:</source>
|
||||
<translation>Stats:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="64"/>
|
||||
<location filename="../src/models/references.py" line="68"/>
|
||||
<source>POV:</source>
|
||||
<translation>POV:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="65"/>
|
||||
<location filename="../src/models/references.py" line="69"/>
|
||||
<source>Status:</source>
|
||||
<translation>Status:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="66"/>
|
||||
<location filename="../src/models/references.py" line="70"/>
|
||||
<source>Label:</source>
|
||||
<translation>Label:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="67"/>
|
||||
<location filename="../src/models/references.py" line="71"/>
|
||||
<source>Short summary:</source>
|
||||
<translation>Résumé court:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="68"/>
|
||||
<location filename="../src/models/references.py" line="72"/>
|
||||
<source>Long summary:</source>
|
||||
<translation>Résumé long:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="69"/>
|
||||
<location filename="../src/models/references.py" line="73"/>
|
||||
<source>Notes:</source>
|
||||
<translation>Notes:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="318"/>
|
||||
<location filename="../src/models/references.py" line="369"/>
|
||||
<source>Not a reference: {}.</source>
|
||||
<translation>Pas une référence: {}.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="247"/>
|
||||
<location filename="../src/models/references.py" line="324"/>
|
||||
<source>Go to {}.</source>
|
||||
<translation>Aller à {}.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="241"/>
|
||||
<location filename="../src/models/references.py" line="318"/>
|
||||
<source>Description</source>
|
||||
<translation>Description</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="242"/>
|
||||
<location filename="../src/models/references.py" line="237"/>
|
||||
<source>Result</source>
|
||||
<translation>Résultat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="243"/>
|
||||
<location filename="../src/models/references.py" line="238"/>
|
||||
<source>Characters</source>
|
||||
<translation>Personnages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="244"/>
|
||||
<location filename="../src/models/references.py" line="239"/>
|
||||
<source>Resolution steps</source>
|
||||
<translation>Étapes de résolution</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="345"/>
|
||||
<location filename="../src/models/references.py" line="396"/>
|
||||
<source>Plot: <b>{}</b></source>
|
||||
<translation>Intrigue: <b>{}</b></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="319"/>
|
||||
<source>Passion</source>
|
||||
<translation>Passion</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/references.py" line="404"/>
|
||||
<source>World: <b>{name}</b>{path}</source>
|
||||
<translation>Monde: <b>{name}</b>{path}</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>revisions</name>
|
||||
|
@ -2068,7 +2108,7 @@ des lignes:</translation>
|
|||
<context>
|
||||
<name>textEditView</name>
|
||||
<message>
|
||||
<location filename="../src/ui/views/textEditView.py" line="313"/>
|
||||
<location filename="../src/ui/views/textEditView.py" line="311"/>
|
||||
<source>Various</source>
|
||||
<translation>Différentes valeurs</translation>
|
||||
</message>
|
||||
|
@ -2357,4 +2397,217 @@ des lignes:</translation>
|
|||
<translation>Texte simple</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>worldModel</name>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="128"/>
|
||||
<source>New item</source>
|
||||
<translation>Nouvel élément</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Fantasy world building</source>
|
||||
<translation>Fantasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Physical</source>
|
||||
<translation>Physique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Climate</source>
|
||||
<translation>Climat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Topography</source>
|
||||
<translation>Topographie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Astronomy</source>
|
||||
<translation>Astronomie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Natural ressources</source>
|
||||
<translation>Ressources naturelles</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Wild life</source>
|
||||
<translation>Faune</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Flora</source>
|
||||
<translation>Flore</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>History</source>
|
||||
<translation>Histoire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Races</source>
|
||||
<translation>Races</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="166"/>
|
||||
<source>Diseases</source>
|
||||
<translation>Maladies</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Cultural</source>
|
||||
<translation>Culture</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Customs</source>
|
||||
<translation>Coutumes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Food</source>
|
||||
<translation>Nourriture</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Languages</source>
|
||||
<translation>Langues</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Education</source>
|
||||
<translation>Éducation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Dresses</source>
|
||||
<translation>Habits</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Science</source>
|
||||
<translation>Science</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Calendar</source>
|
||||
<translation>Calendrier</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Bodily language</source>
|
||||
<translation>Language corporel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Ethics</source>
|
||||
<translation>Éthique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Religion</source>
|
||||
<translation>Religion</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Government</source>
|
||||
<translation>Gouvernement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Politics</source>
|
||||
<translation>Politique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Gender roles</source>
|
||||
<translation>Rôles de genres</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Music and arts</source>
|
||||
<translation>Musique et arts</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Architecture</source>
|
||||
<translation>Architecture</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Military</source>
|
||||
<translation>Militaire</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Technology</source>
|
||||
<translation>Technologie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Courtship</source>
|
||||
<translation>Relations</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Demography</source>
|
||||
<translation>Démographie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Transportation</source>
|
||||
<translation>Transport</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="177"/>
|
||||
<source>Medicine</source>
|
||||
<translation>Médecine</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Magic system</source>
|
||||
<translation>Magie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Rules</source>
|
||||
<translation>Lois</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Organization</source>
|
||||
<translation>Organisation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Magical objects</source>
|
||||
<translation>Objets magiques</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Magical places</source>
|
||||
<translation>Endroits magiques</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="200"/>
|
||||
<source>Magical races</source>
|
||||
<translation>Races magiques</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="207"/>
|
||||
<source>Important places</source>
|
||||
<translation>Lieux importants</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/models/worldModel.py" line="208"/>
|
||||
<source>Important objects</source>
|
||||
<translation>Objets importants</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
@ -40,6 +40,13 @@ class Subplot(Enum):
|
|||
meta = 2
|
||||
summary = 3
|
||||
|
||||
class World(Enum):
|
||||
name = 0
|
||||
ID = 1
|
||||
description = 2
|
||||
passion = 3
|
||||
conflict = 4
|
||||
|
||||
class Outline(Enum):
|
||||
title = 0
|
||||
ID = 1
|
||||
|
|
|
@ -11,6 +11,7 @@ from enums import *
|
|||
from models.outlineModel import *
|
||||
from models.persosModel import *
|
||||
from models.plotModel import *
|
||||
from models.worldModel import worldModel
|
||||
from ui.views.outlineDelegates import outlinePersoDelegate
|
||||
from ui.views.plotDelegate import plotDelegate
|
||||
#from models.persosProxyModel import *
|
||||
|
@ -356,6 +357,23 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.btnRmPlotPerso.setEnabled(
|
||||
len(self.lstPlotPerso.selectedIndexes()) != 0)
|
||||
|
||||
###############################################################################
|
||||
# WORLD
|
||||
###############################################################################
|
||||
|
||||
def changeCurrentWorld(self):
|
||||
index = self.mdlWorld.selectedIndex()
|
||||
|
||||
if not index.isValid():
|
||||
self.tabWorld.setEnabled(False)
|
||||
return
|
||||
|
||||
self.tabWorld.setEnabled(True)
|
||||
self.txtWorldName.setCurrentModelIndex(index)
|
||||
self.txtWorldDescription.setCurrentModelIndex(index)
|
||||
self.txtWorldPassion.setCurrentModelIndex(index)
|
||||
self.txtWorldConflict.setCurrentModelIndex(index)
|
||||
|
||||
###############################################################################
|
||||
# LOAD AND SAVE
|
||||
###############################################################################
|
||||
|
@ -416,6 +434,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.mdlOutline.dataChanged.connect(self.startTimerNoChanges)
|
||||
self.mdlPersos.dataChanged.connect(self.startTimerNoChanges)
|
||||
self.mdlPlots.dataChanged.connect(self.startTimerNoChanges)
|
||||
self.mdlWorld.dataChanged.connect(self.startTimerNoChanges)
|
||||
#self.mdlPersosInfos.dataChanged.connect(self.startTimerNoChanges)
|
||||
self.mdlStatus.dataChanged.connect(self.startTimerNoChanges)
|
||||
self.mdlLabels.dataChanged.connect(self.startTimerNoChanges)
|
||||
|
@ -537,6 +556,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
"flatModel.xml"))
|
||||
files.append((saveStandardItemModelXML(self.mdlPersos),
|
||||
"perso.xml"))
|
||||
files.append((saveStandardItemModelXML(self.mdlWorld),
|
||||
"world.xml"))
|
||||
#files.append((saveStandardItemModelXML(self.mdlPersosInfos),
|
||||
#"persoInfos.xml"))
|
||||
files.append((saveStandardItemModelXML(self.mdlLabels),
|
||||
|
@ -567,6 +588,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.mdlStatus = QStandardItemModel(self)
|
||||
self.mdlPlots = plotModel(self)
|
||||
self.mdlOutline = outlineModel(self)
|
||||
self.mdlWorld = worldModel(self)
|
||||
|
||||
def loadDatas(self, project):
|
||||
# Loading
|
||||
|
@ -586,6 +608,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
else:
|
||||
errors.append("perso.xml")
|
||||
|
||||
if "world.xml" in files:
|
||||
loadStandardItemModelXML(self.mdlWorld,
|
||||
files["world.xml"], fromString=True)
|
||||
else:
|
||||
errors.append("world.xml")
|
||||
|
||||
#if "persoInfos.xml" in files:
|
||||
#loadStandardItemModelXML(self.mdlPersosInfos,
|
||||
|
@ -789,6 +816,26 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.plotDelegate = plotDelegate(self)
|
||||
self.lstSubPlots.setItemDelegateForColumn(Subplot.meta.value, self.plotDelegate)
|
||||
|
||||
# World
|
||||
self.treeWorld.setModel(self.mdlWorld)
|
||||
for i in range(self.mdlWorld.columnCount()):
|
||||
self.treeWorld.hideColumn(i)
|
||||
self.treeWorld.showColumn(0)
|
||||
self.btnWorldEmptyData.setMenu(self.mdlWorld.emptyDataMenu())
|
||||
self.treeWorld.selectionModel().selectionChanged.connect(self.changeCurrentWorld, AUC)
|
||||
self.btnAddWorld.clicked.connect(self.mdlWorld.addItem, AUC)
|
||||
self.btnRmWorld.clicked.connect(self.mdlWorld.removeItem, AUC)
|
||||
for w, c in [
|
||||
(self.txtWorldName, World.name.value),
|
||||
(self.txtWorldDescription, World.description.value),
|
||||
(self.txtWorldPassion, World.passion.value),
|
||||
(self.txtWorldConflict, World.conflict.value),
|
||||
]:
|
||||
w.setModel(self.mdlWorld)
|
||||
w.setColumn(c)
|
||||
self.tabWorld.setEnabled(False)
|
||||
self.treeWorld.expandAll()
|
||||
|
||||
# Outline
|
||||
self.treeRedacOutline.setModel(self.mdlOutline)
|
||||
self.treeOutlineOutline.setModelPersos(self.mdlPersos)
|
||||
|
@ -851,6 +898,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
lambda: self.tblDebugSubPlots.setRootIndex(self.mdlPlots.index(
|
||||
self.tblDebugPlots.selectionModel().currentIndex().row(),
|
||||
Plot.subplots.value)), AUC)
|
||||
self.treeDebugWorld.setModel(self.mdlWorld)
|
||||
self.treeDebugOutline.setModel(self.mdlOutline)
|
||||
self.lstDebugLabels.setModel(self.mdlLabels)
|
||||
self.lstDebugStatus.setModel(self.mdlStatus)
|
||||
|
@ -914,6 +962,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.splitterPlot.setStretchFactor(0, 20)
|
||||
self.splitterPlot.setStretchFactor(1, 60)
|
||||
self.splitterPlot.setStretchFactor(2, 30)
|
||||
|
||||
self.splitterWorld.setStretchFactor(0, 25)
|
||||
self.splitterWorld.setStretchFactor(1, 75)
|
||||
|
||||
self.splitterOutlineH.setStretchFactor(0, 25)
|
||||
self.splitterOutlineH.setStretchFactor(1, 75)
|
||||
|
@ -924,6 +975,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.splitterRedac.setStretchFactor(1, 40)
|
||||
self.splitterRedac.setStretchFactor(2, 30)
|
||||
|
||||
# QFormLayout stretch
|
||||
for w in [self.txtWorldDescription, self.txtWorldPassion, self.txtWorldConflict]:
|
||||
s = w.sizePolicy()
|
||||
s.setVerticalStretch(1)
|
||||
w.setSizePolicy(s)
|
||||
|
||||
# Help box
|
||||
references = [
|
||||
(self.lytTabOverview,
|
||||
|
|
|
@ -11,27 +11,31 @@ import re
|
|||
###############################################################################
|
||||
|
||||
# A regex used to match references
|
||||
RegEx = r"::(\w):(\d+?)::"
|
||||
RegEx = r"{(\w):(\d+):?.*?}"
|
||||
# A non-capturing regex used to identify references
|
||||
RegExNonCapturing = r"::\w:\d+?::"
|
||||
RegExNonCapturing = r"{\w:\d+:?.*?}"
|
||||
# The basic format of the references
|
||||
EmptyRef = "::{}:{}::"
|
||||
EmptyRef = "{{{}:{}:{}}}"
|
||||
PersoLetter = "C"
|
||||
TextLetter = "T"
|
||||
PlotLetter = "P"
|
||||
WorldLetter = "W"
|
||||
|
||||
def plotReference(plotID):
|
||||
def plotReference(ID):
|
||||
"Takes the ID of a plot and returns a reference for that plot."
|
||||
return EmptyRef.format(PlotLetter, plotID)
|
||||
return EmptyRef.format(PlotLetter, ID, "")
|
||||
|
||||
def persoReference(persoID):
|
||||
def persoReference(ID):
|
||||
"Takes the ID of a character and returns a reference for that character."
|
||||
return EmptyRef.format(PersoLetter, persoID)
|
||||
return EmptyRef.format(PersoLetter, ID, "")
|
||||
|
||||
def textReference(outlineID):
|
||||
def textReference(ID):
|
||||
"Takes the ID of an outline item and returns a reference for that item."
|
||||
return EmptyRef.format(TextLetter, outlineID)
|
||||
return EmptyRef.format(TextLetter, ID, "")
|
||||
|
||||
def worldReference(ID):
|
||||
"Takes the ID of a world item and returns a reference for that item."
|
||||
return EmptyRef.format(WordLetter, ID, "")
|
||||
|
||||
###############################################################################
|
||||
# READABLE INFOS
|
||||
|
@ -194,13 +198,7 @@ def infos(ref):
|
|||
text=oM.data(idx, Outline.title.value))
|
||||
|
||||
# List scenes where character is referenced
|
||||
listRefs = ""
|
||||
lst = oM.findItemsContaining(ref, [Outline.notes.value])
|
||||
for t in lst:
|
||||
idx = oM.getIndexByID(t)
|
||||
listRefs += "<li><a href='{link}'>{text}</a></li>".format(
|
||||
link=textReference(t),
|
||||
text=oM.data(idx, Outline.title.value))
|
||||
listRefs = listReferences(ref, referencedIn)
|
||||
|
||||
text = """<h1>{name}</h1>
|
||||
{goto}
|
||||
|
@ -220,9 +218,7 @@ def infos(ref):
|
|||
POV="<h2>{POVof}</h2><ul>{listPOV}</ul>".format(
|
||||
POVof=POVof,
|
||||
listPOV=listPOV) if listPOV else "",
|
||||
references="<h2>{referencedIn}</h2><ul>{listRefs}</ul>".format(
|
||||
referencedIn=referencedIn,
|
||||
listRefs=listRefs) if listRefs else "",
|
||||
references=listRefs if listRefs else "",
|
||||
)
|
||||
return text
|
||||
|
||||
|
@ -237,6 +233,7 @@ def infos(ref):
|
|||
resultTitle = qApp.translate("references", "Result")
|
||||
charactersTitle = qApp.translate("references", "Characters")
|
||||
stepsTitle = qApp.translate("references", "Resolution steps")
|
||||
referenceTitle = qApp.translate("references", "Referenced in:")
|
||||
|
||||
# Goto (link)
|
||||
goto = qApp.translate("references", "Go to {}.")
|
||||
|
@ -276,12 +273,16 @@ def infos(ref):
|
|||
summary=": {}".format(summary) if summary else "",
|
||||
meta = meta if meta else "")
|
||||
|
||||
# List scenes where item is referenced
|
||||
references = listReferences(ref, referenceTitle)
|
||||
|
||||
text = """<h1>{name}</h1>
|
||||
{goto}
|
||||
{characters}
|
||||
{description}
|
||||
{result}
|
||||
{steps}
|
||||
{references}
|
||||
""".format(
|
||||
name=name,
|
||||
goto=goto,
|
||||
|
@ -297,9 +298,60 @@ def infos(ref):
|
|||
steps="<h2>{title}</h2><ul>{steps}</ul>".format(
|
||||
title=stepsTitle,
|
||||
steps=steps) if steps else "",
|
||||
references=references
|
||||
)
|
||||
return text
|
||||
|
||||
# A World item
|
||||
elif _type == WorldLetter:
|
||||
m = mainWindow().mdlWorld
|
||||
index = m.indexByID(_ref)
|
||||
name = m.name(index)
|
||||
|
||||
# Titles
|
||||
descriptionTitle = qApp.translate("references", "Description")
|
||||
passionTitle = qApp.translate("references", "Passion")
|
||||
conflictTitle = qApp.translate("references", "Conflict")
|
||||
referenceTitle = qApp.translate("references", "Referenced in:")
|
||||
|
||||
# Goto (link)
|
||||
goto = qApp.translate("references", "Go to {}.")
|
||||
goto = goto.format(refToLink(ref))
|
||||
|
||||
# Description
|
||||
description = basicFormat(m.description(index))
|
||||
|
||||
# Passion
|
||||
passion = basicFormat(m.passion(index))
|
||||
|
||||
# Conflict
|
||||
conflict = basicFormat(m.conflict(index))
|
||||
|
||||
# List scenes where item is referenced
|
||||
references = listReferences(ref, referenceTitle)
|
||||
|
||||
text = """<h1>{name}</h1>
|
||||
{goto}
|
||||
{description}
|
||||
{passion}
|
||||
{conflict}
|
||||
{references}
|
||||
""".format(
|
||||
name=name,
|
||||
goto=goto,
|
||||
description="<h2>{title}</h2>{text}".format(
|
||||
title=descriptionTitle,
|
||||
text=description) if description else "",
|
||||
passion="<h2>{title}</h2>{text}".format(
|
||||
title=passionTitle,
|
||||
text=passion) if passion else "",
|
||||
conflict="<h2>{title}</h2><ul>{lst}</ul>".format(
|
||||
title=conflictTitle,
|
||||
lst=conflict) if conflict else "",
|
||||
references=references
|
||||
)
|
||||
return text
|
||||
|
||||
else:
|
||||
return qApp.translate("references", "Unknown reference: {}.").format(ref)
|
||||
|
||||
|
@ -337,8 +389,17 @@ def tooltip(ref):
|
|||
name = m.getPlotNameByID(_ref)
|
||||
return qApp.translate("references", "Plot: <b>{}</b>").format(name)
|
||||
|
||||
else:
|
||||
return qApp.translate("references", "Unknown reference: {}.").format(ref)
|
||||
elif _type == WorldLetter:
|
||||
m = mainWindow().mdlWorld
|
||||
item = m.itemByID(_ref)
|
||||
if item:
|
||||
name = item.text()
|
||||
path = m.path(item)
|
||||
return qApp.translate("references", "World: <b>{name}</b>{path}").format(
|
||||
name=name,
|
||||
path=" <span style='color:gray;'>({})</span>".format(path) if path else "")
|
||||
|
||||
return qApp.translate("references", "Unknown reference: {}.").format(ref)
|
||||
|
||||
###############################################################################
|
||||
# FUNCTIONS
|
||||
|
@ -369,6 +430,10 @@ def refToLink(ref):
|
|||
m = mainWindow().mdlPlots
|
||||
text = m.getPlotNameByID(_ref)
|
||||
|
||||
elif _type == WorldLetter:
|
||||
m = mainWindow().mdlWorld
|
||||
text = m.itemByID(_ref).text()
|
||||
|
||||
if text:
|
||||
return "<a href='{ref}'>{text}</a>".format(
|
||||
ref=ref,
|
||||
|
@ -380,6 +445,21 @@ def linkifyAllRefs(text):
|
|||
"Takes all the references in ``text`` and transform them into HMTL links."
|
||||
return re.sub(RegEx, lambda m: refToLink(m.group(0)), text)
|
||||
|
||||
def listReferences(ref, title):
|
||||
oM = mainWindow().mdlOutline
|
||||
listRefs = ""
|
||||
ref = ref[:ref.index(":", ref.index(":") + 1)]
|
||||
lst = oM.findItemsContaining(ref, [Outline.notes.value])
|
||||
for t in lst:
|
||||
idx = oM.getIndexByID(t)
|
||||
listRefs += "<li><a href='{link}'>{text}</a></li>".format(
|
||||
link=textReference(t),
|
||||
text=oM.data(idx, Outline.title.value))
|
||||
|
||||
return "<h2>{title}</h2><ul>{ref}</ul>".format(
|
||||
title=title,
|
||||
ref=listRefs) if listRefs else ""
|
||||
|
||||
def basicT2TFormat(text, formatting=True, EOL=True, titles=True):
|
||||
"A very basic t2t formatter to display notes and texts."
|
||||
text = text.splitlines()
|
||||
|
@ -403,6 +483,13 @@ def basicT2TFormat(text, formatting=True, EOL=True, titles=True):
|
|||
|
||||
return text
|
||||
|
||||
def basicFormat(text):
|
||||
if not text:
|
||||
return ""
|
||||
text = text.replace("\n", "<br>")
|
||||
text = linkifyAllRefs(text)
|
||||
return text
|
||||
|
||||
def open(ref):
|
||||
"Identify ``ref`` and open it."
|
||||
match = re.fullmatch(RegEx, ref)
|
||||
|
@ -429,13 +516,13 @@ def open(ref):
|
|||
index = mw.mdlOutline.getIndexByID(_ref)
|
||||
|
||||
if index.isValid():
|
||||
mw.tabMain.setCurrentIndex(6)
|
||||
mw.mainEditor.setCurrentModelIndex(index, newTab=True)
|
||||
return True
|
||||
else:
|
||||
print("Ref not found")
|
||||
return False
|
||||
|
||||
|
||||
elif _type == PlotLetter:
|
||||
mw = mainWindow()
|
||||
item = mw.lstPlots.getItemByID(_ref)
|
||||
|
@ -448,5 +535,18 @@ def open(ref):
|
|||
print("Ref not found")
|
||||
return False
|
||||
|
||||
elif _type == WorldLetter:
|
||||
mw = mainWindow()
|
||||
item = mw.mdlWorld.itemByID(_ref)
|
||||
|
||||
if item:
|
||||
mw.tabMain.setCurrentIndex(4)
|
||||
mw.treeWorld.setCurrentIndex(
|
||||
mw.mdlWorld.indexFromItem(item))
|
||||
return True
|
||||
|
||||
print("Ref not found")
|
||||
return False
|
||||
|
||||
print("Ref not implemented")
|
||||
return False
|
276
src/models/worldModel.py
Normal file
276
src/models/worldModel.py
Normal file
|
@ -0,0 +1,276 @@
|
|||
#!/usr/bin/env python
|
||||
#--!-- coding: utf8 --!--
|
||||
|
||||
from qt import *
|
||||
from enums import *
|
||||
from functions import *
|
||||
import collections
|
||||
|
||||
class worldModel(QStandardItemModel):
|
||||
|
||||
def __init__(self, parent):
|
||||
QStandardItemModel.__init__(self, 0, 3, parent)
|
||||
self.mw = mainWindow()
|
||||
|
||||
###############################################################################
|
||||
# SELECTION
|
||||
###############################################################################
|
||||
|
||||
def selectedItem(self):
|
||||
"Returns the item selected in mw.treeWorld. invisibleRootItem if None."
|
||||
index = self.selectedIndex()
|
||||
item = self.itemFromIndex(index)
|
||||
if item:
|
||||
return item
|
||||
else:
|
||||
return self.invisibleRootItem()
|
||||
|
||||
def selectedIndex(self):
|
||||
"Returns the selected index in the treeView."
|
||||
if self.mw.treeWorld.selectedIndexes():
|
||||
return self.mw.treeWorld.currentIndex()
|
||||
else:
|
||||
return QModelIndex()
|
||||
|
||||
def selectedIndexes(self):
|
||||
return self.mw.treeWorld.selectedIndexes()
|
||||
|
||||
###############################################################################
|
||||
# GETTERS
|
||||
###############################################################################
|
||||
|
||||
def ID(self, index):
|
||||
"Returns the ID of the given index."
|
||||
index = index.sibling(index.row(), World.ID.value)
|
||||
return self.data(index)
|
||||
|
||||
def name(self, index):
|
||||
"Returns the name of the given index."
|
||||
index = index.sibling(index.row(), World.name.value)
|
||||
return self.data(index)
|
||||
|
||||
def description(self, index):
|
||||
index = index.sibling(index.row(), World.description.value)
|
||||
return self.data(index)
|
||||
|
||||
def conflict(self, index):
|
||||
index = index.sibling(index.row(), World.conflict.value)
|
||||
return self.data(index)
|
||||
|
||||
def passion(self, index):
|
||||
index = index.sibling(index.row(), World.passion.value)
|
||||
return self.data(index)
|
||||
|
||||
def itemID(self, item):
|
||||
"Returns the ID of the given item."
|
||||
index = self.indexFromItem(item)
|
||||
return self.ID(index)
|
||||
|
||||
def children(self, item):
|
||||
"Returns a list of all item's children."
|
||||
c = []
|
||||
for i in range(item.rowCount()):
|
||||
c.append(item.child(i))
|
||||
return c
|
||||
|
||||
def listAll(self):
|
||||
"Returns a list of tupple ``(name, ID, path)`` for all items."
|
||||
lst = []
|
||||
|
||||
def readAll(item):
|
||||
name = item.text()
|
||||
ID = self.itemID(item)
|
||||
path = self.path(item)
|
||||
if name and ID:
|
||||
lst.append((name, ID, path))
|
||||
for c in self.children(item):
|
||||
readAll(c)
|
||||
|
||||
readAll(self.invisibleRootItem())
|
||||
|
||||
return lst
|
||||
|
||||
def indexByID(self, ID):
|
||||
"Returns the index of item whose ID is ID."
|
||||
return self.indexFromItem(self.itemByID(ID))
|
||||
|
||||
def itemByID(self, ID):
|
||||
"Returns the item whose ID is ID."
|
||||
def browse(item):
|
||||
if self.itemID(item) == ID:
|
||||
return item
|
||||
for c in self.children(item):
|
||||
r = browse(c)
|
||||
if r:
|
||||
return r
|
||||
|
||||
r = browse(self.invisibleRootItem())
|
||||
return r if r else -1
|
||||
|
||||
def path(self, item):
|
||||
"Returns the path to the item in the form of 'ancestor > ... > grand-parent > parent'."
|
||||
path = []
|
||||
while item.parent():
|
||||
item = item.parent()
|
||||
path.append(item.text())
|
||||
path = " > ".join(path)
|
||||
return path
|
||||
|
||||
###############################################################################
|
||||
# ADDING AND REMOVE
|
||||
###############################################################################
|
||||
|
||||
def addItem(self, title=None, parent=None):
|
||||
"Adds an item, and returns it."
|
||||
if not parent:
|
||||
parent = self.selectedItem()
|
||||
if not title:
|
||||
title = self.tr("New item")
|
||||
name = QStandardItem(title)
|
||||
_id = QStandardItem(self.getUniqueID())
|
||||
row = [name, _id] + [QStandardItem() for i in range(2, len(World))]
|
||||
parent.appendRow(row)
|
||||
return name
|
||||
|
||||
def getUniqueID(self):
|
||||
"Returns an unused ID"
|
||||
|
||||
parentItem = self.invisibleRootItem()
|
||||
vals = []
|
||||
|
||||
def collectIDs(item):
|
||||
vals.append(int(self.itemID(item)))
|
||||
for c in self.children(item):
|
||||
collectIDs(c)
|
||||
|
||||
for c in self.children(parentItem):
|
||||
collectIDs(c)
|
||||
|
||||
k = 0
|
||||
while k in vals: k += 1
|
||||
return str(k)
|
||||
|
||||
def removeItem(self):
|
||||
while self.selectedIndexes():
|
||||
index = self.selectedIndexes()[0]
|
||||
self.removeRows(index.row(), 1, index.parent())
|
||||
|
||||
###############################################################################
|
||||
# TEMPLATES
|
||||
###############################################################################
|
||||
|
||||
def dataSets(self):
|
||||
"Returns sets of empty data that can guide the writer for world building."
|
||||
dataset = {
|
||||
self.tr("Fantasy world building"): [
|
||||
(self.tr("Physical"), [
|
||||
self.tr("Climate"),
|
||||
self.tr("Topography"),
|
||||
self.tr("Astronomy"),
|
||||
self.tr("Natural ressources"),
|
||||
self.tr("Wild life"),
|
||||
self.tr("Flora"),
|
||||
self.tr("History"),
|
||||
self.tr("Races"),
|
||||
self.tr("Diseases"),
|
||||
]),
|
||||
(self.tr("Cultural"), [
|
||||
self.tr("Customs"),
|
||||
self.tr("Food"),
|
||||
self.tr("Languages"),
|
||||
self.tr("Education"),
|
||||
self.tr("Dresses"),
|
||||
self.tr("Science"),
|
||||
self.tr("Calendar"),
|
||||
self.tr("Bodily language"),
|
||||
self.tr("Ethics"),
|
||||
self.tr("Religion"),
|
||||
self.tr("Government"),
|
||||
self.tr("Politics"),
|
||||
self.tr("Gender roles"),
|
||||
self.tr("Music and arts"),
|
||||
self.tr("Architecture"),
|
||||
self.tr("Military"),
|
||||
self.tr("Technology"),
|
||||
self.tr("Courtship"),
|
||||
self.tr("Demography"),
|
||||
self.tr("Transportation"),
|
||||
self.tr("Medicine"),
|
||||
]),
|
||||
(self.tr("Magic system"), [
|
||||
self.tr("Rules"),
|
||||
self.tr("Organization"),
|
||||
self.tr("Magical objects"),
|
||||
self.tr("Magical places"),
|
||||
self.tr("Magical races"),
|
||||
]),
|
||||
self.tr("Important places"),
|
||||
self.tr("Important objects"),
|
||||
]
|
||||
}
|
||||
return dataset
|
||||
|
||||
def emptyDataMenu(self):
|
||||
"Returns a menu with the empty data sets."
|
||||
self.menu = QMenu("menu")
|
||||
for name in self.dataSets():
|
||||
a = QAction(name, self.menu)
|
||||
a.triggered.connect(self.setEmptyData)
|
||||
self.menu.addAction(a)
|
||||
return self.menu
|
||||
|
||||
def setEmptyData(self):
|
||||
"Called from the menu generated with ``emptyDataMenu``."
|
||||
act = self.sender()
|
||||
data = self.dataSets()[act.text()]
|
||||
|
||||
def addItems(data, parent):
|
||||
for d in data:
|
||||
if len(d) == 1 or type(d) == str:
|
||||
self.addItem(d, parent)
|
||||
else:
|
||||
i = self.addItem(d[0], parent)
|
||||
addItems(d[1], i)
|
||||
|
||||
addItems(data, None)
|
||||
self.mw.treeWorld.expandAll()
|
||||
|
||||
###############################################################################
|
||||
# APPEARANCE
|
||||
###############################################################################
|
||||
|
||||
def data(self, index, role=Qt.EditRole):
|
||||
level = 0
|
||||
i = index
|
||||
while i.parent() != QModelIndex():
|
||||
i = i.parent()
|
||||
level += 1
|
||||
|
||||
if role == Qt.BackgroundRole:
|
||||
if level == 0:
|
||||
return QBrush(lightBlue())
|
||||
|
||||
if role == Qt.TextAlignmentRole:
|
||||
if level == 0:
|
||||
return Qt.AlignCenter
|
||||
|
||||
if role == Qt.FontRole:
|
||||
if level in [0, 1]:
|
||||
f = qApp.font()
|
||||
f.setBold(True)
|
||||
return f
|
||||
|
||||
if role == Qt.ForegroundRole:
|
||||
if level == 0:
|
||||
return QBrush(Qt.darkBlue)
|
||||
|
||||
if role == Qt.SizeHintRole:
|
||||
fm = QFontMetrics(qApp.font())
|
||||
h = fm.height()
|
||||
if level == 0:
|
||||
return QSize(0, h + 12)
|
||||
elif level == 1:
|
||||
return QSize(0, h + 6)
|
||||
|
||||
return QStandardItemModel.data(self, index, role)
|
||||
|
|
@ -30,6 +30,7 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
|||
self.outlineModel = None
|
||||
self.persoModel = None
|
||||
self.plotModel = None
|
||||
self.worldModel = None
|
||||
|
||||
self.populateTimer = QTimer(self)
|
||||
self.populateTimer.setSingleShot(True)
|
||||
|
@ -42,13 +43,17 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
|||
self.populate()
|
||||
|
||||
def setModels(self):
|
||||
self.outlineModel = mainWindow().mdlOutline
|
||||
self.persoModel = mainWindow().mdlPersos
|
||||
self.plotModel = mainWindow().mdlPlots
|
||||
mw = mainWindow()
|
||||
self.outlineModel = mw.mdlOutline
|
||||
self.persoModel = mw.mdlPersos
|
||||
self.plotModel = mw.mdlPlots
|
||||
self.worldModel = mw.mdlWorld
|
||||
|
||||
self.outlineModel.dataChanged.connect(self.populateTimer.start)
|
||||
self.persoModel.dataChanged.connect(self.populateTimer.start)
|
||||
self.plotModel.dataChanged.connect(self.populateTimer.start)
|
||||
self.worldModel.dataChanged.connect(self.populateTimer.start)
|
||||
|
||||
self.populate()
|
||||
|
||||
def populate(self):
|
||||
|
@ -89,6 +94,10 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
|||
|
||||
self.data[(self.tr("Plots"), Ref.PlotLetter)] = d
|
||||
|
||||
if self.worldModel:
|
||||
d = self.worldModel.listAll()
|
||||
self.data[(self.tr("World"), Ref.WorldLetter)] = d
|
||||
|
||||
self.updateListFromData()
|
||||
|
||||
def addCategory(self, title):
|
||||
|
@ -109,7 +118,7 @@ class cheatSheet(QWidget, Ui_cheatSheet):
|
|||
self.addCategory(cat[0])
|
||||
for item in filtered:
|
||||
i = QListWidgetItem(item[0])
|
||||
i.setData(Qt.UserRole, Ref.EmptyRef.format(cat[1], item[1]))
|
||||
i.setData(Qt.UserRole, Ref.EmptyRef.format(cat[1], item[1], item[0]))
|
||||
i.setData(Qt.UserRole+1, item[2])
|
||||
self.list.addItem(i)
|
||||
|
||||
|
|
|
@ -64,6 +64,8 @@ class basicHighlighter(QSyntaxHighlighter):
|
|||
fmt.setBackground(QBrush(QColor(Qt.yellow).lighter(170)))
|
||||
elif txt.group(1) == Ref.PlotLetter:
|
||||
fmt.setBackground(QBrush(QColor(Qt.red).lighter(170)))
|
||||
elif txt.group(1) == Ref.WorldLetter:
|
||||
fmt.setBackground(QBrush(QColor(Qt.green).lighter(170)))
|
||||
|
||||
self.setFormat(txt.start(),
|
||||
txt.end() - txt.start(),
|
||||
|
|
|
@ -46,7 +46,7 @@ class completer(QWidget, Ui_completer):
|
|||
self.addCategory(cat[0])
|
||||
for item in filtered:
|
||||
i = QListWidgetItem(item[0])
|
||||
i.setData(Qt.UserRole, Ref.EmptyRef.format(cat[1], item[1]))
|
||||
i.setData(Qt.UserRole, Ref.EmptyRef.format(cat[1], item[1], item[0]))
|
||||
i.setData(Qt.UserRole+1, item[2])
|
||||
self.list.addItem(i)
|
||||
|
||||
|
|
|
@ -704,9 +704,93 @@ class Ui_MainWindow(object):
|
|||
self.verticalLayout_18.addWidget(self.stkPlotSummary)
|
||||
self.verticalLayout_26.addWidget(self.splitterPlot)
|
||||
self.tabMain.addTab(self.lytTabPlot, "")
|
||||
self.tab_5 = QtWidgets.QWidget()
|
||||
self.tab_5.setObjectName("tab_5")
|
||||
self.tabMain.addTab(self.tab_5, "")
|
||||
self.lytTabContext = QtWidgets.QWidget()
|
||||
self.lytTabContext.setObjectName("lytTabContext")
|
||||
self.verticalLayout_33 = QtWidgets.QVBoxLayout(self.lytTabContext)
|
||||
self.verticalLayout_33.setObjectName("verticalLayout_33")
|
||||
self.splitterWorld = QtWidgets.QSplitter(self.lytTabContext)
|
||||
self.splitterWorld.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitterWorld.setObjectName("splitterWorld")
|
||||
self.frame_3 = QtWidgets.QFrame(self.splitterWorld)
|
||||
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.frame_3.setObjectName("frame_3")
|
||||
self.verticalLayout_32 = QtWidgets.QVBoxLayout(self.frame_3)
|
||||
self.verticalLayout_32.setObjectName("verticalLayout_32")
|
||||
self.treeWorld = QtWidgets.QTreeView(self.frame_3)
|
||||
self.treeWorld.setEditTriggers(QtWidgets.QAbstractItemView.EditKeyPressed)
|
||||
self.treeWorld.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
self.treeWorld.setIndentation(15)
|
||||
self.treeWorld.setRootIsDecorated(False)
|
||||
self.treeWorld.setObjectName("treeWorld")
|
||||
self.treeWorld.header().setVisible(False)
|
||||
self.treeWorld.header().setDefaultSectionSize(0)
|
||||
self.verticalLayout_32.addWidget(self.treeWorld)
|
||||
self.horizontalLayout_19 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_19.setObjectName("horizontalLayout_19")
|
||||
self.btnAddWorld = QtWidgets.QPushButton(self.frame_3)
|
||||
self.btnAddWorld.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-add")
|
||||
self.btnAddWorld.setIcon(icon)
|
||||
self.btnAddWorld.setObjectName("btnAddWorld")
|
||||
self.horizontalLayout_19.addWidget(self.btnAddWorld)
|
||||
self.btnRmWorld = QtWidgets.QPushButton(self.frame_3)
|
||||
self.btnRmWorld.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("list-remove")
|
||||
self.btnRmWorld.setIcon(icon)
|
||||
self.btnRmWorld.setObjectName("btnRmWorld")
|
||||
self.horizontalLayout_19.addWidget(self.btnRmWorld)
|
||||
self.txtWorldFilter = QtWidgets.QLineEdit(self.frame_3)
|
||||
self.txtWorldFilter.setProperty("clearButtonEnabled", True)
|
||||
self.txtWorldFilter.setObjectName("txtWorldFilter")
|
||||
self.horizontalLayout_19.addWidget(self.txtWorldFilter)
|
||||
self.btnWorldEmptyData = QtWidgets.QPushButton(self.frame_3)
|
||||
self.btnWorldEmptyData.setText("")
|
||||
icon = QtGui.QIcon.fromTheme("emblem-favorite")
|
||||
self.btnWorldEmptyData.setIcon(icon)
|
||||
self.btnWorldEmptyData.setObjectName("btnWorldEmptyData")
|
||||
self.horizontalLayout_19.addWidget(self.btnWorldEmptyData)
|
||||
self.verticalLayout_32.addLayout(self.horizontalLayout_19)
|
||||
self.tabWorld = QtWidgets.QTabWidget(self.splitterWorld)
|
||||
self.tabWorld.setDocumentMode(True)
|
||||
self.tabWorld.setObjectName("tabWorld")
|
||||
self.tab_3 = QtWidgets.QWidget()
|
||||
self.tab_3.setObjectName("tab_3")
|
||||
self.formLayout_6 = QtWidgets.QFormLayout(self.tab_3)
|
||||
self.formLayout_6.setRowWrapPolicy(QtWidgets.QFormLayout.WrapAllRows)
|
||||
self.formLayout_6.setObjectName("formLayout_6")
|
||||
self.label_30 = QtWidgets.QLabel(self.tab_3)
|
||||
self.label_30.setObjectName("label_30")
|
||||
self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_30)
|
||||
self.txtWorldName = lineEditView(self.tab_3)
|
||||
self.txtWorldName.setObjectName("txtWorldName")
|
||||
self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.txtWorldName)
|
||||
self.label_32 = QtWidgets.QLabel(self.tab_3)
|
||||
self.label_32.setObjectName("label_32")
|
||||
self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_32)
|
||||
self.txtWorldDescription = textEditCompleter(self.tab_3)
|
||||
self.txtWorldDescription.setObjectName("txtWorldDescription")
|
||||
self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.txtWorldDescription)
|
||||
self.tabWorld.addTab(self.tab_3, "")
|
||||
self.tab_4 = QtWidgets.QWidget()
|
||||
self.tab_4.setObjectName("tab_4")
|
||||
self.formLayout_7 = QtWidgets.QFormLayout(self.tab_4)
|
||||
self.formLayout_7.setRowWrapPolicy(QtWidgets.QFormLayout.WrapAllRows)
|
||||
self.formLayout_7.setObjectName("formLayout_7")
|
||||
self.label_33 = QtWidgets.QLabel(self.tab_4)
|
||||
self.label_33.setObjectName("label_33")
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_33)
|
||||
self.txtWorldPassion = textEditCompleter(self.tab_4)
|
||||
self.txtWorldPassion.setObjectName("txtWorldPassion")
|
||||
self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.txtWorldPassion)
|
||||
self.label_34 = QtWidgets.QLabel(self.tab_4)
|
||||
self.label_34.setObjectName("label_34")
|
||||
self.formLayout_7.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_34)
|
||||
self.txtWorldConflict = textEditCompleter(self.tab_4)
|
||||
self.txtWorldConflict.setObjectName("txtWorldConflict")
|
||||
self.formLayout_7.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.txtWorldConflict)
|
||||
self.tabWorld.addTab(self.tab_4, "")
|
||||
self.verticalLayout_33.addWidget(self.splitterWorld)
|
||||
self.tabMain.addTab(self.lytTabContext, "")
|
||||
self.lytTabOutline = QtWidgets.QWidget()
|
||||
self.lytTabOutline.setObjectName("lytTabOutline")
|
||||
self.verticalLayout_27 = QtWidgets.QVBoxLayout(self.lytTabOutline)
|
||||
|
@ -918,6 +1002,14 @@ class Ui_MainWindow(object):
|
|||
self.verticalLayout_22.addWidget(self.tblDebugSubPlots)
|
||||
self.horizontalLayout_11.addLayout(self.verticalLayout_22)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.tab_5 = QtWidgets.QWidget()
|
||||
self.tab_5.setObjectName("tab_5")
|
||||
self.verticalLayout_34 = QtWidgets.QVBoxLayout(self.tab_5)
|
||||
self.verticalLayout_34.setObjectName("verticalLayout_34")
|
||||
self.treeDebugWorld = QtWidgets.QTreeView(self.tab_5)
|
||||
self.treeDebugWorld.setObjectName("treeDebugWorld")
|
||||
self.verticalLayout_34.addWidget(self.treeDebugWorld)
|
||||
self.tabWidget.addTab(self.tab_5, "")
|
||||
self.tab_20 = QtWidgets.QWidget()
|
||||
self.tab_20.setObjectName("tab_20")
|
||||
self.horizontalLayout_32 = QtWidgets.QHBoxLayout(self.tab_20)
|
||||
|
@ -1049,14 +1141,15 @@ class Ui_MainWindow(object):
|
|||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.stack.setCurrentIndex(1)
|
||||
self.tabMain.setCurrentIndex(3)
|
||||
self.tabMain.setCurrentIndex(4)
|
||||
self.tabSummary.setCurrentIndex(0)
|
||||
self.tabPersos.setCurrentIndex(3)
|
||||
self.tabPlot.setCurrentIndex(1)
|
||||
self.tabPersos.setCurrentIndex(0)
|
||||
self.tabPlot.setCurrentIndex(0)
|
||||
self.comboBox_2.setCurrentIndex(0)
|
||||
self.stkPlotSummary.setCurrentIndex(0)
|
||||
self.tabWorld.setCurrentIndex(0)
|
||||
self.tabRedacInfos.setCurrentIndex(0)
|
||||
self.tabWidget.setCurrentIndex(1)
|
||||
self.tabWidget.setCurrentIndex(3)
|
||||
self.btnPlotShowSummary.toggled['bool'].connect(self.grpPlotSummary.setVisible)
|
||||
self.comboBox_2.currentIndexChanged['int'].connect(self.stkPlotSummary.setCurrentIndex)
|
||||
self.btnPlanShowDetails.toggled['bool'].connect(self.frame.setVisible)
|
||||
|
@ -1131,7 +1224,16 @@ class Ui_MainWindow(object):
|
|||
self.comboBox_2.setItemText(1, _translate("MainWindow", "One page"))
|
||||
self.comboBox_2.setItemText(2, _translate("MainWindow", "Full"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.lytTabPlot), _translate("MainWindow", "Plots"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.tab_5), _translate("MainWindow", "Context"))
|
||||
self.txtWorldFilter.setPlaceholderText(_translate("MainWindow", "Filter"))
|
||||
self.btnWorldEmptyData.setToolTip(_translate("MainWindow", "Populates with empty data"))
|
||||
self.btnWorldEmptyData.setStatusTip(_translate("MainWindow", "Populates with empty data"))
|
||||
self.label_30.setText(_translate("MainWindow", "Name"))
|
||||
self.label_32.setText(_translate("MainWindow", "Description"))
|
||||
self.tabWorld.setTabText(self.tabWorld.indexOf(self.tab_3), _translate("MainWindow", "General"))
|
||||
self.label_33.setText(_translate("MainWindow", "Source of passion"))
|
||||
self.label_34.setText(_translate("MainWindow", "Source of conflict"))
|
||||
self.tabWorld.setTabText(self.tabWorld.indexOf(self.tab_4), _translate("MainWindow", "More"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.lytTabContext), _translate("MainWindow", "World"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.lytTabOutline), _translate("MainWindow", "Outline"))
|
||||
self.tabRedacInfos.setTabText(self.tabRedacInfos.indexOf(self.tab_17), _translate("MainWindow", "Metadata"))
|
||||
self.grpCheatSheet.setTitle(_translate("MainWindow", "Cheat sheet"))
|
||||
|
@ -1141,6 +1243,7 @@ class Ui_MainWindow(object):
|
|||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_9), _translate("MainWindow", "FlatData"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_10), _translate("MainWindow", "Persos"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Plots"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("MainWindow", "World"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_20), _translate("MainWindow", "Outline"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Labels"))
|
||||
self.tabMain.setTabText(self.tabMain.indexOf(self.lytTabDebug), _translate("MainWindow", "Debug"))
|
||||
|
@ -1177,17 +1280,18 @@ class Ui_MainWindow(object):
|
|||
self.actCompile.setText(_translate("MainWindow", "Compile"))
|
||||
self.actCompile.setShortcut(_translate("MainWindow", "F6"))
|
||||
|
||||
from ui.views.outlineView import outlineView
|
||||
from ui.sldImportance import sldImportance
|
||||
from ui.editors.mainEditor import mainEditor
|
||||
from ui.cheatSheet import cheatSheet
|
||||
from ui.views.lineEditView import lineEditView
|
||||
from ui.views.metadataView import metadataView
|
||||
from ui.views.basicItemView import basicItemView
|
||||
from ui.welcome import welcome
|
||||
from ui.views.textEditView import textEditView
|
||||
from ui.collapsibleGroupBox2 import collapsibleGroupBox2
|
||||
from ui.search import search
|
||||
from ui.views.plotTreeView import plotTreeView
|
||||
from ui.views.textEditCompleter import textEditCompleter
|
||||
from ui.search import search
|
||||
from ui.cheatSheet import cheatSheet
|
||||
from ui.views.textEditView import textEditView
|
||||
from ui.views.metadataView import metadataView
|
||||
from ui.views.outlineView import outlineView
|
||||
from ui.views.basicItemView import basicItemView
|
||||
from ui.views.lineEditView import lineEditView
|
||||
from ui.editors.mainEditor import mainEditor
|
||||
from ui.sldImportance import sldImportance
|
||||
from ui.views.persoTreeView import persoTreeView
|
||||
from ui.collapsibleGroupBox2 import collapsibleGroupBox2
|
||||
from ui.views.treeView import treeView
|
||||
from ui.welcome import welcome
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabMain">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>true</bool>
|
||||
|
@ -717,7 +717,7 @@
|
|||
</widget>
|
||||
<widget class="QTabWidget" name="tabPersos">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="infos">
|
||||
<attribute name="title">
|
||||
|
@ -1083,7 +1083,7 @@
|
|||
</widget>
|
||||
<widget class="QTabWidget" name="tabPlot">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>true</bool>
|
||||
|
@ -1367,10 +1367,168 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_5">
|
||||
<widget class="QWidget" name="lytTabContext">
|
||||
<attribute name="title">
|
||||
<string>Context</string>
|
||||
<string>World</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_33">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitterWorld">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_32">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeWorld">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditKeyPressed</set>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="indentation">
|
||||
<number>15</number>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="headerDefaultSectionSize">
|
||||
<number>0</number>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnAddWorld">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-add">
|
||||
<normaloff>../../../../../../../.designer/backup</normaloff>../../../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnRmWorld">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="list-remove">
|
||||
<normaloff>../../../../../../../.designer/backup</normaloff>../../../../../../../.designer/backup</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="txtWorldFilter">
|
||||
<property name="placeholderText">
|
||||
<string>Filter</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnWorldEmptyData">
|
||||
<property name="toolTip">
|
||||
<string>Populates with empty data</string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Populates with empty data</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="emblem-favorite"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QTabWidget" name="tabWorld">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout_6">
|
||||
<property name="rowWrapPolicy">
|
||||
<enum>QFormLayout::WrapAllRows</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_30">
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="lineEditView" name="txtWorldName"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_32">
|
||||
<property name="text">
|
||||
<string>Description</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="textEditCompleter" name="txtWorldDescription"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>More</string>
|
||||
</attribute>
|
||||
<layout class="QFormLayout" name="formLayout_7">
|
||||
<property name="rowWrapPolicy">
|
||||
<enum>QFormLayout::WrapAllRows</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_33">
|
||||
<property name="text">
|
||||
<string>Source of passion</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="textEditCompleter" name="txtWorldPassion"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_34">
|
||||
<property name="text">
|
||||
<string>Source of conflict</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="textEditCompleter" name="txtWorldConflict"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="lytTabOutline">
|
||||
<attribute name="title">
|
||||
|
@ -1693,7 +1851,7 @@
|
|||
<enum>QTabWidget::West</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_9">
|
||||
<attribute name="title">
|
||||
|
@ -1738,6 +1896,16 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_5">
|
||||
<attribute name="title">
|
||||
<string>World</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_34">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeDebugWorld"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_20">
|
||||
<attribute name="title">
|
||||
<string>Outline</string>
|
||||
|
@ -2092,6 +2260,11 @@
|
|||
<header>ui.search.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>textEditCompleter</class>
|
||||
<extends>QTextEdit</extends>
|
||||
<header>ui.views.textEditCompleter.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
|
|
@ -28,7 +28,8 @@ class lineEditView(QLineEdit):
|
|||
if index.column() != self._column:
|
||||
index = index.sibling(index.row(), self._column)
|
||||
self._index = index
|
||||
self.item = index.internalPointer()
|
||||
self._model = index.model()
|
||||
#self.item = index.internalPointer()
|
||||
if self._placeholderText != None:
|
||||
self.setPlaceholderText(self._placeholderText)
|
||||
self.textEdited.connect(self.submit)
|
||||
|
@ -49,14 +50,14 @@ class lineEditView(QLineEdit):
|
|||
|
||||
def submit(self):
|
||||
if self._index:
|
||||
item = self._index.internalPointer()
|
||||
#item = self._index.internalPointer()
|
||||
if self.text() != self._model.data(self._index):
|
||||
self._model.setData(self._index, self.text())
|
||||
|
||||
elif self._indexes:
|
||||
self._updating = True
|
||||
for i in self._indexes:
|
||||
item = i.internalPointer()
|
||||
#item = i.internalPointer()
|
||||
if self.text() != self._model.data(i):
|
||||
self._model.setData(i, self.text())
|
||||
self._updating = False
|
||||
|
@ -91,9 +92,10 @@ class lineEditView(QLineEdit):
|
|||
t = []
|
||||
same = True
|
||||
for i in self._indexes:
|
||||
item = i.internalPointer()
|
||||
t.append(toString(item.data(self._column)))
|
||||
|
||||
#item = i.internalPointer()
|
||||
#t.append(toString(item.data(self._column)))
|
||||
t.append(toString(self._model.data(i)))
|
||||
|
||||
for t2 in t[1:]:
|
||||
if t2 != t[0]:
|
||||
same = False
|
||||
|
|
|
@ -141,7 +141,10 @@ class textEditCompleter(textEditView):
|
|||
|
||||
def getRefRects(self):
|
||||
cursor = self.textCursor()
|
||||
fm = QFontMetrics(self.font())
|
||||
f = self.font()
|
||||
f.setFixedPitch(True)
|
||||
f.setWeight(QFont.DemiBold)
|
||||
fm = QFontMetrics(f)
|
||||
refs = []
|
||||
for txt in re.finditer(Ref.RegEx, self.toPlainText()):
|
||||
cursor.setPosition(txt.start())
|
||||
|
|
|
@ -113,12 +113,11 @@ class textEditView(QTextEdit):
|
|||
|
||||
if not self._model:
|
||||
self.setModel(index.model())
|
||||
|
||||
|
||||
self.setupEditorForIndex(self._index)
|
||||
self.loadFontSettings()
|
||||
self.updateText()
|
||||
|
||||
|
||||
|
||||
else:
|
||||
self._index = QModelIndex()
|
||||
|
||||
|
@ -142,7 +141,6 @@ class textEditView(QTextEdit):
|
|||
self.updateText()
|
||||
|
||||
def setupEditorForIndex(self, index):
|
||||
|
||||
# what type of text are we editing?
|
||||
if type(index.model()) != outlineModel:
|
||||
self._textFormat = "text"
|
||||
|
@ -319,7 +317,7 @@ class textEditView(QTextEdit):
|
|||
return
|
||||
#print("Submitting", self.objectName())
|
||||
if self._index:
|
||||
item = self._index.internalPointer()
|
||||
#item = self._index.internalPointer()
|
||||
if self._textFormat == "html":
|
||||
if self.toHtml() != self._model.data(self._index):
|
||||
#print(" Submitting html")
|
||||
|
|
Loading…
Reference in a new issue