A tad more options for revisions

This commit is contained in:
Olivier Keshavjee 2015-07-03 23:00:54 +02:00
parent 6779e64fc3
commit f17be2ba5d
12 changed files with 840 additions and 138 deletions

Binary file not shown.

View file

@ -587,408 +587,408 @@
<translation>Général</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="26"/>
<location filename="../src/ui/settings.ui" line="31"/>
<source>Views</source>
<translation>Apparence</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1918"/>
<location filename="../src/ui/settings.ui" line="2225"/>
<source>Labels</source>
<translation>Labels</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2050"/>
<location filename="../src/ui/settings.ui" line="2357"/>
<source>Status</source>
<translation>Status</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2124"/>
<location filename="../src/ui/settings.ui" line="2431"/>
<source>Fullscreen</source>
<translation>Plein écran</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="74"/>
<location filename="../src/ui/settings.ui" line="79"/>
<source>General settings</source>
<translation>Réglages généraux</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="90"/>
<location filename="../src/ui/settings.ui" line="95"/>
<source>Application style</source>
<translation>Style de l&apos;application</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="162"/>
<location filename="../src/ui/settings.ui" line="167"/>
<source>Saving</source>
<translation>Enregistrement</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="176"/>
<location filename="../src/ui/settings.ui" line="181"/>
<source>Automatically save every</source>
<translation>Enregistrer automatiquement toutes les</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="223"/>
<location filename="../src/ui/settings.ui" line="228"/>
<source>minutes.</source>
<translation>minutes.</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="259"/>
<location filename="../src/ui/settings.ui" line="264"/>
<source>If no changes during</source>
<translation>S&apos;il n&apos;y a pas de modification durant</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="306"/>
<location filename="../src/ui/settings.ui" line="311"/>
<source>seconds.</source>
<translation>secondes.</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="340"/>
<location filename="../src/ui/settings.ui" line="345"/>
<source>Save on quit</source>
<translation>Enregistrer en quittant</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="429"/>
<location filename="../src/ui/settings.ui" line="736"/>
<source>Views settings</source>
<translation>Apparence</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="443"/>
<location filename="../src/ui/settings.ui" line="750"/>
<source>Tree</source>
<translation>Arbre</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="802"/>
<location filename="../src/ui/settings.ui" line="1109"/>
<source>Colors</source>
<translation>Couleurs</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1160"/>
<location filename="../src/ui/settings.ui" line="1467"/>
<source>Icon color:</source>
<translation>Icone:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1366"/>
<location filename="../src/ui/settings.ui" line="1673"/>
<source>Nothing</source>
<translation>Rien</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1371"/>
<location filename="../src/ui/settings.ui" line="1678"/>
<source>POV</source>
<translation>POV</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1376"/>
<location filename="../src/ui/settings.ui" line="1683"/>
<source>Label</source>
<translation>Label</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1381"/>
<location filename="../src/ui/settings.ui" line="1688"/>
<source>Progress</source>
<translation>Progrès</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1386"/>
<location filename="../src/ui/settings.ui" line="1693"/>
<source>Compile</source>
<translation>Compilation</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1208"/>
<location filename="../src/ui/settings.ui" line="1515"/>
<source>Text color:</source>
<translation>Texte:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1256"/>
<location filename="../src/ui/settings.ui" line="1563"/>
<source>Background color:</source>
<translation>Arrière-plan:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="637"/>
<location filename="../src/ui/settings.ui" line="944"/>
<source>Folders</source>
<translation>Dossiers</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="649"/>
<location filename="../src/ui/settings.ui" line="956"/>
<source>Show item count</source>
<translation>Afficher le nombre de sous-éléments</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="719"/>
<location filename="../src/ui/settings.ui" line="1026"/>
<source>Show wordcount</source>
<translation>Afficher le nombre de mots</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="732"/>
<location filename="../src/ui/settings.ui" line="1039"/>
<source>Show progress</source>
<translation>Afficher le progrès</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="707"/>
<location filename="../src/ui/settings.ui" line="1014"/>
<source>Text</source>
<translation>Texte</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="790"/>
<location filename="../src/ui/settings.ui" line="1097"/>
<source>Outline</source>
<translation>Plan</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="982"/>
<location filename="../src/ui/settings.ui" line="1289"/>
<source>Visible columns</source>
<translation>Colonnes visibles</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="994"/>
<location filename="../src/ui/settings.ui" line="1301"/>
<source>Goal</source>
<translation>Goal</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1010"/>
<location filename="../src/ui/settings.ui" line="1317"/>
<source>Word count</source>
<translation>Nombre de mots</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1026"/>
<location filename="../src/ui/settings.ui" line="1333"/>
<source>Percentage</source>
<translation>Pourcentage</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1106"/>
<location filename="../src/ui/settings.ui" line="1413"/>
<source>Title</source>
<translation>Titre</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1133"/>
<location filename="../src/ui/settings.ui" line="1440"/>
<source>Index cards</source>
<translation>Cartes</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1145"/>
<location filename="../src/ui/settings.ui" line="1452"/>
<source>Item colors</source>
<translation>Couleurs des cartes</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1304"/>
<location filename="../src/ui/settings.ui" line="1611"/>
<source>Border color:</source>
<translation>Bordure:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1352"/>
<location filename="../src/ui/settings.ui" line="1659"/>
<source>Corner color:</source>
<translation>Coin:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1403"/>
<location filename="../src/ui/settings.ui" line="1710"/>
<source>Background</source>
<translation>Arrière-plan</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2585"/>
<location filename="../src/ui/settings.ui" line="2892"/>
<source>Color:</source>
<translation>Couleur:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1965"/>
<location filename="../src/ui/settings.ui" line="2272"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2327"/>
<location filename="../src/ui/settings.ui" line="2634"/>
<source>Image:</source>
<translation>Image:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2162"/>
<location filename="../src/ui/settings.ui" line="2469"/>
<source>New</source>
<translation>Nouveau</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2176"/>
<location filename="../src/ui/settings.ui" line="2483"/>
<source>Edit</source>
<translation>Modifier</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2186"/>
<location filename="../src/ui/settings.ui" line="2493"/>
<source>Delete</source>
<translation>Supprimer</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2221"/>
<location filename="../src/ui/settings.ui" line="2528"/>
<source>Theme name:</source>
<translation>Nom du thème:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2237"/>
<location filename="../src/ui/settings.ui" line="2544"/>
<source>Apply</source>
<translation>Enregistrer</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2250"/>
<location filename="../src/ui/settings.ui" line="2557"/>
<source>Cancel</source>
<translation>Annuler</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2280"/>
<location filename="../src/ui/settings.ui" line="2587"/>
<source>Window Background</source>
<translation>Arrière plan de la fenêtre</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2285"/>
<location filename="../src/ui/settings.ui" line="2592"/>
<source>Text Background</source>
<translation>Arrière plan du texte</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2290"/>
<location filename="../src/ui/settings.ui" line="2597"/>
<source>Text Options</source>
<translation>Options du texte</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2295"/>
<location filename="../src/ui/settings.ui" line="2602"/>
<source>Paragraph Options</source>
<translation>Options des paragraphes</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2337"/>
<location filename="../src/ui/settings.ui" line="2644"/>
<source>Type:</source>
<translation>Type:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2345"/>
<location filename="../src/ui/settings.ui" line="2652"/>
<source>No Image</source>
<translation>Pas d&apos;image</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2350"/>
<location filename="../src/ui/settings.ui" line="2657"/>
<source>Tiled</source>
<translation>Mosaïque</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2355"/>
<location filename="../src/ui/settings.ui" line="2662"/>
<source>Centered</source>
<translation>Centrée</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2454"/>
<location filename="../src/ui/settings.ui" line="2761"/>
<source>Stretched</source>
<translation>Étirée</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2365"/>
<location filename="../src/ui/settings.ui" line="2672"/>
<source>Scaled</source>
<translation>Mise à l&apos;échelle</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2370"/>
<location filename="../src/ui/settings.ui" line="2677"/>
<source>Zoomed</source>
<translation>Zoomée</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2405"/>
<location filename="../src/ui/settings.ui" line="2712"/>
<source>Opacity:</source>
<translation>Opacité:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2709"/>
<location filename="../src/ui/settings.ui" line="3016"/>
<source>%</source>
<translation>%</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2431"/>
<location filename="../src/ui/settings.ui" line="2738"/>
<source>Position:</source>
<translation>Position:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2439"/>
<location filename="../src/ui/settings.ui" line="2746"/>
<source>Left</source>
<translation>Gauche</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2444"/>
<location filename="../src/ui/settings.ui" line="2751"/>
<source>Center</source>
<translation>Centre</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2449"/>
<location filename="../src/ui/settings.ui" line="2756"/>
<source>Right</source>
<translation>Droite</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2462"/>
<location filename="../src/ui/settings.ui" line="2769"/>
<source>Width:</source>
<translation>Largeur:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2789"/>
<location filename="../src/ui/settings.ui" line="3096"/>
<source> px</source>
<translation>px</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2513"/>
<location filename="../src/ui/settings.ui" line="2820"/>
<source>Corner radius:</source>
<translation>Arrondi:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2520"/>
<location filename="../src/ui/settings.ui" line="2827"/>
<source>Margins:</source>
<translation>Marges:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2549"/>
<location filename="../src/ui/settings.ui" line="2856"/>
<source>Padding:</source>
<translation>Intérieur:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2605"/>
<location filename="../src/ui/settings.ui" line="2912"/>
<source>Font:</source>
<translation>Police:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2628"/>
<location filename="../src/ui/settings.ui" line="2935"/>
<source>Size:</source>
<translation>Taille:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2642"/>
<location filename="../src/ui/settings.ui" line="2949"/>
<source>Misspelled:</source>
<translation>Orthographe:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2669"/>
<location filename="../src/ui/settings.ui" line="2976"/>
<source>Line spacing:</source>
<translation>Espacement
des lignes:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2677"/>
<location filename="../src/ui/settings.ui" line="2984"/>
<source>Single</source>
<translation>Simple</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2682"/>
<location filename="../src/ui/settings.ui" line="2989"/>
<source>1.5 lines</source>
<translation>1.5 lignes</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2687"/>
<location filename="../src/ui/settings.ui" line="2994"/>
<source>Double</source>
<translation>Double</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2692"/>
<location filename="../src/ui/settings.ui" line="2999"/>
<source>Proportional</source>
<translation>Proportionnel</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2725"/>
<location filename="../src/ui/settings.ui" line="3032"/>
<source>Tab width:</source>
<translation>Tabulation:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2754"/>
<location filename="../src/ui/settings.ui" line="3061"/>
<source>Spacing:</source>
<translation>Espacement:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="2811"/>
<location filename="../src/ui/settings.ui" line="3118"/>
<source>Indent 1st line</source>
<translation>Retrait 1ère ligne</translation>
</message>
@ -998,55 +998,110 @@ des lignes:</translation>
<translation>Réglages</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="102"/>
<location filename="../src/ui/settings.ui" line="107"/>
<source>You might need to restart manuskript in order to avoid some visual issues.</source>
<translation>Il sera nécessaire de rédemarrer manuskript pour éviter des problèmes d&apos;affichages après avoir changé de style.</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="131"/>
<location filename="../src/ui/settings.ui" line="136"/>
<source>Loading</source>
<translation>Chargement</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="143"/>
<location filename="../src/ui/settings.ui" line="148"/>
<source>Automatically load last project on startup</source>
<translation>Charger au démarrage le dernier projet ouvert</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="359"/>
<location filename="../src/ui/settings.ui" line="364"/>
<source>Default text format</source>
<translation>Format de texte par défaut</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="371"/>
<location filename="../src/ui/settings.ui" line="376"/>
<source>The format set by default when you create a new text item. You can change this on a per item basis.</source>
<translation>Le format définit par défaut lorsque vous créez un nouveau élément texte. Vous pouvez changer ce format pour chaque élément.</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1490"/>
<location filename="../src/ui/settings.ui" line="1797"/>
<source>Text editor</source>
<translation>Éditeur de texte</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1502"/>
<location filename="../src/ui/settings.ui" line="1809"/>
<source>Font</source>
<translation>Police</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1546"/>
<location filename="../src/ui/settings.ui" line="1853"/>
<source>Family:</source>
<translation>Famille:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1680"/>
<location filename="../src/ui/settings.ui" line="1987"/>
<source>Paragraphs</source>
<translation>Paragraphes</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="1645"/>
<location filename="../src/ui/settings.ui" line="1952"/>
<source>Background:</source>
<translation>Arrière-plan:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="434"/>
<source>Revisions</source>
<translation>Révisions</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="444"/>
<source>Revisions are a way to keep track of modifications. For each text item, it stores any changes you make to the main text, allowing you to see and restoring previous versions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="454"/>
<source>Keep revisions</source>
<translation>Garder les révisions</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="470"/>
<source>Smart remove</source>
<translation>Suppression intelligente</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="485"/>
<source>Keep:</source>
<translation>Garder:</translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="498"/>
<source>Smart remove allows you to keep only a certain number of revisions. It is strongly recommended to use it, lest you file will becomes full of thousands of insignificant changes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="514"/>
<source>revisions per day for the last month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="552"/>
<source>revisions per minute for the last 10 minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="565"/>
<source>revisions per hour for the last day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="578"/>
<source>revisions per 10 minutes for the last hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ui/settings.ui" line="691"/>
<source>revisions per week till the end of time</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SpellAction</name>
@ -1761,60 +1816,85 @@ des lignes:</translation>
<translation>Form</translation>
</message>
<message>
<location filename="../src/ui/revisions_ui.ui" line="93"/>
<location filename="../src/ui/revisions_ui.ui" line="100"/>
<source>Restore</source>
<translation>Restaurer</translation>
</message>
<message>
<location filename="../src/ui/revisions_ui.ui" line="103"/>
<location filename="../src/ui/revisions_ui.ui" line="110"/>
<source>Delete</source>
<translation>Supprimer</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="62"/>
<location filename="../src/ui/revisions.py" line="93"/>
<source>1 day ago</source>
<translation>Il y a un jour</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="64"/>
<location filename="../src/ui/revisions.py" line="95"/>
<source>{} days ago</source>
<translation>Il y a {} jours</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="66"/>
<location filename="../src/ui/revisions.py" line="97"/>
<source>{} hours ago</source>
<translation>Il y a {} heures</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="68"/>
<location filename="../src/ui/revisions.py" line="99"/>
<source>{} minutes ago</source>
<translation>Il y a {} minutes</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="70"/>
<location filename="../src/ui/revisions.py" line="101"/>
<source>{} seconds ago</source>
<translation>Il y a {} secondes</translation>
</message>
<message>
<location filename="../src/ui/revisions_ui.ui" line="77"/>
<source>Options</source>
<translation>Options</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="29"/>
<source>Show modifications</source>
<translation>Montrer les modifications</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="36"/>
<source>Show ancient version</source>
<translation>Montrer la version ancienne</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="44"/>
<source>Show spaces</source>
<translation>Montrer les espaces</translation>
</message>
<message>
<location filename="../src/ui/revisions.py" line="50"/>
<source>Show modifications only</source>
<translation>Montrer les modifications seulement</translation>
</message>
</context>
<context>
<name>settingsWindow</name>
<message>
<location filename="../src/settingsWindow.py" line="376"/>
<location filename="../src/settingsWindow.py" line="408"/>
<source>New status</source>
<translation>Nouveau status</translation>
</message>
<message>
<location filename="../src/settingsWindow.py" line="396"/>
<location filename="../src/settingsWindow.py" line="428"/>
<source>New label</source>
<translation>Nouveau label</translation>
</message>
<message>
<location filename="../src/settingsWindow.py" line="432"/>
<location filename="../src/settingsWindow.py" line="464"/>
<source>newtheme</source>
<translation>nouveautheme</translation>
</message>
<message>
<location filename="../src/settingsWindow.py" line="442"/>
<location filename="../src/settingsWindow.py" line="474"/>
<source>New theme</source>
<translation>Nouveau Thème</translation>
</message>

