From b698ccbc1d982566b8852b644beb9988969b0c0b Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Fri, 23 Apr 2021 21:49:20 +0200 Subject: [PATCH] Move qutae symbol dialog source file to the dialogs folder --- i18n/nw_en_US.ts | 270 +++++++++--------- i18n/nw_fr.ts | 270 +++++++++--------- i18n/nw_nb_NO.ts | 270 +++++++++--------- i18n/nw_pt.ts | 270 +++++++++--------- nw/dialogs/__init__.py | 2 + nw/dialogs/preferences.py | 5 +- nw/dialogs/quotes.py | 133 +++++++++ nw/gui/custom.py | 109 +------ .../test_dlg_dialogs.py} | 8 +- tests/test_dialogs/test_dlg_preferences.py | 7 +- 10 files changed, 690 insertions(+), 654 deletions(-) create mode 100644 nw/dialogs/quotes.py rename tests/{test_gui/test_gui_dialogs.py => test_dialogs/test_dlg_dialogs.py} (90%) diff --git a/i18n/nw_en_US.ts b/i18n/nw_en_US.ts index f3318731..404338ef 100644 --- a/i18n/nw_en_US.ts +++ b/i18n/nw_en_US.ts @@ -2762,47 +2762,47 @@ GuiPreferences - + Preferences - + General - + Projects - + Documents - + Editor - + Highlighting - + Automation - + Some changes will not be applied until novelWriter has been restarted. - + Quotes @@ -2810,107 +2810,107 @@ GuiPreferencesAutomation - + Automatic Features - + Auto-select word under cursor - + Apply formatting to word under cursor if no selection is made. - + Auto-replace text as you type - + Allow the editor to replace symbols as you type. - + Replace as You Type - + Auto-replace single quotes - + Try to guess which is an opening or a closing single quote. - + Auto-replace double quotes - + Try to guess which is an opening or a closing double quote. - + Auto-replace dashes - + Double and triple hyphens become short and long dashes. - + Auto-replace dots - + Three consecutive dots become ellipsis. - + Automatic Padding - + Insert non-breaking space before - + Insert non-breaking space after - + Use thin space instead - + Automatically add space before any of these symbols. - + Automatically add space after any of these symbols. - + Inserts a thin space instead of a regular space. @@ -2918,107 +2918,107 @@ GuiPreferencesDocuments - + Text Style - + Font family - + Font for the document editor and viewer. - + Font size - + Font size for the document editor and viewer. - + pt - + Text Flow - + Maximum text width in "Normal Mode" - + Horizontal margins are scaled automatically. - + px - + Maximum text width in "Focus Mode" - + Disable maximum text width in "Normal Mode" - + Text width is defined by the margins only. - + Hide document footer in "Focus Mode" - + Hide the information bar at the bottom of the document. - + Justify the text margins in editor and viewer - + Lay out text with straight edges in the editor and viewer. - + Text margin - + If maximum width is set, this becomes the minimum margin. - + Tab width - + The width of a tab key press in the editor and viewer. @@ -3026,127 +3026,127 @@ GuiPreferencesEditor - + Spell Checking - + Internal - + Spell check provider - + Note that the internal spell check tool is quite slow. - + Spell check language - + Available languages are determined by your system. - + Big document limit - + Full spell checking is disabled above this limit. - + kB - + Word Count - + Word count interval - + How often the word count is updated. - + seconds - + Writing Guides - + Show tabs and spaces - + Add symbols to indicate tabs and spaces in the editor. - + Show line endings - + Add a symbol to indicate line endings in the editor. - + Scroll Behaviour Scroll Behavior - + Scroll past end of the document - + Also improves trypewriter scrolling for short documents. - + Typewriter style scrolling when you type - + Try to keep the cursor at a fixed vertical position. - + Minimum position for Typewriter scrolling - + Percentage of the editor height from the top. @@ -3154,82 +3154,82 @@ GuiPreferencesGeneral - + Look and Feel - + Main GUI language - + Changing this requires restarting novelWriter. - + Main GUI theme - + Main icon theme - + Prefer icons for dark backgrounds - + May improve the look of icons on dark themes. - + Font family - + Font size - + pt - + GUI Settings - + Show full path in document header - + Add the parent folder names to the header. - + Hide vertical scroll bars in main windows - + Scrolling available with mouse wheel and keys only. - + Hide horizontal scroll bars in main windows @@ -3237,107 +3237,107 @@ GuiPreferencesProjects - + Automatic Save - + Save document interval - + How often the open document is automatically saved. - + seconds - + Save project interval - + How often the open project is automatically saved. - + Project Backup - + Browse - + Backup storage location - + Path: {0} - + Run backup when the project is closed - + Can be overridden for individual projects in Project Settings. - + Ask before running backup - + If off, backups will run in the background. - + Session Timer - + Pause the session timer when not writing - + Also pauses when the application window does not have focus. - + Editor inactive time before pausing timer - + User activity includes typing and changing the content. - + minutes - + Backup Directory @@ -3345,47 +3345,47 @@ GuiPreferencesQuotes - + Quotation Style - + Single quote open style - + The symbol to use for a leading single quote. - + Single quote close style - + The symbol to use for a trailing single quote. - + Double quote open style - + The symbol to use for a leading double quote. - + Double quote close style - + The symbol to use for a trailing double quote. @@ -3393,67 +3393,67 @@ GuiPreferencesSyntax - + Highlighting Theme - + Highlighting theme - + Colour theme to apply to the editor and viewer. Color theme to apply to the editor and viewer. - + Quotes & Dialogue - + Highlight text wrapped in quotes - + Applies to single, double and straight quotes. - + Allow open-ended single quotes - + Highlight single-quoted line with no closing quote. - + Allow open-ended double quotes - + Highlight double-quoted line with no closing quote. - + Text Emphasis - + Add highlight colour to emphasised text Add highlight color to emphasised text - + Applies to emphasis (italic) and strong (bold). diff --git a/i18n/nw_fr.ts b/i18n/nw_fr.ts index 2dfc6310..8761c05d 100644 --- a/i18n/nw_fr.ts +++ b/i18n/nw_fr.ts @@ -2762,47 +2762,47 @@ GuiPreferences - + Preferences Préférences - + General Général - + Projects Projets - + Documents Documents - + Editor Éditeur - + Highlighting Mise en évidence - + Automation Automation - + Some changes will not be applied until novelWriter has been restarted. Certains changements ne seront effectifs qu'après un redémarrage de novelWriter. - + Quotes Guillemets @@ -2810,107 +2810,107 @@ GuiPreferencesAutomation - + Automatic Features Automatismes - + Auto-select word under cursor Auto-sélection du mot sous le curseur - + Apply formatting to word under cursor if no selection is made. En l'absence de texte sélectionné la mise en forme s'applique au mot sous le curseur. - + Auto-replace text as you type Auto-remplacement par la frappe - + Allow the editor to replace symbols as you type. Permet à l'éditeur de remplacer les symboles au fur et à mesure de la frappe. - + Replace as You Type Remplacement par la frappe - + Auto-replace single quotes Auto-remplacement des guillemets simples - + Try to guess which is an opening or a closing single quote. Tenter de deviner si un guillemet simple est ouvrant ou fermant. - + Auto-replace double quotes Auto-remplacement des guillemets doubles - + Try to guess which is an opening or a closing double quote. Tenter de deviner si un guillemet double est ouvrant ou fermant. - + Auto-replace dashes Auto-remplacemet des tirets - + Double and triple hyphens become short and long dashes. Deux ou trois tirets successifs deviennent des tirets moyens (semi-cadratin) ou longs (cadratins). - + Auto-replace dots Auto-remplacement des points - + Three consecutive dots become ellipsis. Trois points consécutifs deviennent des points de suspension. - + Automatic Padding Insertion automatique - + Insert non-breaking space before Espace insécable avant - + Insert non-breaking space after Espace insécable après - + Use thin space instead Utiliser des espaces fines - + Automatically add space before any of these symbols. Ajouter lors de la frappe une espace avant chacun de ces caractères. - + Automatically add space after any of these symbols. Ajouter lors de la frappe une espace après chacun de ces caractères. - + Inserts a thin space instead of a regular space. Insérer une espace fine au lieu d'une espace-mot. @@ -2918,107 +2918,107 @@ GuiPreferencesDocuments - + Text Style Style du texte - + Font family Police de caractères - + Font for the document editor and viewer. Police pour l'éditeur et l'afficheur de document. - + Font size Taille de police - + Font size for the document editor and viewer. Taille de la police pour l'éditeur et l'afficheur de document. - + pt pt - + Text Flow Déroulement du texte - + Maximum text width in "Normal Mode" Largeur maximale du texte en mode "normal" - + Horizontal margins are scaled automatically. Les marges horizontales sont ajustées automatiquement. - + px px - + Maximum text width in "Focus Mode" Largeur maximale du texte en mode "sans distraction" - + Disable maximum text width in "Normal Mode" Oublier la largeur maximale en mode "normal" - + Text width is defined by the margins only. La largeur du texte est définie uniquement par les marges. - + Hide document footer in "Focus Mode" Masquer le bas de page en mode "sans distraction" - + Hide the information bar at the bottom of the document. Ne pas afficher la barre d'informations sous le document. - + Justify the text margins in editor and viewer Justifier aux marges dans l'éditeur et l'afficheur - + Lay out text with straight edges in the editor and viewer. Aligner le texte avec des bords droits aux marges droite et gauche dans l'éditeur et l'afficheur. - + Text margin Marge de texte - + If maximum width is set, this becomes the minimum margin. Si une largeur maximale est définie, ceci devient la marge minimale. - + Tab width Largeur des tabulations - + The width of a tab key press in the editor and viewer. La largeur résultant d'un appui sur la touche de tabulation dans l'éditeur et l'afficheur. @@ -3026,127 +3026,127 @@ GuiPreferencesEditor - + Spell Checking Vérification orthographique - + Internal Interne - + Spell check provider Vérificateur - + Note that the internal spell check tool is quite slow. Veuillez noter que la vérification interne est plutôt lente. - + Spell check language Langue à vérifier - + Available languages are determined by your system. Les langues disponibles dépendent de votre système. - + Big document limit Taille maximale de document - + Full spell checking is disabled above this limit. La vérification compléte est désactivée au dessus de cette limite. - + kB ko - + Word Count Compteur de mots - + Word count interval Intervalle de comptage - + How often the word count is updated. Indique à quelle fréquence le compteur est mis à jour. - + seconds secondes - + Writing Guides Aides à l'écriture - + Show tabs and spaces Montrer les tabulations et les espaces - + Add symbols to indicate tabs and spaces in the editor. Dans l'éditeur un symbole montre l'emplacement des tabulations et des espaces. - + Show line endings Montrer les fins de lignes - + Add a symbol to indicate line endings in the editor. Dans l'éditeur un symbole montre l'emplacement des fins de lignes. - + Scroll Behaviour Défilement du texte - + Scroll past end of the document Le défilement dépasse la fin du document - + Also improves trypewriter scrolling for short documents. Améliore également le défilement machine à écrire pour les documents courts. - + Typewriter style scrolling when you type Défilement de machine à écrire - + Try to keep the cursor at a fixed vertical position. L'éditeur essaye de conserver le curseur à la même position verticale. - + Minimum position for Typewriter scrolling Position minimale en mode machine à écrire - + Percentage of the editor height from the top. En pourcentage de la hauteur de la fenêtre depuis le haut. @@ -3154,82 +3154,82 @@ GuiPreferencesGeneral - + Look and Feel Apparence - + Main GUI language Langue de l'interface - + Changing this requires restarting novelWriter. Un changement ne sera pris en compte qu'après le redémarrage de novelWriter. - + Main GUI theme Thème de l'interface - + Main icon theme Thème des icônes - + Prefer icons for dark backgrounds Préférer les icônes pour fonds sombres - + May improve the look of icons on dark themes. Améliore l'apparence des icônes dans les thèmes sombres. - + Font family Police de caractères - + Font size Taille de police - + pt pt - + GUI Settings Paramètres de l'interface - + Show full path in document header Montrer le chemin complet dans l'en-tête du document - + Add the parent folder names to the header. Ajouter les noms des dossiers parents dans l'en-tête. - + Hide vertical scroll bars in main windows Masquer les barres de défilement verticales dans les fenêtres principales - + Scrolling available with mouse wheel and keys only. Le défilement ne pourra se faire que par la molette de la souris et les touches du clavier. - + Hide horizontal scroll bars in main windows Masquer les barres de défilement horizontales dans les fenêtres principales @@ -3237,107 +3237,107 @@ GuiPreferencesProjects - + Automatic Save Enregistrement automatique - + Save document interval Intervalle d'enregistrement - + How often the open document is automatically saved. Indique à quelle fréquence le document ouvert est automatiquement enregistré. - + seconds secondes - + Save project interval Intervalle d'enregistrement du projet - + How often the open project is automatically saved. Indique à quelle fréquence le projet ouvert est automatiquement enregistré. - + Project Backup Sauvegarde du projet - + Browse Parcourir - + Backup storage location Emplacement de sauvegarde du projet - + Path: {0} Chemin : {0} - + Run backup when the project is closed Sauvegarder à la fermeture du projet - + Can be overridden for individual projects in Project Settings. Peut être invalidé pour des projets spécifiques dans leurs paramètres. - + Ask before running backup Demander avant de sauvegarder - + If off, backups will run in the background. Si désactivé, les sauvegardes seront effectuées en arrière-plan. - + Session Timer Chronomètre de session - + Pause the session timer when not writing Arrêter le chronomètre quand on n'écrit pas - + Also pauses when the application window does not have focus. Arrêter également lorsque la fenêtre de l'application n'a pas le focus. - + Editor inactive time before pausing timer Durée d'inactivité de l'éditeur avant la mise en pause du chronomètre - + User activity includes typing and changing the content. L'activité de l'utilisateur inclut la frappe et la modification du contenu. - + minutes minutes - + Backup Directory Répertoire de sauvegarde @@ -3345,47 +3345,47 @@ GuiPreferencesQuotes - + Quotation Style Style de guillemets - + Single quote open style Guillemets simples ouvrants - + The symbol to use for a leading single quote. Symbole à utiliser pour un guillemet simple ouvrant. - + Single quote close style Guillemets simples fermants - + The symbol to use for a trailing single quote. Symbole à utiliser pour un guillemet simple fermant. - + Double quote open style Guillemets doubles ouvrants - + The symbol to use for a leading double quote. Symbole à utiliser pour un guillemet double ouvrant. - + Double quote close style Guillemets doubles fermants - + The symbol to use for a trailing double quote. Symbole à utiliser pour un guillemet double fermant. @@ -3393,67 +3393,67 @@ GuiPreferencesSyntax - + Highlighting Theme Thème de mise en évidence - + Highlighting theme Thème de mise en évidence - + Colour theme to apply to the editor and viewer. Thème de couleurs à utiliser dans l'éditeur et l'afficheur. - + Quotes & Dialogue Dialogues et citations - + Highlight text wrapped in quotes Mettre en évidence le texte situé entre des guillemets - + Applies to single, double and straight quotes. S'applique aux guillemets simples, doubles, et droits. - + Allow open-ended single quotes Autoriser les guillemets simples non fermés - + Highlight single-quoted line with no closing quote. Mettre en évidence les lignes avec guillemet simple ouvrant et non fermées. - + Allow open-ended double quotes Autoriser les guillemets doubles non fermés - + Highlight double-quoted line with no closing quote. Mettre en évidence les lignes avec guillemet double ouvrant et non fermées. - + Text Emphasis Texte appuyé - + Add highlight colour to emphasised text Mettre en évidence le texte appuyé - + Applies to emphasis (italic) and strong (bold). S'applique au texte en caractères italiques ou gras. diff --git a/i18n/nw_nb_NO.ts b/i18n/nw_nb_NO.ts index 6fee09e9..d27e4cfa 100644 --- a/i18n/nw_nb_NO.ts +++ b/i18n/nw_nb_NO.ts @@ -2762,47 +2762,47 @@ GuiPreferences - + Preferences Innstillinger - + General Generelt - + Projects Prosjekt - + Documents Dokument - + Editor Editor - + Highlighting Fremheving - + Automation Automasjon - + Some changes will not be applied until novelWriter has been restarted. Noen endringer vil ikke tas i bruk før neste gang novelWriter startes. - + Quotes Sitattegn @@ -2810,107 +2810,107 @@ GuiPreferencesAutomation - + Automatic Features Automatiske funksjoner - + Auto-select word under cursor Auto-velg ord under markør - + Apply formatting to word under cursor if no selection is made. Hvis ingen tekst er valgt, formatter ordet hvor markøren står. - + Auto-replace text as you type Erstatt mens du skriver - + Allow the editor to replace symbols as you type. La editoren erstatte symboler mens du skriver. - + Replace as You Type Erstatt mens du skriver - + Auto-replace single quotes Erstatt enkle sitattegn - + Try to guess which is an opening or a closing single quote. Forsøker å gjette hva som er venstre og høyre tegn. - + Auto-replace double quotes Erstatt doble sitattegn - + Try to guess which is an opening or a closing double quote. Forsøker å gjette hva som er venstre og høyre tegn. - + Auto-replace dashes Erstatt bindestreker - + Double and triple hyphens become short and long dashes. To og tre bindestreker erstattes med kort og lang bindestrek. - + Auto-replace dots Erstatt tre punktum - + Three consecutive dots become ellipsis. Tre punktum på rad erstattes med ellipsis. - + Automatic Padding Automatisk mellomrom - + Insert non-breaking space before Sett inn hardt mellomrom foran - + Insert non-breaking space after Sett inn hardt mellomrom etter - + Use thin space instead Bruk tynt mellomrom istedet - + Automatically add space before any of these symbols. Legg til mellomrom automatisk foran disse tegnene. - + Automatically add space after any of these symbols. Legg til mellomrom automatisk etter disse tegnene. - + Inserts a thin space instead of a regular space. Sett inn et tynt mellomrom istedenfor et vanlig et. @@ -2918,107 +2918,107 @@ GuiPreferencesDocuments - + Text Style Tekststil - + Font family Skriftfamilie - + Font for the document editor and viewer. Skrifttype til bruk for editor og visning. - + Font size Skriftstørrelse - + Font size for the document editor and viewer. Skriftstørrelse til bruk for editor og visning. - + pt - + Text Flow Tekstflyt - + Maximum text width in "Normal Mode" Maks tekstbredde i "Normal-modues" - + Horizontal margins are scaled automatically. Horisontale marger skalerer da automatisk. - + px - + Maximum text width in "Focus Mode" Maks tekstbredde i "Fokus-modues" - + Disable maximum text width in "Normal Mode" Slå av maks tekstbredde i "Normal-modus" - + Text width is defined by the margins only. Tekstbredden er kun definert av margene. - + Hide document footer in "Focus Mode" Gjem dokumentets bunnlinje i "Fokus-modus" - + Hide the information bar at the bottom of the document. Gjemmer informasjonslinja i bunnen av dokumentet. - + Justify the text margins in editor and viewer Bruk justerte marger i editor og visning - + Lay out text with straight edges in the editor and viewer. Justerte marger gir rette linjeender i avsnitt. - + Text margin Marger - + If maximum width is set, this becomes the minimum margin. Hvis tekstbredde er satt, så blir dette istedet minste marger. - + Tab width Tabulatorens bredde - + The width of a tab key press in the editor and viewer. Hvor langt tabulatoren hopper i editor og visning. @@ -3026,127 +3026,127 @@ GuiPreferencesEditor - + Spell Checking Stavekontroll - + Internal Intern - + Spell check provider Verktøy for stavekontroll - + Note that the internal spell check tool is quite slow. Merk at den interne stavekontrollen er ganske treg. - + Spell check language Språk for stavekontroll - + Available languages are determined by your system. Tilgjengelige språk hentes fra operativystemet ditt. - + Big document limit Grense for store dokumenter - + Full spell checking is disabled above this limit. Automatisk stavekontroll slås av over grensen. - + kB - + Word Count Telling av ord - + Word count interval Telle-intervall - + How often the word count is updated. Hvor ofte antall ord blir oppdatert. - + seconds sekunder - + Writing Guides Hjelpesymboler - + Show tabs and spaces Synlige tabulatorer og mellomrom - + Add symbols to indicate tabs and spaces in the editor. Viser symboler for å indikere disse i editoren. - + Show line endings Synlige linjeender - + Add a symbol to indicate line endings in the editor. Viser symbol for å indikere dette i editoren. - + Scroll Behaviour Rullefelt - + Scroll past end of the document Tillat å rulle forbi slutten av dokumentet - + Also improves trypewriter scrolling for short documents. Forbedrer funksjonen til skrivemaskin-rulling. - + Typewriter style scrolling when you type Skrivemaskin-liknende rulling mens du skriver - + Try to keep the cursor at a fixed vertical position. Prøver å holde markøren på samme sted vertikalt. - + Minimum position for Typewriter scrolling Minste avstand for skrivemaskin-rulling - + Percentage of the editor height from the top. I prosent fra toppen av editor-vinduet. @@ -3154,82 +3154,82 @@ GuiPreferencesGeneral - + Look and Feel Utseende - + Main GUI theme Fargetema - + Changing this requires restarting novelWriter. Endring av dette krever omstart av novelWriter. - + Main icon theme Ikon-tema - + Prefer icons for dark backgrounds Foretrekk ikoner for mørk bakgrunn - + May improve the look of icons on dark themes. Kan forbedre utseende på mørke temaer. - + Font family Skriftfamilie - + Font size Skriftstørrelse - + pt - + GUI Settings Brukergrensesnitt - + Show full path in document header Vis full prosjektbane i dokumenthoder - + Add the parent folder names to the header. Legger til mappene foran dokumentets navn. - + Hide vertical scroll bars in main windows Skjul vertikale rullefelt i hovedvinduer - + Scrolling available with mouse wheel and keys only. Rulling kan bare gjøres med mus og tastatur. - + Hide horizontal scroll bars in main windows Skjul horisontale rullefelt i hovedvinduer - + Main GUI language Programspråk @@ -3237,107 +3237,107 @@ GuiPreferencesProjects - + Automatic Save Automatisk lagring - + Save document interval Interval for lagring av dokument - + How often the open document is automatically saved. Hvor ofte det åpne dokumentet lagres automatisk. - + seconds sekunder - + Save project interval Interval for lagring av prosjekt - + How often the open project is automatically saved. Hvor ofte det åpne prosjektet lagres automatisk. - + Project Backup Sikkerhetskopi - + Browse Bla - + Backup storage location Filbane for sikkerhetskopi - + Path: {0} Filbane: {0} - + Run backup when the project is closed Lag sikkerhetskopi når prosjektet lukkes - + Can be overridden for individual projects in Project Settings. Kan overstyres fra individuelle prosjektinnstillinger. - + Ask before running backup Spør før sikkerhetskopi tas - + If off, backups will run in the background. Hvis avslått, tas sikkerhetskopi automatisk. - + Session Timer Sesjons-klokke - + Pause the session timer when not writing Sett klokka på pause når du er inaktiv - + Also pauses when the application window does not have focus. Pauses også når du ikke jobber i applikasjonens vindu. - + Editor inactive time before pausing timer Tid uten skriving før klokka settes på pause - + User activity includes typing and changing the content. Dette måler kun endringer i teksteditoren. - + minutes minutter - + Backup Directory Mappe for sikkerhetskopi @@ -3345,47 +3345,47 @@ GuiPreferencesQuotes - + Quotation Style Sitattegn - + Single quote open style Enkelt sitat, venstre side - + The symbol to use for a leading single quote. Symbol for enkelt sitattegn før et sitat. - + Single quote close style Enkelt sitat, høyre side - + The symbol to use for a trailing single quote. Symbol for enkelt sitattegn etter et sitat. - + Double quote open style Dobbelt sitat, venstre side - + The symbol to use for a leading double quote. Symbol for dobbelt sitattegn før et sitat. - + Double quote close style Dobbelt sitat, høyre side - + The symbol to use for a trailing double quote. Symbol for dobbelt sitattegn etter et sitat. @@ -3393,67 +3393,67 @@ GuiPreferencesSyntax - + Highlighting Theme Syntaksfremheving - + Highlighting theme Fremhevingstema - + Colour theme to apply to the editor and viewer. Fargetema for editor og visning. - + Quotes & Dialogue Sitattegn & dialog - + Highlight text wrapped in quotes Fremhev tekst mellom sitattegn - + Applies to single, double and straight quotes. Gjelder enkle, doble og rette sitattegn. - + Allow open-ended single quotes Tillat enkle sitattegn som ikke lukkes - + Highlight single-quoted line with no closing quote. Fremhev sitater som ikke er lukket i samme avsnitt. - + Allow open-ended double quotes Tillat doble sitattegn som ikke lukkes - + Highlight double-quoted line with no closing quote. Fremhev sitater som ikke er lukket i samme avsnitt. - + Text Emphasis Fremheving av tekst - + Add highlight colour to emphasised text Fremhev formattert tekst - + Applies to emphasis (italic) and strong (bold). Gjelder kursiv og fet tekst. diff --git a/i18n/nw_pt.ts b/i18n/nw_pt.ts index 2d199449..ec69bf37 100644 --- a/i18n/nw_pt.ts +++ b/i18n/nw_pt.ts @@ -2762,47 +2762,47 @@ GuiPreferences - + Some changes will not be applied until novelWriter has been restarted. Algumas alterações não serão aplicadas enquanto a aplicação não for reiniciada. - + Preferences Preferências - + General Geral - + Projects Projetos - + Editor Editor - + Documents Documentos - + Highlighting Destaque - + Automation Automação - + Quotes Citações @@ -2810,107 +2810,107 @@ GuiPreferencesAutomation - + Automatic Features Funcionalidades Automáticas - + Auto-select word under cursor Selecionar automaticamente a palavra sob o cursor - + Apply formatting to word under cursor if no selection is made. Aplicar a formatação à palavra sob o cursor se nenhuma seleção for feita. - + Auto-replace text as you type Substituir automaticamente o texto enquanto digita - + Allow the editor to replace symbols as you type. Permite que o editor substituia símbolos emquanto você digita. - + Replace as You Type Substituição Durante a Digitação - + Auto-replace single quotes Substituir automaticamente aspas simples - + Try to guess which is an opening or a closing single quote. Tenta adivinhar se a aspa simples é de abertura ou de fechamento. - + Auto-replace double quotes Subsitituir automaticamente aspas duplas - + Try to guess which is an opening or a closing double quote. Tenta adivinhar se a aspa dupla é de abertura ou de fechamento. - + Auto-replace dashes Substituir automaticamente os travessões - + Double and triple hyphens become short and long dashes. Hífens duplos ou triplos se tornam travessões curtos ou longos. - + Auto-replace dots Substituir automaticamente os pontos - + Three consecutive dots become ellipsis. Três pontos consecutivos se tornam uma reticência. - + Automatic Padding Espaçamento Automático - + Insert non-breaking space before Insere um espaço não-separável antes - + Insert non-breaking space after Insere um espaço não-separável após - + Use thin space instead Usar um espaço estreito - + Automatically add space before any of these symbols. Adicionar automaticamente um espaço antes de cada um desses símbolos. - + Automatically add space after any of these symbols. Adicionar automaticamente um espaço após cada um desses símbolos. - + Inserts a thin space instead of a regular space. Insere um espaço estreito ao invés de um espaço regular. @@ -2918,107 +2918,107 @@ GuiPreferencesDocuments - + Text Style Estilo do Texto - + Font family Família da fonte - + Font for the document editor and viewer. Fonte para o editor e visualizador de documentos. - + Font size Tamanho da fonte - + Font size for the document editor and viewer. Tamanho da fonte para o editor e visualizador de documentos. - + Text Flow Fluxo do Texto - + Maximum text width in "Normal Mode" Largura máxima do texto no "Modo Normal" - + Horizontal margins are scaled automatically. Margens horizontais são redimensionadas automaticamente. - + Maximum text width in "Focus Mode" Largura máxima do texto no "Modo Foco" - + Disable maximum text width in "Normal Mode" Desabilita a largura máxima do texto no "Modo Normal" - + Text width is defined by the margins only. A largura do texto é definida apenas pelas margens. - + Hide document footer in "Focus Mode" Oculta o rodapé do documento no "Modo Foco" - + Hide the information bar at the bottom of the document. Oculta a barra de informações na parte de baixo do documento. - + Justify the text margins in editor and viewer Justifica as margens do texto no editor e visualizador - + Lay out text with straight edges in the editor and viewer. Organiza o texto com cantos retos no editor e visualizador. - + Text margin Margem do texto - + If maximum width is set, this becomes the minimum margin. Se a largura máxima for definida, esta se torna a margem mínima. - + Tab width Largura da tabulação - + The width of a tab key press in the editor and viewer. A largura de uma tabulação no editor e visualizador. - + px px - + pt pt @@ -3026,127 +3026,127 @@ GuiPreferencesEditor - + Spell Checking Correção Ortográfica - + Internal Interno - + Spell check provider Provedor de correção ortográfica - + Note that the internal spell check tool is quite slow. Note que o corretor ortográfico interno é significativamente lento. - + Spell check language Idioma do corretor ortográfico - + Available languages are determined by your system. Os idiomas disponíveis são determinados pelo seu sistema. - + Big document limit Limite de documento grande - + Full spell checking is disabled above this limit. A verificação ortográfica é desabilitada acima desse limite. - + Writing Guides Guias de Escrita - + Show tabs and spaces Mostrar tabulações e espaços - + Add symbols to indicate tabs and spaces in the editor. Adiciona símbolos para indicar tabulações e espaços no editor. - + Show line endings Mostrar terminações de linha - + Add a symbol to indicate line endings in the editor. Adiciona um símbolo para indicar a terminação de linha no editor. - + Scroll Behaviour Comportamento da Rolagem - + Scroll past end of the document Rolar após o final do documento - + Also improves trypewriter scrolling for short documents. Também melhora a rolagem de máquina de escrever em documentos curtos. - + Typewriter style scrolling when you type Rolagem no estilo de máquina de escrever quando digita - + Try to keep the cursor at a fixed vertical position. Tenta manter o cursor em uma posição vertical fixa. - + Minimum position for Typewriter scrolling Posição máxima da rolagem de máquina de escrever - + Percentage of the editor height from the top. Porcentagem da altura do editor desde o topo. - + kB kB - + Word Count Contagem de Palavras - + Word count interval Intervalo de contagem de palavras - + How often the word count is updated. Com qual frequência a contagem de palavras é atualizada. - + seconds segundos @@ -3154,82 +3154,82 @@ GuiPreferencesGeneral - + Look and Feel Aparência - + Main GUI theme Tema da interface - + Changing this requires restarting novelWriter. Alterações nessa configuração exigem reinício da aplicação. - + Main icon theme Tema dos ícones - + Prefer icons for dark backgrounds Preferir ícones para fundos escuros - + May improve the look of icons on dark themes. Pode melhorar a aparência dos ícones em temas escuros. - + Font family Família da fonte - + Font size Tamanho da fonte - + GUI Settings Configurações da Interface - + Show full path in document header Mostrar o caminho completo do documento no cabeçalho - + Add the parent folder names to the header. Adiciona o nome dos diretórios-pai ao cabeçalho. - + Hide vertical scroll bars in main windows Ocultar a barra de rolagem vertical nas janelas principais - + Scrolling available with mouse wheel and keys only. A rolagem de tela estará diponível apenas com o mouse ou teclado. - + Hide horizontal scroll bars in main windows Ocultar a barra de rolagem horizontal nas janelas principais - + pt pt - + Main GUI language Idioma da Interface @@ -3237,107 +3237,107 @@ GuiPreferencesProjects - + Automatic Save Salvamento Automático - + Save document interval Intervalo de salvamento do documento - + How often the open document is automatically saved. Com qual frequência o documento aberto é salvo automaticamente. - + Save project interval Intervalo de salvamento do projeto - + How often the open project is automatically saved. Com qual frequencia o projeto aberto é salvo automaticamente. - + Project Backup Cópia de Segurança - + Browse Procurar - + Backup storage location Localização da cópia de segurança - + Run backup when the project is closed Executar a cópia de segurança quando o projeto é fechado - + Can be overridden for individual projects in Project Settings. Pode ser sobrescrito para projetos individuais nas configurações do projeto. - + Ask before running backup Perguntar antes de executar a cópia de segurança - + If off, backups will run in the background. Se desativado, cópias de segurança serão executadas em segundo plano. - + Backup Directory Diretório das Cópias de Segurança - + seconds segundos - + Session Timer Temporizador da Sessão - + Pause the session timer when not writing Pausa o temporizador da sessão quando não estiver escrevendo - + Also pauses when the application window does not have focus. Também pausa quando a janela da aplicação não estiver em foco. - + Editor inactive time before pausing timer Tempo inativo do editor antes de pausar o temporizador - + User activity includes typing and changing the content. Atividades de usuário incluem escrever e alterar o conteúdo. - + minutes minutos - + Path: {0} Caminho: {0} @@ -3345,47 +3345,47 @@ GuiPreferencesQuotes - + Quotation Style Estilo de Aspas - + Single quote open style Estilo da aspa de abertura simples - + The symbol to use for a leading single quote. O símbolo usado para a aspa simples à esquerda. - + Single quote close style Estilo da aspa de fechamento simples - + The symbol to use for a trailing single quote. O símbolo usado para a aspa simples à esquerda. - + Double quote open style Estilo da aspa de abertura dupla - + The symbol to use for a leading double quote. O símbolo usado para a aspa dupla à esquerda. - + Double quote close style Estilo da aspa de fechamento dupla - + The symbol to use for a trailing double quote. O símbolo usado para a aspa dupla à direita. @@ -3393,67 +3393,67 @@ GuiPreferencesSyntax - + Highlighting Theme Tema do Destaque - + Highlighting theme Tema do destaque - + Colour theme to apply to the editor and viewer. Tema de cores para aplicar ao editor e visualizador. - + Quotes & Dialogue Citações e Diálogos - + Highlight text wrapped in quotes Destaca o texto em citações - + Applies to single, double and straight quotes. Aplica-se a citações com aspas simples, duplas e retas. - + Allow open-ended single quotes Permite citações com aspas simples sem fechamento - + Highlight single-quoted line with no closing quote. Destaca a linha com citação de aspas simples sem aspas de fechamento. - + Allow open-ended double quotes Permite citações com aspas duplas sem fechamento - + Highlight double-quoted line with no closing quote. Destaca a linha com citação de aspas duplas sem aspas de fechamento. - + Text Emphasis Ênfase de Texto - + Add highlight colour to emphasised text Adiciona destaque de cor ao texto enfatizado - + Applies to emphasis (italic) and strong (bold). Aplica-se à ênfase (itálico) e ênfase forte (negrito). diff --git a/nw/dialogs/__init__.py b/nw/dialogs/__init__.py index caf2ea2f..2cb163a4 100644 --- a/nw/dialogs/__init__.py +++ b/nw/dialogs/__init__.py @@ -7,6 +7,7 @@ from nw.dialogs.itemeditor import GuiItemEditor from nw.dialogs.preferences import GuiPreferences from nw.dialogs.projload import GuiProjectLoad from nw.dialogs.projsettings import GuiProjectSettings +from nw.dialogs.quotes import GuiQuoteSelect from nw.dialogs.wordlist import GuiWordList __all__ = [ @@ -17,5 +18,6 @@ __all__ = [ "GuiPreferences", "GuiProjectLoad", "GuiProjectSettings", + "GuiQuoteSelect", "GuiWordList", ] diff --git a/nw/dialogs/preferences.py b/nw/dialogs/preferences.py index 16b1ba8d..66315e1d 100644 --- a/nw/dialogs/preferences.py +++ b/nw/dialogs/preferences.py @@ -38,7 +38,8 @@ from PyQt5.QtWidgets import ( from nw.core import NWSpellSimple, NWSpellEnchant from nw.enum import nwAlert from nw.constants import nwConst -from nw.gui.custom import QSwitch, QConfigLayout, PagedDialog, QuotesDialog +from nw.gui.custom import QSwitch, QConfigLayout, PagedDialog +from nw.dialogs.quotes import GuiQuoteSelect logger = logging.getLogger(__name__) @@ -1223,7 +1224,7 @@ class GuiPreferencesQuotes(QWidget): def _getQuote(self, qType): """Dialog for single quote open. """ - qtBox = QuotesDialog(self, currentQuote=self.quoteSym[qType].text()) + qtBox = GuiQuoteSelect(self, currentQuote=self.quoteSym[qType].text()) if qtBox.exec_() == QDialog.Accepted: self.quoteSym[qType].setText(qtBox.selectedQuote) diff --git a/nw/dialogs/quotes.py b/nw/dialogs/quotes.py new file mode 100644 index 00000000..7c129332 --- /dev/null +++ b/nw/dialogs/quotes.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +""" +novelWriter – GUI Quotes Dialog +=============================== +GUI class for quotes dialog + +File History: +Created: 2020-06-18 [0.9] + +This file is a part of novelWriter +Copyright 2018–2021, Veronica Berglyd Olsen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" + +import nw +import logging + +from PyQt5.QtGui import QFontMetrics +from PyQt5.QtCore import Qt, QSize +from PyQt5.QtWidgets import ( + QLabel, QVBoxLayout, QHBoxLayout, QDialog, QDialogButtonBox, + QListWidget, QListWidgetItem, QFrame +) + +from nw.constants import trConst, nwQuotes + +logger = logging.getLogger(__name__) + +class GuiQuoteSelect(QDialog): + + selectedQuote = "" + + def __init__(self, theParent=None, currentQuote="\""): + QDialog.__init__(self, parent=theParent) + + self.mainConf = nw.CONFIG + + self.outerBox = QVBoxLayout() + self.innerBox = QHBoxLayout() + self.labelBox = QVBoxLayout() + + self.selectedQuote = currentQuote + + qMetrics = QFontMetrics(self.font()) + pxW = 7*qMetrics.boundingRectChar("M").width() + pxH = 7*qMetrics.boundingRectChar("M").height() + pxH = 7*qMetrics.boundingRectChar("M").height() + + lblFont = self.font() + lblFont.setPointSizeF(4*lblFont.pointSizeF()) + + # Preview Label + self.previewLabel = QLabel(currentQuote) + self.previewLabel.setFont(lblFont) + self.previewLabel.setFixedSize(QSize(pxW, pxH)) + self.previewLabel.setAlignment(Qt.AlignCenter) + self.previewLabel.setFrameStyle(QFrame.Box | QFrame.Plain) + + # Quote Symbols + self.listBox = QListWidget() + self.listBox.itemSelectionChanged.connect(self._selectedSymbol) + + minSize = 100 + for sKey, sLabel in nwQuotes.SYMBOLS.items(): + theText = "[ %s ] %s" % (sKey, trConst(sLabel)) + minSize = max(minSize, qMetrics.boundingRect(theText).width()) + qtItem = QListWidgetItem(theText) + qtItem.setData(Qt.UserRole, sKey) + self.listBox.addItem(qtItem) + if sKey == currentQuote: + self.listBox.setCurrentItem(qtItem) + + self.listBox.setMinimumWidth(minSize + self.mainConf.pxInt(40)) + self.listBox.setMinimumHeight(self.mainConf.pxInt(150)) + + # Buttons + self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) + self.buttonBox.accepted.connect(self._doAccept) + self.buttonBox.rejected.connect(self._doReject) + + # Assemble + self.labelBox.addWidget(self.previewLabel, 0, Qt.AlignTop) + self.labelBox.addStretch(1) + + self.innerBox.addLayout(self.labelBox) + self.innerBox.addWidget(self.listBox) + + self.outerBox.addLayout(self.innerBox) + self.outerBox.addWidget(self.buttonBox) + + self.setLayout(self.outerBox) + + return + + ## + # Slots + ## + + def _selectedSymbol(self): + """Update the preview label and the selected quote style. + """ + selItems = self.listBox.selectedItems() + if selItems: + theSymbol = selItems[0].data(Qt.UserRole) + self.previewLabel.setText(theSymbol) + self.selectedQuote = theSymbol + return + + def _doAccept(self): + """Ok button clicked. + """ + self.accept() + return + + def _doReject(self): + """Cancel button clicked. + """ + self.reject() + return + +# END Class GuiQuoteSelect diff --git a/nw/gui/custom.py b/nw/gui/custom.py index e41c54dd..343f3c10 100644 --- a/nw/gui/custom.py +++ b/nw/gui/custom.py @@ -29,18 +29,17 @@ along with this program. If not, see . import nw import logging -from PyQt5.QtGui import QColor, QPalette, QPainter, QFontMetrics +from PyQt5.QtGui import QColor, QPalette, QPainter from PyQt5.QtCore import ( - Qt, QRect, QPoint, QSize, QRectF, QPropertyAnimation, pyqtProperty + Qt, QRect, QPoint, QRectF, QPropertyAnimation, pyqtProperty ) from PyQt5.QtWidgets import ( QGridLayout, QLabel, QWidget, QVBoxLayout, QHBoxLayout, QSizePolicy, - QAbstractButton, QDialog, QTabWidget, QTabBar, QStyle, QDialogButtonBox, - QStylePainter, QStyleOptionTab, QListWidget, QListWidgetItem, QFrame, - QLineEdit + QAbstractButton, QDialog, QTabWidget, QTabBar, QStyle, QStylePainter, + QStyleOptionTab, QLineEdit ) -from nw.constants import trConst, nwQuotes, nwUnicode +from nw.constants import nwUnicode logger = logging.getLogger(__name__) @@ -461,101 +460,3 @@ class VerticalTabBar(QTabBar): return # END Class VerticalTabBar - -# =============================================================================================== # -# Quotes Dialog -# =============================================================================================== # - -class QuotesDialog(QDialog): - - selectedQuote = "" - - def __init__(self, theParent=None, currentQuote="\""): - QDialog.__init__(self, parent=theParent) - - self.mainConf = nw.CONFIG - - self.outerBox = QVBoxLayout() - self.innerBox = QHBoxLayout() - self.labelBox = QVBoxLayout() - - self.selectedQuote = currentQuote - - qMetrics = QFontMetrics(self.font()) - pxW = 7*qMetrics.boundingRectChar("M").width() - pxH = 7*qMetrics.boundingRectChar("M").height() - pxH = 7*qMetrics.boundingRectChar("M").height() - - lblFont = self.font() - lblFont.setPointSizeF(4*lblFont.pointSizeF()) - - # Preview Label - self.previewLabel = QLabel(currentQuote) - self.previewLabel.setFont(lblFont) - self.previewLabel.setFixedSize(QSize(pxW, pxH)) - self.previewLabel.setAlignment(Qt.AlignCenter) - self.previewLabel.setFrameStyle(QFrame.Box | QFrame.Plain) - - # Quote Symbols - self.listBox = QListWidget() - self.listBox.itemSelectionChanged.connect(self._selectedSymbol) - - minSize = 100 - for sKey, sLabel in nwQuotes.SYMBOLS.items(): - theText = "[ %s ] %s" % (sKey, trConst(sLabel)) - minSize = max(minSize, qMetrics.boundingRect(theText).width()) - qtItem = QListWidgetItem(theText) - qtItem.setData(Qt.UserRole, sKey) - self.listBox.addItem(qtItem) - if sKey == currentQuote: - self.listBox.setCurrentItem(qtItem) - - self.listBox.setMinimumWidth(minSize + self.mainConf.pxInt(40)) - self.listBox.setMinimumHeight(self.mainConf.pxInt(150)) - - # Buttons - self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) - self.buttonBox.accepted.connect(self._doAccept) - self.buttonBox.rejected.connect(self._doReject) - - # Assemble - self.labelBox.addWidget(self.previewLabel, 0, Qt.AlignTop) - self.labelBox.addStretch(1) - - self.innerBox.addLayout(self.labelBox) - self.innerBox.addWidget(self.listBox) - - self.outerBox.addLayout(self.innerBox) - self.outerBox.addWidget(self.buttonBox) - - self.setLayout(self.outerBox) - - return - - ## - # Slots - ## - - def _selectedSymbol(self): - """Update the preview label and the selected quote style. - """ - selItems = self.listBox.selectedItems() - if selItems: - theSymbol = selItems[0].data(Qt.UserRole) - self.previewLabel.setText(theSymbol) - self.selectedQuote = theSymbol - return - - def _doAccept(self): - """Ok button clicked. - """ - self.accept() - return - - def _doReject(self): - """Cancel button clicked. - """ - self.reject() - return - -# END Class QuotesDialog diff --git a/tests/test_gui/test_gui_dialogs.py b/tests/test_dialogs/test_dlg_dialogs.py similarity index 90% rename from tests/test_gui/test_gui_dialogs.py rename to tests/test_dialogs/test_dlg_dialogs.py index f432b155..8681ead8 100644 --- a/tests/test_gui/test_gui_dialogs.py +++ b/tests/test_dialogs/test_dlg_dialogs.py @@ -25,20 +25,20 @@ import pytest from PyQt5.QtCore import QItemSelectionModel from PyQt5.QtWidgets import QListWidgetItem, QDialog, QMessageBox -from nw.gui.custom import QuotesDialog +from nw.dialogs import GuiQuoteSelect keyDelay = 2 typeDelay = 1 stepDelay = 20 @pytest.mark.gui -def testGuiDialogs_Quotes(qtbot, monkeypatch, nwGUI, nwMinimal): +def testDialogs_QuoteSelect(qtbot, monkeypatch, nwGUI, nwMinimal): """Test the quote symbols dialog. """ # Block message box monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes) - nwQuot = QuotesDialog(nwGUI) + nwQuot = GuiQuoteSelect(nwGUI) nwQuot.show() lastItem = "" @@ -58,4 +58,4 @@ def testGuiDialogs_Quotes(qtbot, monkeypatch, nwGUI, nwMinimal): nwQuot._doReject() nwQuot.close() -# END Test testDialogs_Quotes +# END Test testDialogs_QuoteSelect diff --git a/tests/test_dialogs/test_dlg_preferences.py b/tests/test_dialogs/test_dlg_preferences.py index 76197081..1847dae2 100644 --- a/tests/test_dialogs/test_dlg_preferences.py +++ b/tests/test_dialogs/test_dlg_preferences.py @@ -33,8 +33,7 @@ from PyQt5.QtWidgets import ( ) from nw.config import Config -from nw.gui.custom import QuotesDialog -from nw.dialogs import GuiPreferences +from nw.dialogs import GuiPreferences, GuiQuoteSelect from nw.constants import nwConst keyDelay = 2 @@ -234,8 +233,8 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir): tabQuote = nwPrefs.tabQuote nwPrefs._tabBox.setCurrentWidget(tabQuote) - monkeypatch.setattr(QuotesDialog, "selectedQuote", "'") - monkeypatch.setattr(QuotesDialog, "exec_", lambda *args: QDialog.Accepted) + monkeypatch.setattr(GuiQuoteSelect, "selectedQuote", "'") + monkeypatch.setattr(GuiQuoteSelect, "exec_", lambda *args: QDialog.Accepted) qtbot.mouseClick(tabQuote.btnDoubleStyleC, Qt.LeftButton) # Save and Check Config