From 4f639e577371147a51931a24bccbc109761cd804 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 2 Feb 2011 05:42:08 +0000 Subject: [PATCH] Added an option for the wrapping mode --- po/de.po | 116 ++++++++++++++++++++++++++++++--------------------- po/es.po | 116 ++++++++++++++++++++++++++++++--------------------- po/fr.po | 116 ++++++++++++++++++++++++++++++--------------------- po/it.po | 116 ++++++++++++++++++++++++++++++--------------------- src/editor.c | 93 ++++++++++++++++++++++++++++++++++------- src/editor.h | 2 + 6 files changed, 351 insertions(+), 208 deletions(-) diff --git a/po/de.po b/po/de.po index 0767c6f..648fc5f 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Editor 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-26 01:54+0100\n" +"POT-Creation-Date: 2011-02-02 06:40+0100\n" "PO-Revision-Date: 2010-04-07 22:05+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: German\n" @@ -16,195 +16,215 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/editor.c:89 +#: ../src/editor.c:91 msgid "_New" msgstr "_Neu" -#: ../src/editor.c:91 +#: ../src/editor.c:93 msgid "_Open" msgstr "_Offnen" -#: ../src/editor.c:94 +#: ../src/editor.c:96 msgid "_Save" msgstr "" -#: ../src/editor.c:96 +#: ../src/editor.c:98 msgid "_Save as..." msgstr "" -#: ../src/editor.c:99 +#: ../src/editor.c:101 msgid "_Close" msgstr "_Schliessen" -#: ../src/editor.c:106 +#: ../src/editor.c:108 msgid "_Undo" msgstr "" -#: ../src/editor.c:108 +#: ../src/editor.c:110 msgid "_Redo" msgstr "" -#: ../src/editor.c:110 +#: ../src/editor.c:112 msgid "_Cut" msgstr "" -#: ../src/editor.c:112 +#: ../src/editor.c:114 msgid "_Copy" msgstr "" -#: ../src/editor.c:114 +#: ../src/editor.c:116 msgid "_Paste" msgstr "" -#: ../src/editor.c:117 +#: ../src/editor.c:119 msgid "Select _all" msgstr "" -#: ../src/editor.c:124 +#: ../src/editor.c:126 msgid "_Unselect all" msgstr "" -#: ../src/editor.c:126 +#: ../src/editor.c:128 msgid "_Find" msgstr "" -#: ../src/editor.c:129 +#: ../src/editor.c:131 msgid "_Preferences" msgstr "_Einstellungen" -#: ../src/editor.c:136 +#: ../src/editor.c:138 msgid "_About" msgstr "_Info" -#: ../src/editor.c:147 +#: ../src/editor.c:149 msgid "_File" msgstr "_Datei" -#: ../src/editor.c:148 +#: ../src/editor.c:150 msgid "_Edit" msgstr "_Bearbeitung" -#: ../src/editor.c:149 +#: ../src/editor.c:151 msgid "_Help" msgstr "_Hilfe" -#: ../src/editor.c:156 +#: ../src/editor.c:158 msgid "New" msgstr "" -#: ../src/editor.c:157 +#: ../src/editor.c:159 msgid "Open" msgstr "" -#: ../src/editor.c:159 +#: ../src/editor.c:161 msgid "Save" msgstr "" -#: ../src/editor.c:160 +#: ../src/editor.c:162 msgid "Save as" msgstr "" -#: ../src/editor.c:163 +#: ../src/editor.c:165 msgid "Cut" msgstr "" -#: ../src/editor.c:164 +#: ../src/editor.c:166 msgid "Copy" msgstr "" -#: ../src/editor.c:165 +#: ../src/editor.c:167 msgid "Paste" msgstr "" -#: ../src/editor.c:168 +#: ../src/editor.c:170 msgid "Preferences" msgstr "Einstellungen" -#: ../src/editor.c:259 +#: ../src/editor.c:182 +msgid "none" +msgstr "" + +#: ../src/editor.c:183 +msgid "characters" +msgstr "" + +#: ../src/editor.c:184 +msgid "words" +msgstr "" + +#: ../src/editor.c:185 +msgid "words then characters" +msgstr "" + +#: ../src/editor.c:271 msgid "Text editor - " msgstr "" -#: ../src/editor.c:260 +#: ../src/editor.c:272 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:373 +#: ../src/editor.c:419 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:387 ../src/editor.c:392 +#: ../src/editor.c:433 ../src/editor.c:438 msgid "Error" msgstr "Fehler" -#: ../src/editor.c:419 ../src/editor.c:429 ../src/editor.c:567 -#: ../src/editor.c:581 ../src/editor.c:721 ../src/editor.c:726 +#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:613 +#: ../src/editor.c:627 ../src/editor.c:767 ../src/editor.c:772 msgid "Warning" msgstr "Achtung" -#: ../src/editor.c:423 +#: ../src/editor.c:469 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:487 +#: ../src/editor.c:533 msgid "Find text" msgstr "" -#: ../src/editor.c:494 +#: ../src/editor.c:540 msgid "Text:" msgstr "Text:" -#: ../src/editor.c:501 +#: ../src/editor.c:547 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:503 +#: ../src/editor.c:549 msgid "Wrap" msgstr "" -#: ../src/editor.c:526 +#: ../src/editor.c:572 msgid "Text not found" msgstr "" -#: ../src/editor.c:571 +#: ../src/editor.c:617 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:578 +#: ../src/editor.c:624 msgid "Discard" msgstr "" -#: ../src/editor.c:637 +#: ../src/editor.c:683 msgid "Open file..." msgstr "Offnen..." -#: ../src/editor.c:697 +#: ../src/editor.c:743 msgid "Partial write" msgstr "" -#: ../src/editor.c:725 +#: ../src/editor.c:771 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:734 +#: ../src/editor.c:780 msgid "Allocation error" msgstr "" -#: ../src/editor.c:749 +#: ../src/editor.c:795 msgid "Save as..." msgstr "" -#: ../src/editor.c:806 +#: ../src/editor.c:852 msgid "Text editor preferences" msgstr "Text Editor Einstellungen" -#: ../src/editor.c:823 +#: ../src/editor.c:869 msgid "Font:" msgstr "" +#: ../src/editor.c:878 +msgid "Wrap mode:" +msgstr "" + #: ../src/main.c:43 msgid "Usage: editor [file]\n" msgstr "" diff --git a/po/es.po b/po/es.po index 65e6b95..65bd5b1 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Editor 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-26 01:54+0100\n" +"POT-Creation-Date: 2011-02-02 06:40+0100\n" "PO-Revision-Date: 2010-04-07 22:07+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Spanish\n" @@ -16,195 +16,215 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/editor.c:89 +#: ../src/editor.c:91 msgid "_New" msgstr "" -#: ../src/editor.c:91 +#: ../src/editor.c:93 msgid "_Open" msgstr "" -#: ../src/editor.c:94 +#: ../src/editor.c:96 msgid "_Save" msgstr "" -#: ../src/editor.c:96 +#: ../src/editor.c:98 msgid "_Save as..." msgstr "" -#: ../src/editor.c:99 +#: ../src/editor.c:101 msgid "_Close" msgstr "" -#: ../src/editor.c:106 +#: ../src/editor.c:108 msgid "_Undo" msgstr "" -#: ../src/editor.c:108 +#: ../src/editor.c:110 msgid "_Redo" msgstr "" -#: ../src/editor.c:110 +#: ../src/editor.c:112 msgid "_Cut" msgstr "" -#: ../src/editor.c:112 +#: ../src/editor.c:114 msgid "_Copy" msgstr "" -#: ../src/editor.c:114 +#: ../src/editor.c:116 msgid "_Paste" msgstr "" -#: ../src/editor.c:117 +#: ../src/editor.c:119 msgid "Select _all" msgstr "" -#: ../src/editor.c:124 +#: ../src/editor.c:126 msgid "_Unselect all" msgstr "" -#: ../src/editor.c:126 +#: ../src/editor.c:128 msgid "_Find" msgstr "" -#: ../src/editor.c:129 +#: ../src/editor.c:131 msgid "_Preferences" msgstr "_Preferencias" -#: ../src/editor.c:136 +#: ../src/editor.c:138 msgid "_About" msgstr "" -#: ../src/editor.c:147 +#: ../src/editor.c:149 msgid "_File" msgstr "" -#: ../src/editor.c:148 +#: ../src/editor.c:150 msgid "_Edit" msgstr "" -#: ../src/editor.c:149 +#: ../src/editor.c:151 msgid "_Help" msgstr "" -#: ../src/editor.c:156 +#: ../src/editor.c:158 msgid "New" msgstr "" -#: ../src/editor.c:157 +#: ../src/editor.c:159 msgid "Open" msgstr "" -#: ../src/editor.c:159 +#: ../src/editor.c:161 msgid "Save" msgstr "" -#: ../src/editor.c:160 +#: ../src/editor.c:162 msgid "Save as" msgstr "" -#: ../src/editor.c:163 +#: ../src/editor.c:165 msgid "Cut" msgstr "" -#: ../src/editor.c:164 +#: ../src/editor.c:166 msgid "Copy" msgstr "" -#: ../src/editor.c:165 +#: ../src/editor.c:167 msgid "Paste" msgstr "" -#: ../src/editor.c:168 +#: ../src/editor.c:170 msgid "Preferences" msgstr "" -#: ../src/editor.c:259 +#: ../src/editor.c:182 +msgid "none" +msgstr "" + +#: ../src/editor.c:183 +msgid "characters" +msgstr "" + +#: ../src/editor.c:184 +msgid "words" +msgstr "" + +#: ../src/editor.c:185 +msgid "words then characters" +msgstr "" + +#: ../src/editor.c:271 msgid "Text editor - " msgstr "" -#: ../src/editor.c:260 +#: ../src/editor.c:272 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:373 +#: ../src/editor.c:419 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:387 ../src/editor.c:392 +#: ../src/editor.c:433 ../src/editor.c:438 msgid "Error" msgstr "" -#: ../src/editor.c:419 ../src/editor.c:429 ../src/editor.c:567 -#: ../src/editor.c:581 ../src/editor.c:721 ../src/editor.c:726 +#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:613 +#: ../src/editor.c:627 ../src/editor.c:767 ../src/editor.c:772 msgid "Warning" msgstr "" -#: ../src/editor.c:423 +#: ../src/editor.c:469 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:487 +#: ../src/editor.c:533 msgid "Find text" msgstr "" -#: ../src/editor.c:494 +#: ../src/editor.c:540 msgid "Text:" msgstr "" -#: ../src/editor.c:501 +#: ../src/editor.c:547 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:503 +#: ../src/editor.c:549 msgid "Wrap" msgstr "" -#: ../src/editor.c:526 +#: ../src/editor.c:572 msgid "Text not found" msgstr "" -#: ../src/editor.c:571 +#: ../src/editor.c:617 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:578 +#: ../src/editor.c:624 msgid "Discard" msgstr "" -#: ../src/editor.c:637 +#: ../src/editor.c:683 msgid "Open file..." msgstr "" -#: ../src/editor.c:697 +#: ../src/editor.c:743 msgid "Partial write" msgstr "" -#: ../src/editor.c:725 +#: ../src/editor.c:771 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:734 +#: ../src/editor.c:780 msgid "Allocation error" msgstr "" -#: ../src/editor.c:749 +#: ../src/editor.c:795 msgid "Save as..." msgstr "" -#: ../src/editor.c:806 +#: ../src/editor.c:852 msgid "Text editor preferences" msgstr "" -#: ../src/editor.c:823 +#: ../src/editor.c:869 msgid "Font:" msgstr "" +#: ../src/editor.c:878 +msgid "Wrap mode:" +msgstr "" + #: ../src/main.c:43 msgid "Usage: editor [file]\n" msgstr "" diff --git a/po/fr.po b/po/fr.po index 21387a1..59105d5 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Editor 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-26 01:54+0100\n" +"POT-Creation-Date: 2011-02-02 06:40+0100\n" "PO-Revision-Date: 2010-04-11 12:32+0200\n" "Last-Translator: Calimero \n" "Language-Team: French\n" @@ -16,132 +16,148 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: ../src/editor.c:89 +#: ../src/editor.c:91 msgid "_New" msgstr "_Nouveau" -#: ../src/editor.c:91 +#: ../src/editor.c:93 msgid "_Open" msgstr "_Ouvrir" -#: ../src/editor.c:94 +#: ../src/editor.c:96 msgid "_Save" msgstr "_Enregistrer" -#: ../src/editor.c:96 +#: ../src/editor.c:98 msgid "_Save as..." msgstr "_Enregistrer sous..." -#: ../src/editor.c:99 +#: ../src/editor.c:101 msgid "_Close" msgstr "_Fermer" -#: ../src/editor.c:106 +#: ../src/editor.c:108 msgid "_Undo" msgstr "_Annuler" -#: ../src/editor.c:108 +#: ../src/editor.c:110 msgid "_Redo" msgstr "_Rétablir" -#: ../src/editor.c:110 +#: ../src/editor.c:112 msgid "_Cut" msgstr "Co_uper" -#: ../src/editor.c:112 +#: ../src/editor.c:114 msgid "_Copy" msgstr "_Copier" -#: ../src/editor.c:114 +#: ../src/editor.c:116 msgid "_Paste" msgstr "C_oller" -#: ../src/editor.c:117 +#: ../src/editor.c:119 msgid "Select _all" msgstr "Sélectionner _tout" -#: ../src/editor.c:124 +#: ../src/editor.c:126 msgid "_Unselect all" msgstr "Tout _désélectionner" -#: ../src/editor.c:126 +#: ../src/editor.c:128 msgid "_Find" msgstr "_Rechercher" -#: ../src/editor.c:129 +#: ../src/editor.c:131 msgid "_Preferences" msgstr "_Préférences" -#: ../src/editor.c:136 +#: ../src/editor.c:138 msgid "_About" msgstr "À _propos" -#: ../src/editor.c:147 +#: ../src/editor.c:149 msgid "_File" msgstr "_Fichier" -#: ../src/editor.c:148 +#: ../src/editor.c:150 msgid "_Edit" msgstr "É_dition" -#: ../src/editor.c:149 +#: ../src/editor.c:151 msgid "_Help" msgstr "_Aide" -#: ../src/editor.c:156 +#: ../src/editor.c:158 msgid "New" msgstr "Nouveau" -#: ../src/editor.c:157 +#: ../src/editor.c:159 msgid "Open" msgstr "Ouvrir" -#: ../src/editor.c:159 +#: ../src/editor.c:161 msgid "Save" msgstr "Enregistrer" -#: ../src/editor.c:160 +#: ../src/editor.c:162 msgid "Save as" msgstr "Enregistrer sous" -#: ../src/editor.c:163 +#: ../src/editor.c:165 msgid "Cut" msgstr "Couper" -#: ../src/editor.c:164 +#: ../src/editor.c:166 msgid "Copy" msgstr "Copier" -#: ../src/editor.c:165 +#: ../src/editor.c:167 msgid "Paste" msgstr "Coller" -#: ../src/editor.c:168 +#: ../src/editor.c:170 msgid "Preferences" msgstr "Préférences" -#: ../src/editor.c:259 +#: ../src/editor.c:182 +msgid "none" +msgstr "aucun" + +#: ../src/editor.c:183 +msgid "characters" +msgstr "caractères" + +#: ../src/editor.c:184 +msgid "words" +msgstr "mots" + +#: ../src/editor.c:185 +msgid "words then characters" +msgstr "mots puis caractères" + +#: ../src/editor.c:271 msgid "Text editor - " msgstr "Éditeur de texte - " -#: ../src/editor.c:260 +#: ../src/editor.c:272 msgid "(Untitled)" msgstr "(Sans titre)" -#: ../src/editor.c:373 +#: ../src/editor.c:419 msgid "Could not save configuration" msgstr "Erreur lors de la sauvegarde de la configuration" -#: ../src/editor.c:387 ../src/editor.c:392 +#: ../src/editor.c:433 ../src/editor.c:438 msgid "Error" msgstr "Erreur" -#: ../src/editor.c:419 ../src/editor.c:429 ../src/editor.c:567 -#: ../src/editor.c:581 ../src/editor.c:721 ../src/editor.c:726 +#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:613 +#: ../src/editor.c:627 ../src/editor.c:767 ../src/editor.c:772 msgid "Warning" msgstr "Avertissement" -#: ../src/editor.c:423 +#: ../src/editor.c:469 msgid "" "There are unsaved changes.\n" "Discard or save them?" @@ -149,27 +165,27 @@ msgstr "" "Il y a des changements non enregistrés.\n" "Ignorer ou sauvegarder ?" -#: ../src/editor.c:487 +#: ../src/editor.c:533 msgid "Find text" msgstr "Rechercher" -#: ../src/editor.c:494 +#: ../src/editor.c:540 msgid "Text:" msgstr "Texte :" -#: ../src/editor.c:501 +#: ../src/editor.c:547 msgid "Case-sensitive" msgstr "Sensible à la casse" -#: ../src/editor.c:503 +#: ../src/editor.c:549 msgid "Wrap" msgstr "Boucler" -#: ../src/editor.c:526 +#: ../src/editor.c:572 msgid "Text not found" msgstr "Texte non trouvé" -#: ../src/editor.c:571 +#: ../src/editor.c:617 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" @@ -177,38 +193,42 @@ msgstr "" "Il y a des changements non enregistrés.\n" "Êtes-vous sûr de vouloir les annuler ?" -#: ../src/editor.c:578 +#: ../src/editor.c:624 msgid "Discard" msgstr "Annuler" -#: ../src/editor.c:637 +#: ../src/editor.c:683 msgid "Open file..." msgstr "Ouvrir un fichier..." -#: ../src/editor.c:697 +#: ../src/editor.c:743 msgid "Partial write" msgstr "Écriture partielle" -#: ../src/editor.c:725 +#: ../src/editor.c:771 msgid "This file already exists. Overwrite?" msgstr "Le fichier existe déjà. L'écraser ?" -#: ../src/editor.c:734 +#: ../src/editor.c:780 msgid "Allocation error" msgstr "Erreur d'allocation" -#: ../src/editor.c:749 +#: ../src/editor.c:795 msgid "Save as..." msgstr "Enregistrer sous..." -#: ../src/editor.c:806 +#: ../src/editor.c:852 msgid "Text editor preferences" msgstr "Préférences de l'éditeur de texte" -#: ../src/editor.c:823 +#: ../src/editor.c:869 msgid "Font:" msgstr "Police :" +#: ../src/editor.c:878 +msgid "Wrap mode:" +msgstr "Retour à la ligne :" + #: ../src/main.c:43 msgid "Usage: editor [file]\n" msgstr "Usage: editor [fichier]\n" diff --git a/po/it.po b/po/it.po index a3742db..2379f23 100644 --- a/po/it.po +++ b/po/it.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Editor 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-26 01:54+0100\n" +"POT-Creation-Date: 2011-02-02 06:40+0100\n" "PO-Revision-Date: 2010-04-09 16:43+0200\n" "Last-Translator: Pierre Pronchery \n" "Language-Team: Italian\n" @@ -17,195 +17,215 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../src/editor.c:89 +#: ../src/editor.c:91 msgid "_New" msgstr "" -#: ../src/editor.c:91 +#: ../src/editor.c:93 msgid "_Open" msgstr "" -#: ../src/editor.c:94 +#: ../src/editor.c:96 msgid "_Save" msgstr "" -#: ../src/editor.c:96 +#: ../src/editor.c:98 msgid "_Save as..." msgstr "" -#: ../src/editor.c:99 +#: ../src/editor.c:101 msgid "_Close" msgstr "" -#: ../src/editor.c:106 +#: ../src/editor.c:108 msgid "_Undo" msgstr "" -#: ../src/editor.c:108 +#: ../src/editor.c:110 msgid "_Redo" msgstr "" -#: ../src/editor.c:110 +#: ../src/editor.c:112 msgid "_Cut" msgstr "" -#: ../src/editor.c:112 +#: ../src/editor.c:114 msgid "_Copy" msgstr "" -#: ../src/editor.c:114 +#: ../src/editor.c:116 msgid "_Paste" msgstr "" -#: ../src/editor.c:117 +#: ../src/editor.c:119 msgid "Select _all" msgstr "" -#: ../src/editor.c:124 +#: ../src/editor.c:126 msgid "_Unselect all" msgstr "" -#: ../src/editor.c:126 +#: ../src/editor.c:128 msgid "_Find" msgstr "" -#: ../src/editor.c:129 +#: ../src/editor.c:131 msgid "_Preferences" msgstr "" -#: ../src/editor.c:136 +#: ../src/editor.c:138 msgid "_About" msgstr "" -#: ../src/editor.c:147 +#: ../src/editor.c:149 msgid "_File" msgstr "" -#: ../src/editor.c:148 +#: ../src/editor.c:150 msgid "_Edit" msgstr "" -#: ../src/editor.c:149 +#: ../src/editor.c:151 msgid "_Help" msgstr "" -#: ../src/editor.c:156 +#: ../src/editor.c:158 msgid "New" msgstr "" -#: ../src/editor.c:157 +#: ../src/editor.c:159 msgid "Open" msgstr "" -#: ../src/editor.c:159 +#: ../src/editor.c:161 msgid "Save" msgstr "" -#: ../src/editor.c:160 +#: ../src/editor.c:162 msgid "Save as" msgstr "" -#: ../src/editor.c:163 +#: ../src/editor.c:165 msgid "Cut" msgstr "" -#: ../src/editor.c:164 +#: ../src/editor.c:166 msgid "Copy" msgstr "" -#: ../src/editor.c:165 +#: ../src/editor.c:167 msgid "Paste" msgstr "" -#: ../src/editor.c:168 +#: ../src/editor.c:170 msgid "Preferences" msgstr "" -#: ../src/editor.c:259 +#: ../src/editor.c:182 +msgid "none" +msgstr "" + +#: ../src/editor.c:183 +msgid "characters" +msgstr "" + +#: ../src/editor.c:184 +msgid "words" +msgstr "" + +#: ../src/editor.c:185 +msgid "words then characters" +msgstr "" + +#: ../src/editor.c:271 msgid "Text editor - " msgstr "" -#: ../src/editor.c:260 +#: ../src/editor.c:272 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:373 +#: ../src/editor.c:419 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:387 ../src/editor.c:392 +#: ../src/editor.c:433 ../src/editor.c:438 msgid "Error" msgstr "" -#: ../src/editor.c:419 ../src/editor.c:429 ../src/editor.c:567 -#: ../src/editor.c:581 ../src/editor.c:721 ../src/editor.c:726 +#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:613 +#: ../src/editor.c:627 ../src/editor.c:767 ../src/editor.c:772 msgid "Warning" msgstr "" -#: ../src/editor.c:423 +#: ../src/editor.c:469 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:487 +#: ../src/editor.c:533 msgid "Find text" msgstr "" -#: ../src/editor.c:494 +#: ../src/editor.c:540 msgid "Text:" msgstr "" -#: ../src/editor.c:501 +#: ../src/editor.c:547 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:503 +#: ../src/editor.c:549 msgid "Wrap" msgstr "" -#: ../src/editor.c:526 +#: ../src/editor.c:572 msgid "Text not found" msgstr "" -#: ../src/editor.c:571 +#: ../src/editor.c:617 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:578 +#: ../src/editor.c:624 msgid "Discard" msgstr "" -#: ../src/editor.c:637 +#: ../src/editor.c:683 msgid "Open file..." msgstr "" -#: ../src/editor.c:697 +#: ../src/editor.c:743 msgid "Partial write" msgstr "" -#: ../src/editor.c:725 +#: ../src/editor.c:771 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:734 +#: ../src/editor.c:780 msgid "Allocation error" msgstr "" -#: ../src/editor.c:749 +#: ../src/editor.c:795 msgid "Save as..." msgstr "" -#: ../src/editor.c:806 +#: ../src/editor.c:852 msgid "Text editor preferences" msgstr "" -#: ../src/editor.c:823 +#: ../src/editor.c:869 msgid "Font:" msgstr "" +#: ../src/editor.c:878 +msgid "Wrap mode:" +msgstr "" + #: ../src/main.c:43 msgid "Usage: editor [file]\n" msgstr "" diff --git a/src/editor.c b/src/editor.c index f303c06..53971f3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -20,6 +20,7 @@ static char const _license[] = #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ struct _Editor /* preferences */ GtkWidget * pr_window; GtkWidget * pr_font; + GtkWidget * pr_wrap; /* find */ GtkWidget * fi_dialog; GtkWidget * fi_text; @@ -171,6 +173,18 @@ static DesktopToolbar _editor_toolbar[] = { NULL, NULL, NULL, 0, 0, NULL } }; +static struct +{ + char const * name; + GtkWrapMode wrap; +} _editor_wrap[] = +{ + { N_("none"), GTK_WRAP_NONE }, + { N_("characters"), GTK_WRAP_CHAR }, + { N_("words"), GTK_WRAP_WORD }, + { N_("words then characters"), GTK_WRAP_WORD_CHAR } +}; + /* prototypes */ static char * _editor_config_filename(void); @@ -229,11 +243,9 @@ Editor * editor_new(void) gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); editor->view = gtk_text_view_new(); - /* FIXME make it an option */ - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editor->view), - GTK_WRAP_WORD_CHAR); desc = pango_font_description_from_string(editor_get_font(editor)); editor_set_font(editor, pango_font_description_to_string(desc)); + editor_set_wrap_mode(editor, editor_get_wrap_mode(editor)); pango_font_description_free(desc); gtk_container_add(GTK_CONTAINER(widget), editor->view); gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0); @@ -303,6 +315,22 @@ char const * editor_get_font(Editor * editor) } +/* editor_get_wrap_mode */ +GtkWrapMode editor_get_wrap_mode(Editor * editor) +{ + char const * p; + unsigned int i; + + if((p = config_get(editor->config, NULL, "wrap")) != NULL) + { + i = strtoul(p, NULL, 10); + if(i < sizeof(_editor_wrap) / sizeof(*_editor_wrap)) + return _editor_wrap[i].wrap; + } + return GTK_WRAP_WORD_CHAR; +} + + /* editor_set_font */ void editor_set_font(Editor * editor, char const * font) { @@ -315,6 +343,24 @@ void editor_set_font(Editor * editor, char const * font) } +/* editor_set_wrap_mode */ +void editor_set_wrap_mode(Editor * editor, GtkWrapMode wrap) +{ + size_t i; + char buf[10]; + + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editor->view), + wrap); + for(i = 0; i < sizeof(_editor_wrap) / sizeof(*_editor_wrap); i++) + if(_editor_wrap[i].wrap == wrap) + { + snprintf(buf, sizeof(buf), "%lu", i); + config_set(editor->config, NULL, "wrap", buf); + return; + } +} + + /* useful */ /* editor_about */ static gboolean _about_on_closex(gpointer data); @@ -780,7 +826,6 @@ void editor_select_all(Editor * editor) /* editor_show_preferences */ -static void _preferences_set(Editor * editor); static gboolean _preferences_on_closex(gpointer data); static void _preferences_on_response(GtkWidget * widget, gint response, gpointer data); @@ -793,6 +838,7 @@ void editor_show_preferences(Editor * editor, gboolean show) GtkWidget * hbox; GtkWidget * widget; GtkSizeGroup * group; + size_t i; if(editor->pr_window != NULL) { @@ -817,28 +863,33 @@ void editor_show_preferences(Editor * editor, gboolean show) #else vbox = GTK_DIALOG(editor->pr_window)->vbox; #endif - hbox = gtk_hbox_new(FALSE, 0); group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); /* font */ + hbox = gtk_hbox_new(FALSE, 4); widget = gtk_label_new(_("Font:")); - gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 4); + gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0); editor->pr_font = gtk_font_button_new(); gtk_font_button_set_use_font(GTK_FONT_BUTTON(editor->pr_font), TRUE); gtk_size_group_add_widget(group, editor->pr_font); - gtk_box_pack_start(GTK_BOX(hbox), editor->pr_font, TRUE, TRUE, 4); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 4); - _preferences_set(editor); + gtk_box_pack_start(GTK_BOX(hbox), editor->pr_font, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + /* wrap mode */ + hbox = gtk_hbox_new(FALSE, 4); + widget = gtk_label_new(_("Wrap mode:")); + gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 0); + editor->pr_wrap = gtk_combo_box_new_text(); + for(i = 0; i < sizeof(_editor_wrap) / sizeof(*_editor_wrap); i++) + gtk_combo_box_append_text(GTK_COMBO_BOX(editor->pr_wrap), + _(_editor_wrap[i].name)); + gtk_size_group_add_widget(group, editor->pr_wrap); + gtk_box_pack_start(GTK_BOX(hbox), editor->pr_wrap, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); + _preferences_on_cancel(editor); gtk_widget_show_all(vbox); if(show) gtk_widget_show(editor->pr_window); } -static void _preferences_set(Editor * editor) -{ - gtk_font_button_set_font_name(GTK_FONT_BUTTON(editor->pr_font), - editor_get_font(editor)); -} - static gboolean _preferences_on_closex(gpointer data) { Editor * editor = data; @@ -860,19 +911,29 @@ static void _preferences_on_response(GtkWidget * widget, gint response, static void _preferences_on_cancel(gpointer data) { Editor * editor = data; + char const * p; + gint u = 0; gtk_widget_hide(editor->pr_window); - _preferences_set(editor); + gtk_font_button_set_font_name(GTK_FONT_BUTTON(editor->pr_font), + editor_get_font(editor)); + if((p = config_get(editor->config, NULL, "wrap")) != NULL) + u = strtol(p, NULL, 10); + gtk_combo_box_set_active(GTK_COMBO_BOX(editor->pr_wrap), u); } static void _preferences_on_ok(gpointer data) { Editor * editor = data; char const * font; + size_t i; gtk_widget_hide(editor->pr_window); font = gtk_font_button_get_font_name(GTK_FONT_BUTTON(editor->pr_font)); editor_set_font(editor, font); + i = gtk_combo_box_get_active(GTK_COMBO_BOX(editor->pr_wrap)); + if(i < sizeof(_editor_wrap) / sizeof(*_editor_wrap)) + editor_set_wrap_mode(editor, _editor_wrap[i].wrap); editor_config_save(editor); } diff --git a/src/editor.h b/src/editor.h index b1c44b6..11bc362 100644 --- a/src/editor.h +++ b/src/editor.h @@ -33,7 +33,9 @@ void editor_delete(Editor * editor); /* accessors */ char const * editor_get_font(Editor * editor); +GtkWrapMode editor_get_wrap_mode(Editor * editor); void editor_set_font(Editor * editor, char const * font); +void editor_set_wrap_mode(Editor * editor, GtkWrapMode wrap); /* useful */ void editor_about(Editor * editor);