View file

@ -984,10 +984,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
###############################################################################
def settingsLabel(self):
self.settingsWindow("Labels")
self.settingsWindow(3)
def settingsStatus(self):
self.settingsWindow("Status")
self.settingsWindow(4)
def settingsWindow(self, tab=None):
self.sw = settingsWindow(self)

View file

@ -6,10 +6,10 @@ from enums import *
from enum import Enum
from lxml import etree as ET
from functions import *
import settings
import locale
locale.setlocale(locale.LC_ALL, '')
import time
import collections
class outlineModel(QAbstractItemModel):
@ -869,6 +869,9 @@ class outlineItem():
def addRevision(self):
# FIXME: only add if significantly different, or enough time span
if not settings.revisions["keep"]:
return
if not Outline.text in self._data:
return
@ -876,7 +879,8 @@ class outlineItem():
time.time(),
self._data[Outline.text])
self.cleanRevisions()
if settings.revisions["smartremove"]:
self.cleanRevisions()
def cleanRevisions(self):
"Keep only one some the revisions."
@ -884,12 +888,7 @@ class outlineItem():
rev2 = []
now = time.time()
rule = collections.OrderedDict()
rule[5 * 60] = 60 # One per minute for the last 5mn
rule[60 * 60] = 60 * 10 # One per 10mn for the last hour
rule[60 * 60 * 24] = 60 * 60 # One per hour for the last day
rule[60 * 60 * 24 * 30] = 60 * 60 * 24 # One per day for the last month
rule[None] = 60 * 60 * 24 * 7 # One per week for eternity
rule = settings.revisions["rules"]
revs = {}
for i in rule:

