From 09e1f3f2e9d6fe8332fbd72df67c3691faff3bc8 Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Thu, 11 Jun 2015 08:55:24 +0200 Subject: [PATCH] UI improvements --- i18n/snowflaQe.pro | 4 + i18n/snowflaQe_fr.qm | Bin 10862 -> 11453 bytes i18n/snowflaQe_fr.ts | 268 +++++++++++-------- src/ui/mainWindow.py | 8 +- src/ui/mainWindow.ui | 2 +- src/ui/{ => views}/chkOutlineCompile.py | 0 src/ui/{ => views}/cmbOutlineLabelChoser.py | 23 +- src/ui/{ => views}/cmbOutlinePersoChoser.py | 26 +- src/ui/{ => views}/cmbOutlineStatusChoser.py | 23 +- src/ui/views/lineEditView.py | 2 +- src/ui/views/propertiesView_ui.py | 10 +- src/ui/views/propertiesView_ui.ui | 10 +- test_project/outline.xml | 8 +- 13 files changed, 248 insertions(+), 136 deletions(-) rename src/ui/{ => views}/chkOutlineCompile.py (100%) rename src/ui/{ => views}/cmbOutlineLabelChoser.py (81%) rename src/ui/{ => views}/cmbOutlinePersoChoser.py (82%) rename src/ui/{ => views}/cmbOutlineStatusChoser.py (81%) diff --git a/i18n/snowflaQe.pro b/i18n/snowflaQe.pro index 2fa9ef8..90f18bf 100644 --- a/i18n/snowflaQe.pro +++ b/i18n/snowflaQe.pro @@ -13,6 +13,10 @@ SOURCES += ../src/ui/editors/customTextEdit.py SOURCES += ../src/ui/editors/editorWidget.py SOURCES += ../src/ui/views/corkDelegate.py SOURCES += ../src/ui/views/outlineBasics.py +SOURCES += ../src/ui/views/cmbOutlineLabelChoser.py +SOURCES += ../src/ui/views/cmbOutlinePersoChoser.py +SOURCES += ../src/ui/views/cmbOutlineStatusChoser.py +SOURCES += ../src/ui/views/lineEditView.py SOURCES += ../src/settingsWindow.py diff --git a/i18n/snowflaQe_fr.qm b/i18n/snowflaQe_fr.qm index 8f480a289952379be19ab0705e114e59688726a8..fa4f20b97b06f0ede6cca6b921f72001844aa413 100644 GIT binary patch delta 1669 zcmbVL4NR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9vtXSZjvJ)Sw`6Dq2bp+TUQ^o`<839Qhg)Snt7M~q+qPO+*}*D~ zLdAVM2PcjzB~A_`O;H+qzTy2CW%v4i(xbe${R%gwNjZ}p%YnO<$q?(uZc;7|u5_k;#oYpwmY^XKqe#qkrCYbtc z6kKq`^r`0p&&SNR$uI*NQYM7ndN{jT0xbb z%+of1n_Ej~Iog2)wj!lMyVOZWcW6J?PXlVek~2G?kLaCTUNZ9&xChcwmY~v zTJbznG;6+Ha^SC6+aB|=&WG05Q`rgE)hB@rm%l~$gip&%_7%q1{E^0wR9`<|4jXL# zBX+y=eVG~m|I6ukukiJ%7FpU{+x)cehB?+>l+-Kzm(rH%{Ph`obpCBi3UvPh*ybkq diff --git a/i18n/snowflaQe_fr.ts b/i18n/snowflaQe_fr.ts index 58ea2b9..f378224 100644 --- a/i18n/snowflaQe_fr.ts +++ b/i18n/snowflaQe_fr.ts @@ -129,7 +129,7 @@ Noms - + Filter Filtre @@ -149,7 +149,7 @@ Motivation - + Goal Goal @@ -174,7 +174,7 @@ <html><head/><body><p align="right">Résumé<br/>en un paragraphe</p></body></html> - + Notes Notes @@ -244,7 +244,7 @@ Contexte - + Outline Plan @@ -269,7 +269,7 @@ Goal: - + One line scene summary Résumé en une ligne @@ -284,7 +284,7 @@ Rédaction - + F11 @@ -294,310 +294,260 @@ Scène - + Properties Propriétés - - POV - POV - - - - Status - - - - - Compile - Compile - - - + Scene summary Résumé de la scène - + Tools Outils - + Cheat sheet Aide-mémoire - + Albert - perso - + Jean - perso - + Crapoquak - animal - + La revenche du capitaine - intrigue - + Debug - + FlatData - + Persos - + Perso Infos - + File Fichier - + Help Aide - + Open Ouvrir - + Ctrl+O - + Recents Récents - + Ctrl+R - + Save Enregistrer - + Ctrl+S Ctrl+S - + Save as... Enregistrer sous... - + Ctrl+Shift+S - + Quit Quitter - + Ctrl+Q - + &Snowflake - + New Nouveau - + Ctrl+N - + Show help texts Montrer les bulles d'aides - + Ctrl+Shift+B - + Spellcheck Correcteur orthographique - + F8 - + Word count Nombre de mots - + Mode Mode - + New character Nouveau perso - + (~{} pages) (~{} pages) - + Enter infos about your book, and yourself. Entrez toutes les informations relatives au livre, ainsi qu'à vous. - + 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. 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. - + Create your characters. Créez ici vos personnage. - + Develop plots. Développez vos intrigues. - + Create the outline of your masterpiece. Créez le plan de votre chef-d'œuvre. - + Write. Écrivez. - + Debug infos. Sometimes useful. Des infos pour débugger des fois pendant qu'on code c'est utile. - + Dictionary Dictionnaire - + Install PyEnchant to use spellcheck Installez PyEnchant pour profiter du correcteur orthographique - + Words: {}{} Mots: {}{} - + Text Texte - + Cork Cork - - Label - Label - - - + Labels Labels - + Edit Édition - + Labels... Labels... - + Status... Status... - - - Un bâteau arrive au port et personne ne sait pourquoi - - - - - Le roi envoie des émissaires à bord. Ils ne reviennent jamais. - - - - - Le roi envoie son armée. - - - - - Intrigue général - - - - - Scène 1 - - - - - Scène 2 - - Idea @@ -633,6 +583,36 @@ Final Final + + + Un bâteau arrive au port et personne ne sait pourquoi + + + + + Le roi envoie des émissaires à bord. Ils ne reviennent jamais. + + + + + Le roi envoie son armée. + + + + + Intrigue général + + + + + Scène 1 + + + + + Scène 2 + + SpellAction @@ -655,6 +635,30 @@ La traduction pour {} n'a pas pu être chargée... + + cmbOutlineLabelChoser + + + Various + Différentes valeurs + + + + cmbOutlinePersoChoser + + + Various + Différentes valeurs + + + + cmbOutlineStatusChoser + + + Various + Différentes valeurs + + corkDelegate @@ -671,12 +675,12 @@ editorWidget - + {} words / {} {} mots / {} - + {} words {} mots @@ -697,6 +701,14 @@ Infobulle: Si tu me trouve dérengant, tu peux me cacher via le menu Aide. + + lineEditView + + + Various + Différentes valeurs + + outlineBasics @@ -755,6 +767,44 @@ Nouveau + + propertiesView + + + Form + Form + + + + POV + POV + + + + Status + Status + + + + Label + Label + + + + Compile + Compile + + + + Goal + Goal + + + + Word count + Nombre de mots + + qApp diff --git a/src/ui/mainWindow.py b/src/ui/mainWindow.py index 92e7d6d..9e23229 100644 --- a/src/ui/mainWindow.py +++ b/src/ui/mainWindow.py @@ -1299,10 +1299,10 @@ class Ui_MainWindow(object): self.actLabels.setText(_translate("MainWindow", "Labels...")) self.actStatus.setText(_translate("MainWindow", "Status...")) -from ui.views.treeView import treeView -from ui.cmbOutlinePersoChoser import cmbOutlinePersoChoser from ui.views.outlineView import outlineView -from ui.sldImportance import sldImportance -from ui.collapsibleGroupBox2 import collapsibleGroupBox2 from ui.editors.editorWidget import editorWidget from ui.views.propertiesView import propertiesView +from ui.collapsibleGroupBox2 import collapsibleGroupBox2 +from ui.sldImportance import sldImportance +from ui.views.cmbOutlinePersoChoser import cmbOutlinePersoChoser +from ui.views.treeView import treeView diff --git a/src/ui/mainWindow.ui b/src/ui/mainWindow.ui index 5677e7d..0ec7879 100644 --- a/src/ui/mainWindow.ui +++ b/src/ui/mainWindow.ui @@ -2239,7 +2239,7 @@ cmbOutlinePersoChoser QComboBox -
ui.cmbOutlinePersoChoser.h
+
ui.views.cmbOutlinePersoChoser.h
editorWidget diff --git a/src/ui/chkOutlineCompile.py b/src/ui/views/chkOutlineCompile.py similarity index 100% rename from src/ui/chkOutlineCompile.py rename to src/ui/views/chkOutlineCompile.py diff --git a/src/ui/cmbOutlineLabelChoser.py b/src/ui/views/cmbOutlineLabelChoser.py similarity index 81% rename from src/ui/cmbOutlineLabelChoser.py rename to src/ui/views/cmbOutlineLabelChoser.py index 1eeb48e..68d1f54 100644 --- a/src/ui/cmbOutlineLabelChoser.py +++ b/src/ui/views/cmbOutlineLabelChoser.py @@ -13,6 +13,7 @@ class cmbOutlineLabelChoser(QComboBox): self._index = None self._indexes = None self._updating = False + self._various = False def setModels(self, mdlLabels, mdlOutline): self.mdlLabels = mdlLabels @@ -28,6 +29,8 @@ class cmbOutlineLabelChoser(QComboBox): if item: self.addItem(item.icon(), item.text()) + + self._various = False if self._index or self._indexes: self.updateSelectedItem() @@ -37,6 +40,7 @@ class cmbOutlineLabelChoser(QComboBox): if index.column() != self._column: index = index.sibling(index.row(), self._column) self._index = index + self.updateItems() self.updateSelectedItem() def setCurrentModelIndexes(self, indexes): @@ -49,6 +53,7 @@ class cmbOutlineLabelChoser(QComboBox): i = i.sibling(i.row(), self._column) self._indexes.append(i) + self.updateItems() self.updateSelectedItem() def update(self, topLeft, bottomRight): @@ -98,9 +103,17 @@ class cmbOutlineLabelChoser(QComboBox): break if same: + self._various = False self.setCurrentIndex(labels[0]) else: + if not self._various: + self.insertItem(0, self.tr("Various")) + f = self.font() + f.setItalic(True) + self.setItemData(0, f, Qt.FontRole) + self.setItemData(0, QBrush(Qt.darkGray), Qt.ForegroundRole) + self._various = True self.setCurrentIndex(0) else: @@ -111,8 +124,16 @@ class cmbOutlineLabelChoser(QComboBox): self.mdlOutline.setData(self._index, self.currentIndex()) elif self._indexes: + value = self.currentIndex() + + if self._various: + if value == 0: + return + + value -= 1 + self._updating = True for i in self._indexes: - self.mdlOutline.setData(i, self.currentIndex()) + self.mdlOutline.setData(i, value) self._updating = False \ No newline at end of file diff --git a/src/ui/cmbOutlinePersoChoser.py b/src/ui/views/cmbOutlinePersoChoser.py similarity index 82% rename from src/ui/cmbOutlinePersoChoser.py rename to src/ui/views/cmbOutlinePersoChoser.py index f188622..000c1cd 100644 --- a/src/ui/cmbOutlinePersoChoser.py +++ b/src/ui/views/cmbOutlinePersoChoser.py @@ -16,6 +16,7 @@ class cmbOutlinePersoChoser(QComboBox): self._index = None self._indexes = None self._updating = False + self._various = False def setModels(self, mdlPersos, mdlOutline): self.mdlPersos = mdlPersos @@ -33,7 +34,9 @@ class cmbOutlinePersoChoser(QComboBox): self.setItemData(i+1, self.mdlPersos.item(i, Perso.name.value).text(), Qt.ToolTipRole) except: pass - + + self._various = False + if self._index or self._indexes: self.updateSelectedItem() @@ -42,19 +45,21 @@ class cmbOutlinePersoChoser(QComboBox): if index.column() != self._column: index = index.sibling(index.row(), self._column) self._index = index - self.updateSelectedItem() + self.updateItems() def setCurrentModelIndexes(self, indexes): - self._indexes = [] self._index = None + idxes = [] for i in indexes: if i.isValid(): if i.column() != self._column: i = i.sibling(i.row(), self._column) - self._indexes.append(i) + idxes.append(i) - self.updateSelectedItem() + if idxes != self._indexes: + self._indexes = idxes + self.updateItems() def update(self, topLeft, bottomRight): @@ -108,9 +113,17 @@ class cmbOutlinePersoChoser(QComboBox): break if same: + self._various = False self.selectPOV(POVs[0]) else: + if not self._various: + self.insertItem(0, self.tr("Various")) + f = self.font() + f.setItalic(True) + self.setItemData(0, f, Qt.FontRole) + self.setItemData(0, QBrush(Qt.darkGray), Qt.ForegroundRole) + self._various = True self.setCurrentIndex(0) else: @@ -121,6 +134,9 @@ class cmbOutlinePersoChoser(QComboBox): self.mdlOutline.setData(self._index, self.currentData()) elif self._indexes: + if self._various and self.currentIndex() == 0: + return + self._updating = True for i in self._indexes: self.mdlOutline.setData(i, self.currentData()) diff --git a/src/ui/cmbOutlineStatusChoser.py b/src/ui/views/cmbOutlineStatusChoser.py similarity index 81% rename from src/ui/cmbOutlineStatusChoser.py rename to src/ui/views/cmbOutlineStatusChoser.py index aec34f3..89d442d 100644 --- a/src/ui/cmbOutlineStatusChoser.py +++ b/src/ui/views/cmbOutlineStatusChoser.py @@ -14,6 +14,7 @@ class cmbOutlineStatusChoser(QComboBox): self._index = None self._indexes = None self._updating = False + self._various = False def setModels(self, mdlStatus, mdlOutline): self.mdlStatus = mdlStatus @@ -29,6 +30,8 @@ class cmbOutlineStatusChoser(QComboBox): if item: self.addItem(item.text()) + self._various = False + if self._index or self._indexes: self.updateSelectedItem() @@ -37,6 +40,7 @@ class cmbOutlineStatusChoser(QComboBox): if index.column() != self._column: index = index.sibling(index.row(), self._column) self._index = index + self.updateItems() self.updateSelectedItem() def setCurrentModelIndexes(self, indexes): @@ -49,6 +53,7 @@ class cmbOutlineStatusChoser(QComboBox): i = i.sibling(i.row(), self._column) self._indexes.append(i) + self.updateItems() self.updateSelectedItem() def update(self, topLeft, bottomRight): @@ -98,9 +103,17 @@ class cmbOutlineStatusChoser(QComboBox): break if same: + self._various = False self.setCurrentIndex(statuses[0]) else: + if not self._various: + self.insertItem(0, self.tr("Various")) + f = self.font() + f.setItalic(True) + self.setItemData(0, f, Qt.FontRole) + self.setItemData(0, QBrush(Qt.darkGray), Qt.ForegroundRole) + self._various = True self.setCurrentIndex(0) else: @@ -111,7 +124,15 @@ class cmbOutlineStatusChoser(QComboBox): self.mdlOutline.setData(self._index, self.currentIndex()) elif self._indexes: + value = self.currentIndex() + + if self._various: + if value == 0: + return + + value -= 1 + self._updating = True for i in self._indexes: - self.mdlOutline.setData(i, self.currentIndex()) + self.mdlOutline.setData(i, value) self._updating = False \ No newline at end of file diff --git a/src/ui/views/lineEditView.py b/src/ui/views/lineEditView.py index b6a395d..ce4e7b5 100644 --- a/src/ui/views/lineEditView.py +++ b/src/ui/views/lineEditView.py @@ -107,5 +107,5 @@ class lineEditView(QLineEdit): if not self._placeholderText: self._placeholderText = self.placeholderText() - self.setPlaceholderText("Various") + self.setPlaceholderText(self.tr("Various")) \ No newline at end of file diff --git a/src/ui/views/propertiesView_ui.py b/src/ui/views/propertiesView_ui.py index 120f0ae..9b75a93 100644 --- a/src/ui/views/propertiesView_ui.py +++ b/src/ui/views/propertiesView_ui.py @@ -11,7 +11,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_propertiesView(object): def setupUi(self, propertiesView): propertiesView.setObjectName("propertiesView") - propertiesView.resize(192, 153) + propertiesView.resize(192, 159) self.verticalLayout = QtWidgets.QVBoxLayout(propertiesView) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") @@ -181,8 +181,8 @@ class Ui_propertiesView(object): self.label_36.setText(_translate("propertiesView", "Goal")) self.txtGoalMulti.setPlaceholderText(_translate("propertiesView", "Word count")) +from ui.views.cmbOutlineLabelChoser import cmbOutlineLabelChoser +from ui.views.cmbOutlinePersoChoser import cmbOutlinePersoChoser from ui.views.lineEditView import lineEditView -from ui.chkOutlineCompile import chkOutlineCompile -from ui.cmbOutlineLabelChoser import cmbOutlineLabelChoser -from ui.cmbOutlineStatusChoser import cmbOutlineStatusChoser -from ui.cmbOutlinePersoChoser import cmbOutlinePersoChoser +from ui.views.cmbOutlineStatusChoser import cmbOutlineStatusChoser +from ui.views.chkOutlineCompile import chkOutlineCompile diff --git a/src/ui/views/propertiesView_ui.ui b/src/ui/views/propertiesView_ui.ui index a17f821..8c638a5 100644 --- a/src/ui/views/propertiesView_ui.ui +++ b/src/ui/views/propertiesView_ui.ui @@ -7,7 +7,7 @@ 0 0 192 - 153 + 159 @@ -277,22 +277,22 @@ cmbOutlinePersoChoser QComboBox -
ui.cmbOutlinePersoChoser.h
+
ui.views.cmbOutlinePersoChoser.h
cmbOutlineStatusChoser QComboBox -
ui.cmbOutlineStatusChoser.h
+
ui.views.cmbOutlineStatusChoser.h
chkOutlineCompile QCheckBox -
ui.chkOutlineCompile.h
+
ui.views.chkOutlineCompile.h
cmbOutlineLabelChoser QComboBox -
ui.cmbOutlineLabelChoser.h
+
ui.views.cmbOutlineLabelChoser.h
lineEditView diff --git a/test_project/outline.xml b/test_project/outline.xml index 8590255..2172658 100644 --- a/test_project/outline.xml +++ b/test_project/outline.xml @@ -3,7 +3,7 @@ - + @@ -51,13 +51,13 @@ - - + + - +