View file

@ -275,9 +275,13 @@ def basicT2TFormat(text, formatting=True, EOL=True, titles=True):
for i in range(1, 6):
r1 = '^\s*{s}([^=].*[^=]){s}\s*$'.format(s="=" * i)
r2 = '^\s*{s}([^\+].*[^\+]){s}\s*$'.format(s="\\+" * i)
r3 = '\n\s*{s}([^=].*[^=]){s}\s*\n'.format(s="=" * i)
r4 = '\n\s*{s}([^\+].*[^\+]){s}\s*\n'.format(s="\\+" * i)
t = "<h{n}>\\1</h{n}>".format(n=i)
text = re.sub(r1, t, text)
text = re.sub(r2, t, text)
text = re.sub(r3, t, text)
text = re.sub(r4, t, text)
if EOL:
text = text.replace("\n", "<br>")

View file

@ -4,6 +4,7 @@ import pickle
import pprint
from enums import *
from qt import *
import collections
viewSettings = {
"Tree": {
@ -60,11 +61,23 @@ textEditor = {
"spacingBelow": 5,
}
revisions = {
"keep": True,
"smartremove": True,
"rules": collections.OrderedDict({
10 * 60: 60, # One per minute for the last 10mn
60 * 60: 60 * 10, # One per 10mn for the last hour
60 * 60 * 24: 60 * 60, # One per hour for the last day
60 * 60 * 24 * 30: 60 * 60 * 24, # One per day for the last month
None: 60 * 60 * 24 * 7, # One per week for eternity
})
}
def save(filename=None):
global spellcheck, dict, corkSliderFactor, viewSettings, corkSizeFactor, folderView, lastTab, openIndexes, \
autoSave, autoSaveDelay, saveOnQuit, autoSaveNoChanges, autoSaveNoChangesDelay, outlineViewColumns, \
corkBackground, fullScreenTheme, defaultTextType, textEditor
corkBackground, fullScreenTheme, defaultTextType, textEditor, revisions
allSettings = {
"viewSettings": viewSettings,
@ -84,6 +97,7 @@ def save(filename=None):
"fullScreenTheme":fullScreenTheme,
"defaultTextType":defaultTextType,
"textEditor":textEditor,
"revisions":revisions,
}
#pp=pprint.PrettyPrinter(indent=4, compact=False)
@ -182,4 +196,8 @@ def load(string, fromString=False):
if "textEditor" in allSettings:
global textEditor
textEditor = allSettings["textEditor"]
textEditor = allSettings["textEditor"]
if "revisions" in allSettings:
global revisions
revisions = allSettings["revisions"]

View file

@ -65,6 +65,23 @@ class settingsWindow(QWidget, Ui_Settings):
self.cmbDefaultTextType.setCurrentIndex(i)
self.cmbDefaultTextType.currentIndexChanged.connect(self.saveSettingsChanged)
# Revisions
opt = settings.revisions
self.chkRevisionsKeep.setChecked(opt["keep"])
self.chkRevisionsKeep.stateChanged.connect(self.revisionsSettingsChanged)
self.chkRevisionRemove.setChecked(opt["smartremove"])
self.chkRevisionRemove.toggled.connect(self.revisionsSettingsChanged)
self.spnRevisions10Mn.setValue(60 / opt["rules"][10 * 60])
self.spnRevisions10Mn.valueChanged.connect(self.revisionsSettingsChanged)
self.spnRevisionsHour.setValue(60 * 10 / opt["rules"][60 * 60])
self.spnRevisionsHour.valueChanged.connect(self.revisionsSettingsChanged)
self.spnRevisionsDay.setValue(60 * 60 / opt["rules"][60 * 60 * 24])
self.spnRevisionsDay.valueChanged.connect(self.revisionsSettingsChanged)
self.spnRevisionsMonth.setValue(60 * 60 * 24 / opt["rules"][60 * 60 * 24 * 30])
self.spnRevisionsMonth.valueChanged.connect(self.revisionsSettingsChanged)
self.spnRevisionsEternity.setValue(60 * 60 * 24 * 7 / opt["rules"][None])
self.spnRevisionsEternity.valueChanged.connect(self.revisionsSettingsChanged)
# Views
self.tabViews.setCurrentIndex(0)
lst = ["Nothing", "POV", "Label", "Progress", "Compile"]
@ -203,6 +220,21 @@ class settingsWindow(QWidget, Ui_Settings):
self.mw.saveTimerNoChanges.setInterval(settings.autoSaveNoChangesDelay * 1000)
settings.defaultTextType = self.cmbDefaultTextType.currentData()
####################################################################################################
# REVISION #
####################################################################################################
def revisionsSettingsChanged(self):
opt = settings.revisions
opt["keep"] = True if self.chkRevisionsKeep.checkState() else False
opt["smartremove"] = self.chkRevisionRemove.isChecked()
opt["rules"][10 * 60] = 60 / self.spnRevisions10Mn.value()
opt["rules"][60 * 60] = 60 * 10 / self.spnRevisionsHour.value()
opt["rules"][60 * 60 * 24] = 60 * 60 / self.spnRevisionsDay.value()
opt["rules"][60 * 60 * 24 * 30] = 60 * 60 * 24 / self.spnRevisionsMonth.value()
opt["rules"][None] = 60 * 60 * 24 * 7 / self.spnRevisionsEternity.value()
####################################################################################################
# VIEWS #
####################################################################################################

View file

@ -23,6 +23,37 @@ class revisions(QWidget, Ui_revisions):
self.list.itemActivated.connect(self.showDiff)
#self.list.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.menu = QMenu(self)
self.actGroup = QActionGroup(self)
self.actShowDiff = QAction(self.tr("Show modifications"), self.menu)
self.actShowDiff.setCheckable(True)
self.actShowDiff.setChecked(True)
self.actShowDiff.triggered.connect(self.showDiff)
self.menu.addAction(self.actShowDiff)
self.actGroup.addAction(self.actShowDiff)
self.actShowVersion = QAction(self.tr("Show ancient version"), self.menu)
self.actShowVersion.setCheckable(True)
self.actShowVersion.setChecked(False)
self.actShowVersion.triggered.connect(self.showDiff)
self.menu.addAction(self.actShowVersion)
self.actGroup.addAction(self.actShowVersion)
self.menu.addSeparator()
self.actShowSpaces = QAction(self.tr("Show spaces"), self.menu)
self.actShowSpaces.setCheckable(True)
self.actShowSpaces.setChecked(False)
self.actShowSpaces.triggered.connect(self.showDiff)
self.menu.addAction(self.actShowSpaces)
self.actDiffOnly = QAction(self.tr("Show modifications only"), self.menu)
self.actDiffOnly.setCheckable(True)
self.actDiffOnly.setChecked(True)
self.actDiffOnly.triggered.connect(self.showDiff)
self.menu.addAction(self.actDiffOnly)
self.btnOptions.setMenu(self.menu)
self._model = None
self._index = None
@ -72,18 +103,33 @@ class revisions(QWidget, Ui_revisions):
def showDiff(self):
#FIXME: doesn't work for HTML formatting.
i = self.list.currentItem()
if not i:
return
ts = i.data(Qt.UserRole)
item = self._index.internalPointer()
textNow = item.text()
textBefore = [r[1] for r in item.revisions() if r[0] == ts][0]
if self.actShowVersion.isChecked():
if item.type() == "t2t":
textBefore = Ref.basicT2TFormat(textBefore)
self.view.setText(textBefore)
return
textNow = textNow.splitlines()
textBefore = textBefore.splitlines()
d = difflib.Differ()
diff = list(d.compare(textBefore, textNow))
if self.actShowSpaces.isChecked():
_format = lambda x: x.replace(" ", "␣ ")
else:
_format = lambda x:x
extra = "" if item.type() == "html" else "<br>"
diff = [d for d in diff if d and not d[:2] == "? "]
mydiff = ""
@ -99,27 +145,33 @@ class revisions(QWidget, Ui_revisions):
skip = False
continue
if op == " ":
if op == " " and not self.actDiffOnly.isChecked():
if item.type() == "t2t":
txt = Ref.basicT2TFormat(txt)
mydiff += "{}{}".format(txt, extra)
elif op == "- " and op2 == "+ ":
if self.actDiffOnly.isChecked():
mydiff += "<br>{}:<br>".format(str(n))
s = difflib.SequenceMatcher(None, txt, txt2, autojunk=False)
for tag, i1, i2, j1, j2 in s.get_opcodes():
if tag == "equal":
mydiff += txt[i1:i2]
elif tag == "delete":
mydiff += "<span style='color:red;'>{}</span>".format(txt[i1:i2].replace(" ", ""))
mydiff += "<span style='color:red;'>{}</span>".format(_format(txt[i1:i2]))
elif tag == "insert":
mydiff += "<span style='color:green;'>{}</span>".format(txt2[j1:j2].replace(" ", ""))
mydiff += "<span style='color:green;'>{}</span>".format(_format(txt2[j1:j2]))
elif tag == "replace":
mydiff += "<span style='color:red;'>{}</span>".format(txt[i1:i2].replace(" ", ""))
mydiff += "<span style='color:green;'>{}</span>".format(txt2[j1:j2].replace(" ", ""))
mydiff += "<span style='color:red;'>{}</span>".format(_format(txt[i1:i2]))
mydiff += "<span style='color:green;'>{}</span>".format(_format(txt2[j1:j2]))
mydiff += extra
skip = True
elif op == "- ":
if self.actDiffOnly.isChecked():
mydiff += "<br>{}:<br>".format(str(n))
mydiff += "<span style='color:red;'>{}</span>{}".format(txt, extra)
elif op == "+ ":
if self.actDiffOnly.isChecked():
mydiff += "<br>{}:<br>".format(str(n))
mydiff += "<span style='color:green;'>{}</span>{}".format(txt, extra)
self.view.setText(mydiff)

View file

@ -51,6 +51,9 @@ class Ui_revisions(object):
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.layoutWidget)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.btnOptions = QtWidgets.QPushButton(self.layoutWidget)
self.btnOptions.setObjectName("btnOptions")
self.horizontalLayout_2.addWidget(self.btnOptions)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem)
self.btnRestore = QtWidgets.QPushButton(self.layoutWidget)
@ -69,6 +72,7 @@ class Ui_revisions(object):
def retranslateUi(self, revisions):
_translate = QtCore.QCoreApplication.translate
revisions.setWindowTitle(_translate("revisions", "Form"))
self.btnOptions.setText(_translate("revisions", "Options"))
self.btnRestore.setText(_translate("revisions", "Restore"))
self.btnDelete.setText(_translate("revisions", "Delete"))

View file

@ -71,6 +71,13 @@
</widget>
<widget class="QWidget" name="layoutWidget">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="btnOptions">
<property name="text">
<string>Options</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">

View file

@ -26,6 +26,8 @@ class Ui_Settings(object):
self.lstMenu.addItem(item)
item = QtWidgets.QListWidgetItem()
self.lstMenu.addItem(item)
item = QtWidgets.QListWidgetItem()
self.lstMenu.addItem(item)
self.horizontalLayout_8.addWidget(self.lstMenu)
self.stack = QtWidgets.QStackedWidget(Settings)
self.stack.setObjectName("stack")
@ -207,6 +209,173 @@ class Ui_Settings(object):
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_7.addItem(spacerItem2)
self.stack.addWidget(self.stackedWidgetPage1)
self.page_3 = QtWidgets.QWidget()
self.page_3.setObjectName("page_3")
self.verticalLayout = QtWidgets.QVBoxLayout(self.page_3)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.lblTitleGeneral_2 = QtWidgets.QLabel(self.page_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lblTitleGeneral_2.sizePolicy().hasHeightForWidth())
self.lblTitleGeneral_2.setSizePolicy(sizePolicy)
self.lblTitleGeneral_2.setStyleSheet("background-color:lightBlue;\n"
"border:none;\n"
"padding:10px;\n"
"color:darkBlue;\n"
"font-size:16px;\n"
"font-weight:bold;\n"
"text-align:center;")
self.lblTitleGeneral_2.setAlignment(QtCore.Qt.AlignCenter)
self.lblTitleGeneral_2.setObjectName("lblTitleGeneral_2")
self.verticalLayout.addWidget(self.lblTitleGeneral_2)
self.label_44 = QtWidgets.QLabel(self.page_3)
self.label_44.setWordWrap(True)
self.label_44.setObjectName("label_44")
self.verticalLayout.addWidget(self.label_44)
self.chkRevisionsKeep = QtWidgets.QCheckBox(self.page_3)
self.chkRevisionsKeep.setChecked(True)
self.chkRevisionsKeep.setObjectName("chkRevisionsKeep")
self.verticalLayout.addWidget(self.chkRevisionsKeep)
self.chkRevisionRemove = QtWidgets.QGroupBox(self.page_3)
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.chkRevisionRemove.setFont(font)
self.chkRevisionRemove.setCheckable(True)
self.chkRevisionRemove.setObjectName("chkRevisionRemove")
self.gridLayout_2 = QtWidgets.QGridLayout(self.chkRevisionRemove)
self.gridLayout_2.setObjectName("gridLayout_2")
self.label_46 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_46.setFont(font)
self.label_46.setObjectName("label_46")
self.gridLayout_2.addWidget(self.label_46, 1, 0, 1, 2)
self.label_45 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_45.setFont(font)
self.label_45.setWordWrap(True)
self.label_45.setObjectName("label_45")
self.gridLayout_2.addWidget(self.label_45, 0, 0, 1, 2)
self.label_50 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_50.setFont(font)
self.label_50.setObjectName("label_50")
self.gridLayout_2.addWidget(self.label_50, 5, 1, 1, 1)
self.spnRevisions10Mn = QtWidgets.QSpinBox(self.chkRevisionRemove)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spnRevisions10Mn.sizePolicy().hasHeightForWidth())
self.spnRevisions10Mn.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.spnRevisions10Mn.setFont(font)
self.spnRevisions10Mn.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.spnRevisions10Mn.setMaximum(999)
self.spnRevisions10Mn.setProperty("value", 1)
self.spnRevisions10Mn.setObjectName("spnRevisions10Mn")
self.gridLayout_2.addWidget(self.spnRevisions10Mn, 2, 0, 1, 1)
self.label_47 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_47.setFont(font)
self.label_47.setObjectName("label_47")
self.gridLayout_2.addWidget(self.label_47, 2, 1, 1, 1)
self.label_49 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_49.setFont(font)
self.label_49.setObjectName("label_49")
self.gridLayout_2.addWidget(self.label_49, 4, 1, 1, 1)
self.label_48 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_48.setFont(font)
self.label_48.setObjectName("label_48")
self.gridLayout_2.addWidget(self.label_48, 3, 1, 1, 1)
self.spnRevisionsDay = QtWidgets.QSpinBox(self.chkRevisionRemove)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spnRevisionsDay.sizePolicy().hasHeightForWidth())
self.spnRevisionsDay.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.spnRevisionsDay.setFont(font)
self.spnRevisionsDay.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.spnRevisionsDay.setMaximum(999)
self.spnRevisionsDay.setProperty("value", 1)
self.spnRevisionsDay.setObjectName("spnRevisionsDay")
self.gridLayout_2.addWidget(self.spnRevisionsDay, 4, 0, 1, 1)
self.spnRevisionsHour = QtWidgets.QSpinBox(self.chkRevisionRemove)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spnRevisionsHour.sizePolicy().hasHeightForWidth())
self.spnRevisionsHour.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.spnRevisionsHour.setFont(font)
self.spnRevisionsHour.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.spnRevisionsHour.setMaximum(999)
self.spnRevisionsHour.setProperty("value", 1)
self.spnRevisionsHour.setObjectName("spnRevisionsHour")
self.gridLayout_2.addWidget(self.spnRevisionsHour, 3, 0, 1, 1)
self.spnRevisionsMonth = QtWidgets.QSpinBox(self.chkRevisionRemove)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spnRevisionsMonth.sizePolicy().hasHeightForWidth())
self.spnRevisionsMonth.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.spnRevisionsMonth.setFont(font)
self.spnRevisionsMonth.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.spnRevisionsMonth.setMaximum(999)
self.spnRevisionsMonth.setProperty("value", 1)
self.spnRevisionsMonth.setObjectName("spnRevisionsMonth")
self.gridLayout_2.addWidget(self.spnRevisionsMonth, 5, 0, 1, 1)
self.spnRevisionsEternity = QtWidgets.QSpinBox(self.chkRevisionRemove)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.spnRevisionsEternity.sizePolicy().hasHeightForWidth())
self.spnRevisionsEternity.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.spnRevisionsEternity.setFont(font)
self.spnRevisionsEternity.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.spnRevisionsEternity.setMaximum(999)
self.spnRevisionsEternity.setProperty("value", 1)
self.spnRevisionsEternity.setObjectName("spnRevisionsEternity")
self.gridLayout_2.addWidget(self.spnRevisionsEternity, 6, 0, 1, 1)
self.label_51 = QtWidgets.QLabel(self.chkRevisionRemove)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.label_51.setFont(font)
self.label_51.setObjectName("label_51")
self.gridLayout_2.addWidget(self.label_51, 6, 1, 1, 1)
self.verticalLayout.addWidget(self.chkRevisionRemove)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem3)
self.stack.addWidget(self.page_3)
self.stackedWidgetPage2 = QtWidgets.QWidget()
self.stackedWidgetPage2.setObjectName("stackedWidgetPage2")
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.stackedWidgetPage2)
@ -385,12 +554,12 @@ class Ui_Settings(object):
self.rdoTreeTextNothing.setFont(font)
self.rdoTreeTextNothing.setObjectName("rdoTreeTextNothing")
self.verticalLayout_16.addWidget(self.rdoTreeTextNothing)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_16.addItem(spacerItem3)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_16.addItem(spacerItem4)
self.horizontalLayout_9.addWidget(self.groupBox_9)
self.verticalLayout_17.addLayout(self.horizontalLayout_9)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_17.addItem(spacerItem4)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_17.addItem(spacerItem5)
self.tabViews.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
@ -551,8 +720,8 @@ class Ui_Settings(object):
self.chkOutlineTitle.setObjectName("chkOutlineTitle")
self.gridLayout.addWidget(self.chkOutlineTitle, 3, 0, 1, 1)
self.verticalLayout_11.addWidget(self.groupBox_6)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_11.addItem(spacerItem5)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_11.addItem(spacerItem6)
self.tabViews.addTab(self.tab_2, "")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setObjectName("tab_3")
@ -702,8 +871,8 @@ class Ui_Settings(object):
self.cmbCorkImage.setFont(font)
self.cmbCorkImage.setObjectName("cmbCorkImage")
self.verticalLayout_8.addWidget(self.cmbCorkImage)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_8.addItem(spacerItem6)
spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_8.addItem(spacerItem7)
self.horizontalLayout_4.addWidget(self.groupBox_7)
self.tabViews.addTab(self.tab_3, "")
self.tab_4 = QtWidgets.QWidget()
@ -974,8 +1143,8 @@ class Ui_Settings(object):
self.btnLabelColor.setIconSize(QtCore.QSize(64, 64))
self.btnLabelColor.setObjectName("btnLabelColor")
self.verticalLayout_2.addWidget(self.btnLabelColor)
spacerItem7 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem7)
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem8)
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
self.horizontalLayout = QtWidgets.QHBoxLayout()
@ -992,8 +1161,8 @@ class Ui_Settings(object):
self.btnLabelRemove.setIcon(icon)
self.btnLabelRemove.setObjectName("btnLabelRemove")
self.horizontalLayout.addWidget(self.btnLabelRemove)
spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem8)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem9)
self.verticalLayout_3.addLayout(self.horizontalLayout)
self.stack.addWidget(self.stackedWidgetPage3)
self.stackedWidgetPage4 = QtWidgets.QWidget()
@ -1034,8 +1203,8 @@ class Ui_Settings(object):
self.btnStatusRemove.setIcon(icon)
self.btnStatusRemove.setObjectName("btnStatusRemove")
self.horizontalLayout_3.addWidget(self.btnStatusRemove)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem9)
spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem10)
self.verticalLayout_4.addLayout(self.horizontalLayout_3)
self.stack.addWidget(self.stackedWidgetPage4)
self.page = QtWidgets.QWidget()
@ -1090,8 +1259,8 @@ class Ui_Settings(object):
self.btnThemeRemove.setIcon(icon)
self.btnThemeRemove.setObjectName("btnThemeRemove")
self.horizontalLayout_6.addWidget(self.btnThemeRemove)
spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem10)
spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_6.addItem(spacerItem11)
self.verticalLayout_12.addLayout(self.horizontalLayout_6)
self.themeStack.addWidget(self.stackedWidgetPage1_3)
self.stackedWidgetPage2_3 = QtWidgets.QWidget()
@ -1422,6 +1591,7 @@ class Ui_Settings(object):
self.themeStack.setCurrentIndex(1)
self.themeEditStack.setCurrentIndex(0)
self.lstMenu.currentRowChanged['int'].connect(self.stack.setCurrentIndex)
self.chkRevisionsKeep.toggled['bool'].connect(self.chkRevisionRemove.setEnabled)
QtCore.QMetaObject.connectSlotsByName(Settings)
def retranslateUi(self, Settings):
@ -1432,12 +1602,14 @@ class Ui_Settings(object):
item = self.lstMenu.item(0)
item.setText(_translate("Settings", "General"))
item = self.lstMenu.item(1)
item.setText(_translate("Settings", "Views"))
item.setText(_translate("Settings", "Revisions"))
item = self.lstMenu.item(2)
item.setText(_translate("Settings", "Labels"))
item.setText(_translate("Settings", "Views"))
item = self.lstMenu.item(3)
item.setText(_translate("Settings", "Status"))
item.setText(_translate("Settings", "Labels"))
item = self.lstMenu.item(4)
item.setText(_translate("Settings", "Status"))
item = self.lstMenu.item(5)
item.setText(_translate("Settings", "Fullscreen"))
self.lstMenu.setSortingEnabled(__sortingEnabled)
self.lblTitleGeneral.setText(_translate("Settings", "General settings"))
@ -1453,6 +1625,17 @@ class Ui_Settings(object):
self.chkSaveOnQuit.setText(_translate("Settings", "Save on quit"))
self.groupBox_11.setTitle(_translate("Settings", "Default text format"))
self.label_35.setText(_translate("Settings", "The format set by default when you create a new text item. You can change this on a per item basis."))
self.lblTitleGeneral_2.setText(_translate("Settings", "Revisions"))
self.label_44.setText(_translate("Settings", "Revisions are a way to keep track of modifications. For each text item, it stores any changes you make to the main text, allowing you to see and restoring previous versions."))
self.chkRevisionsKeep.setText(_translate("Settings", "Keep revisions"))
self.chkRevisionRemove.setTitle(_translate("Settings", "Smart remove"))
self.label_46.setText(_translate("Settings", "Keep:"))
self.label_45.setText(_translate("Settings", "Smart remove allows you to keep only a certain number of revisions. It is strongly recommended to use it, lest you file will becomes full of thousands of insignificant changes."))
self.label_50.setText(_translate("Settings", "revisions per day for the last month"))
self.label_47.setText(_translate("Settings", "revisions per minute for the last 10 minutes"))
self.label_49.setText(_translate("Settings", "revisions per hour for the last day"))
self.label_48.setText(_translate("Settings", "revisions per 10 minutes for the last hour"))
self.label_51.setText(_translate("Settings", "revisions per week till the end of time"))
self.lblTitleViews.setText(_translate("Settings", "Views settings"))
self.groupBox_3.setTitle(_translate("Settings", "Colors"))
self.label_3.setText(_translate("Settings", "Icon color:"))

View file

@ -21,6 +21,11 @@
<string>General</string>
</property>
</item>
<item>
<property name="text">
<string>Revisions</string>
</property>
</item>
<item>
<property name="text">
<string>Views</string>
@ -403,6 +408,308 @@ text-align:center;</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lblTitleGeneral_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color:lightBlue;
border:none;
padding:10px;
color:darkBlue;
font-size:16px;
font-weight:bold;
text-align:center;</string>
</property>
<property name="text">
<string>Revisions</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_44">
<property name="text">
<string>Revisions are a way to keep track of modifications. For each text item, it stores any changes you make to the main text, allowing you to see and restoring previous versions.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkRevisionsKeep">
<property name="text">
<string>Keep revisions</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="chkRevisionRemove">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Smart remove</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_46">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Keep:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_45">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Smart remove allows you to keep only a certain number of revisions. It is strongly recommended to use it, lest you file will becomes full of thousands of insignificant changes.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_50">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>revisions per day for the last month</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QSpinBox" name="spnRevisions10Mn">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_47">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>revisions per minute for the last 10 minutes</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_49">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>revisions per hour for the last day</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_48">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>revisions per 10 minutes for the last hour</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QSpinBox" name="spnRevisionsDay">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QSpinBox" name="spnRevisionsHour">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QSpinBox" name="spnRevisionsMonth">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QSpinBox" name="spnRevisionsEternity">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_51">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>revisions per week till the end of time</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="stackedWidgetPage2">
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="margin">
@ -2865,5 +3172,21 @@ text-align:center;</string>
</hint>
</hints>
</connection>
<connection>
<sender>chkRevisionsKeep</sender>
<signal>toggled(bool)</signal>
<receiver>chkRevisionRemove</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>165</x>
<y>112</y>
</hint>
<hint type="destinationlabel">
<x>235</x>
<y>141</y>
</hint>
</hints>
</connection>
</connections>
</ui>