Now really saving and loading the configuration

This commit is contained in:
Pierre Pronchery 2010-10-26 02:19:49 +00:00
parent 3401e153f5
commit 1aaab607fa
9 changed files with 293 additions and 199 deletions

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Editor 0.1.1\n" "Project-Id-Version: Editor 0.1.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-26 03:39+0200\n" "POT-Creation-Date: 2010-10-26 04:16+0200\n"
"PO-Revision-Date: 2010-04-07 22:05+0200\n" "PO-Revision-Date: 2010-04-07 22:05+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: German\n" "Language-Team: German\n"
@ -16,176 +16,180 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../src/callbacks.c:70 #: ../src/callbacks.c:67
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "Text Editor Einstellungen" msgstr "Text Editor Einstellungen"
#: ../src/callbacks.c:87 #: ../src/callbacks.c:84
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:59 #: ../src/editor.c:64
msgid "_New" msgid "_New"
msgstr "_Neu" msgstr "_Neu"
#: ../src/editor.c:61 #: ../src/editor.c:66
msgid "_Open" msgid "_Open"
msgstr "_Offnen" msgstr "_Offnen"
#: ../src/editor.c:64 #: ../src/editor.c:69
msgid "_Save" msgid "_Save"
msgstr "" msgstr ""
#: ../src/editor.c:66 #: ../src/editor.c:71
msgid "_Save as..." msgid "_Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:69 #: ../src/editor.c:74
msgid "_Close" msgid "_Close"
msgstr "_Schliessen" msgstr "_Schliessen"
#: ../src/editor.c:76 #: ../src/editor.c:81
msgid "_Undo" msgid "_Undo"
msgstr "" msgstr ""
#: ../src/editor.c:78 #: ../src/editor.c:83
msgid "_Redo" msgid "_Redo"
msgstr "" msgstr ""
#: ../src/editor.c:80 #: ../src/editor.c:85
msgid "_Cut" msgid "_Cut"
msgstr "" msgstr ""
#: ../src/editor.c:81 #: ../src/editor.c:86
msgid "_Copy" msgid "_Copy"
msgstr "" msgstr ""
#: ../src/editor.c:82 #: ../src/editor.c:87
msgid "_Paste" msgid "_Paste"
msgstr "" msgstr ""
#: ../src/editor.c:84 #: ../src/editor.c:89
msgid "Select _all" msgid "Select _all"
msgstr "" msgstr ""
#: ../src/editor.c:91 #: ../src/editor.c:96
msgid "_Unselect all" msgid "_Unselect all"
msgstr "" msgstr ""
#: ../src/editor.c:93 #: ../src/editor.c:98
msgid "_Find" msgid "_Find"
msgstr "" msgstr ""
#: ../src/editor.c:96 #: ../src/editor.c:101
msgid "_Preferences" msgid "_Preferences"
msgstr "_Einstellungen" msgstr "_Einstellungen"
#: ../src/editor.c:103 #: ../src/editor.c:108
msgid "_About" msgid "_About"
msgstr "_Info" msgstr "_Info"
#: ../src/editor.c:114 #: ../src/editor.c:119
msgid "_File" msgid "_File"
msgstr "_Datei" msgstr "_Datei"
#: ../src/editor.c:115 #: ../src/editor.c:120
msgid "_Edit" msgid "_Edit"
msgstr "" msgstr ""
#: ../src/editor.c:116 #: ../src/editor.c:121
msgid "_Help" msgid "_Help"
msgstr "" msgstr ""
#: ../src/editor.c:123 #: ../src/editor.c:128
msgid "New" msgid "New"
msgstr "" msgstr ""
#: ../src/editor.c:124 #: ../src/editor.c:129
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: ../src/editor.c:126 #: ../src/editor.c:131
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: ../src/editor.c:127 #: ../src/editor.c:132
msgid "Save as" msgid "Save as"
msgstr "" msgstr ""
#: ../src/editor.c:131 #: ../src/editor.c:136
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: ../src/editor.c:221 #: ../src/editor.c:227
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:222 #: ../src/editor.c:228
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:293 ../src/editor.c:298 #: ../src/editor.c:341
msgid "Could not save configuration"
msgstr ""
#: ../src/editor.c:355 ../src/editor.c:360
msgid "Error" msgid "Error"
msgstr "Fehler" msgstr "Fehler"
#: ../src/editor.c:325 ../src/editor.c:334 ../src/editor.c:444 #: ../src/editor.c:387 ../src/editor.c:396 ../src/editor.c:506
#: ../src/editor.c:458 ../src/editor.c:588 ../src/editor.c:593 #: ../src/editor.c:520 ../src/editor.c:650 ../src/editor.c:655
msgid "Warning" msgid "Warning"
msgstr "Achtung" msgstr "Achtung"
#: ../src/editor.c:329 #: ../src/editor.c:391
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to close?" "Are you sure you want to close?"
msgstr "" msgstr ""
#: ../src/editor.c:364 #: ../src/editor.c:426
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:371 #: ../src/editor.c:433
msgid "Text:" msgid "Text:"
msgstr "Text:" msgstr "Text:"
#: ../src/editor.c:378 #: ../src/editor.c:440
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:380 #: ../src/editor.c:442
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:403 #: ../src/editor.c:465
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:448 #: ../src/editor.c:510
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to discard them?" "Are you sure you want to discard them?"
msgstr "" msgstr ""
#: ../src/editor.c:455 #: ../src/editor.c:517
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:514 #: ../src/editor.c:576
msgid "Open file..." msgid "Open file..."
msgstr "Offnen..." msgstr "Offnen..."
#: ../src/editor.c:564 #: ../src/editor.c:626
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:592 #: ../src/editor.c:654
msgid "File exists. Overwrite?" msgid "File exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:601 #: ../src/editor.c:663
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:616 #: ../src/editor.c:678
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Editor 0.1.1\n" "Project-Id-Version: Editor 0.1.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-26 03:39+0200\n" "POT-Creation-Date: 2010-10-26 04:16+0200\n"
"PO-Revision-Date: 2010-04-07 22:07+0200\n" "PO-Revision-Date: 2010-04-07 22:07+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
@ -16,176 +16,180 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../src/callbacks.c:70 #: ../src/callbacks.c:67
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "" msgstr ""
#: ../src/callbacks.c:87 #: ../src/callbacks.c:84
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:59 #: ../src/editor.c:64
msgid "_New" msgid "_New"
msgstr "" msgstr ""
#: ../src/editor.c:61 #: ../src/editor.c:66
msgid "_Open" msgid "_Open"
msgstr "" msgstr ""
#: ../src/editor.c:64 #: ../src/editor.c:69
msgid "_Save" msgid "_Save"
msgstr "" msgstr ""
#: ../src/editor.c:66 #: ../src/editor.c:71
msgid "_Save as..." msgid "_Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:69 #: ../src/editor.c:74
msgid "_Close" msgid "_Close"
msgstr "" msgstr ""
#: ../src/editor.c:76 #: ../src/editor.c:81
msgid "_Undo" msgid "_Undo"
msgstr "" msgstr ""
#: ../src/editor.c:78 #: ../src/editor.c:83
msgid "_Redo" msgid "_Redo"
msgstr "" msgstr ""
#: ../src/editor.c:80 #: ../src/editor.c:85
msgid "_Cut" msgid "_Cut"
msgstr "" msgstr ""
#: ../src/editor.c:81 #: ../src/editor.c:86
msgid "_Copy" msgid "_Copy"
msgstr "" msgstr ""
#: ../src/editor.c:82 #: ../src/editor.c:87
msgid "_Paste" msgid "_Paste"
msgstr "" msgstr ""
#: ../src/editor.c:84 #: ../src/editor.c:89
msgid "Select _all" msgid "Select _all"
msgstr "" msgstr ""
#: ../src/editor.c:91 #: ../src/editor.c:96
msgid "_Unselect all" msgid "_Unselect all"
msgstr "" msgstr ""
#: ../src/editor.c:93 #: ../src/editor.c:98
msgid "_Find" msgid "_Find"
msgstr "" msgstr ""
#: ../src/editor.c:96 #: ../src/editor.c:101
msgid "_Preferences" msgid "_Preferences"
msgstr "" msgstr ""
#: ../src/editor.c:103 #: ../src/editor.c:108
msgid "_About" msgid "_About"
msgstr "" msgstr ""
#: ../src/editor.c:114 #: ../src/editor.c:119
msgid "_File" msgid "_File"
msgstr "" msgstr ""
#: ../src/editor.c:115 #: ../src/editor.c:120
msgid "_Edit" msgid "_Edit"
msgstr "" msgstr ""
#: ../src/editor.c:116 #: ../src/editor.c:121
msgid "_Help" msgid "_Help"
msgstr "" msgstr ""
#: ../src/editor.c:123 #: ../src/editor.c:128
msgid "New" msgid "New"
msgstr "" msgstr ""
#: ../src/editor.c:124 #: ../src/editor.c:129
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: ../src/editor.c:126 #: ../src/editor.c:131
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: ../src/editor.c:127 #: ../src/editor.c:132
msgid "Save as" msgid "Save as"
msgstr "" msgstr ""
#: ../src/editor.c:131 #: ../src/editor.c:136
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: ../src/editor.c:221 #: ../src/editor.c:227
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:222 #: ../src/editor.c:228
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:293 ../src/editor.c:298 #: ../src/editor.c:341
msgid "Could not save configuration"
msgstr ""
#: ../src/editor.c:355 ../src/editor.c:360
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: ../src/editor.c:325 ../src/editor.c:334 ../src/editor.c:444 #: ../src/editor.c:387 ../src/editor.c:396 ../src/editor.c:506
#: ../src/editor.c:458 ../src/editor.c:588 ../src/editor.c:593 #: ../src/editor.c:520 ../src/editor.c:650 ../src/editor.c:655
msgid "Warning" msgid "Warning"
msgstr "" msgstr ""
#: ../src/editor.c:329 #: ../src/editor.c:391
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to close?" "Are you sure you want to close?"
msgstr "" msgstr ""
#: ../src/editor.c:364 #: ../src/editor.c:426
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:371 #: ../src/editor.c:433
msgid "Text:" msgid "Text:"
msgstr "" msgstr ""
#: ../src/editor.c:378 #: ../src/editor.c:440
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:380 #: ../src/editor.c:442
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:403 #: ../src/editor.c:465
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:448 #: ../src/editor.c:510
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to discard them?" "Are you sure you want to discard them?"
msgstr "" msgstr ""
#: ../src/editor.c:455 #: ../src/editor.c:517
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:514 #: ../src/editor.c:576
msgid "Open file..." msgid "Open file..."
msgstr "" msgstr ""
#: ../src/editor.c:564 #: ../src/editor.c:626
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:592 #: ../src/editor.c:654
msgid "File exists. Overwrite?" msgid "File exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:601 #: ../src/editor.c:663
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:616 #: ../src/editor.c:678
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Editor 0.1.1\n" "Project-Id-Version: Editor 0.1.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-26 03:39+0200\n" "POT-Creation-Date: 2010-10-26 04:16+0200\n"
"PO-Revision-Date: 2010-04-11 12:32+0200\n" "PO-Revision-Date: 2010-04-11 12:32+0200\n"
"Last-Translator: Calimero <calimeroteknik@free.fr>\n" "Last-Translator: Calimero <calimeroteknik@free.fr>\n"
"Language-Team: French\n" "Language-Team: French\n"
@ -16,124 +16,128 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../src/callbacks.c:70 #: ../src/callbacks.c:67
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "Préférences de l'éditeur de texte" msgstr "Préférences de l'éditeur de texte"
#: ../src/callbacks.c:87 #: ../src/callbacks.c:84
msgid "Font:" msgid "Font:"
msgstr "Police :" msgstr "Police :"
#: ../src/editor.c:59 #: ../src/editor.c:64
msgid "_New" msgid "_New"
msgstr "_Nouveau" msgstr "_Nouveau"
#: ../src/editor.c:61 #: ../src/editor.c:66
msgid "_Open" msgid "_Open"
msgstr "_Ouvrir" msgstr "_Ouvrir"
#: ../src/editor.c:64 #: ../src/editor.c:69
msgid "_Save" msgid "_Save"
msgstr "_Enregistrer" msgstr "_Enregistrer"
#: ../src/editor.c:66 #: ../src/editor.c:71
msgid "_Save as..." msgid "_Save as..."
msgstr "_Enregistrer sous..." msgstr "_Enregistrer sous..."
#: ../src/editor.c:69 #: ../src/editor.c:74
msgid "_Close" msgid "_Close"
msgstr "_Fermer" msgstr "_Fermer"
#: ../src/editor.c:76 #: ../src/editor.c:81
msgid "_Undo" msgid "_Undo"
msgstr "_Annuler" msgstr "_Annuler"
#: ../src/editor.c:78 #: ../src/editor.c:83
msgid "_Redo" msgid "_Redo"
msgstr "_Rétablir" msgstr "_Rétablir"
#: ../src/editor.c:80 #: ../src/editor.c:85
msgid "_Cut" msgid "_Cut"
msgstr "Co_uper" msgstr "Co_uper"
#: ../src/editor.c:81 #: ../src/editor.c:86
msgid "_Copy" msgid "_Copy"
msgstr "_Copier" msgstr "_Copier"
#: ../src/editor.c:82 #: ../src/editor.c:87
msgid "_Paste" msgid "_Paste"
msgstr "C_oller" msgstr "C_oller"
#: ../src/editor.c:84 #: ../src/editor.c:89
msgid "Select _all" msgid "Select _all"
msgstr "Sélectionner _tout" msgstr "Sélectionner _tout"
#: ../src/editor.c:91 #: ../src/editor.c:96
msgid "_Unselect all" msgid "_Unselect all"
msgstr "Tout _désélectionner" msgstr "Tout _désélectionner"
#: ../src/editor.c:93 #: ../src/editor.c:98
msgid "_Find" msgid "_Find"
msgstr "_Rechercher" msgstr "_Rechercher"
#: ../src/editor.c:96 #: ../src/editor.c:101
msgid "_Preferences" msgid "_Preferences"
msgstr "_Préférences" msgstr "_Préférences"
#: ../src/editor.c:103 #: ../src/editor.c:108
msgid "_About" msgid "_About"
msgstr "À _propos" msgstr "À _propos"
#: ../src/editor.c:114 #: ../src/editor.c:119
msgid "_File" msgid "_File"
msgstr "_Fichier" msgstr "_Fichier"
#: ../src/editor.c:115 #: ../src/editor.c:120
msgid "_Edit" msgid "_Edit"
msgstr "É_dition" msgstr "É_dition"
#: ../src/editor.c:116 #: ../src/editor.c:121
msgid "_Help" msgid "_Help"
msgstr "_Aide" msgstr "_Aide"
#: ../src/editor.c:123 #: ../src/editor.c:128
msgid "New" msgid "New"
msgstr "Nouveau" msgstr "Nouveau"
#: ../src/editor.c:124 #: ../src/editor.c:129
msgid "Open" msgid "Open"
msgstr "Ouvrir" msgstr "Ouvrir"
#: ../src/editor.c:126 #: ../src/editor.c:131
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
#: ../src/editor.c:127 #: ../src/editor.c:132
msgid "Save as" msgid "Save as"
msgstr "Enregistrer sous" msgstr "Enregistrer sous"
#: ../src/editor.c:131 #: ../src/editor.c:136
msgid "Preferences" msgid "Preferences"
msgstr "Préférences" msgstr "Préférences"
#: ../src/editor.c:221 #: ../src/editor.c:227
msgid "Text editor - " msgid "Text editor - "
msgstr "Éditeur de texte - " msgstr "Éditeur de texte - "
#: ../src/editor.c:222 #: ../src/editor.c:228
msgid "(Untitled)" msgid "(Untitled)"
msgstr "(Sans titre)" msgstr "(Sans titre)"
#: ../src/editor.c:293 ../src/editor.c:298 #: ../src/editor.c:341
msgid "Could not save configuration"
msgstr "Erreur lors de la sauvegarde de la configuration"
#: ../src/editor.c:355 ../src/editor.c:360
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/editor.c:325 ../src/editor.c:334 ../src/editor.c:444 #: ../src/editor.c:387 ../src/editor.c:396 ../src/editor.c:506
#: ../src/editor.c:458 ../src/editor.c:588 ../src/editor.c:593 #: ../src/editor.c:520 ../src/editor.c:650 ../src/editor.c:655
msgid "Warning" msgid "Warning"
msgstr "Avertissement" msgstr "Avertissement"
#: ../src/editor.c:329 #: ../src/editor.c:391
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to close?" "Are you sure you want to close?"
@ -141,27 +145,27 @@ msgstr ""
"Il y a des modifications non enregistrées.\n" "Il y a des modifications non enregistrées.\n"
"Voulez-vous fermer tout de même ?" "Voulez-vous fermer tout de même ?"
#: ../src/editor.c:364 #: ../src/editor.c:426
msgid "Find text" msgid "Find text"
msgstr "Rechercher" msgstr "Rechercher"
#: ../src/editor.c:371 #: ../src/editor.c:433
msgid "Text:" msgid "Text:"
msgstr "Texte :" msgstr "Texte :"
#: ../src/editor.c:378 #: ../src/editor.c:440
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "Sensible à la casse" msgstr "Sensible à la casse"
#: ../src/editor.c:380 #: ../src/editor.c:442
msgid "Wrap" msgid "Wrap"
msgstr "Boucler" msgstr "Boucler"
#: ../src/editor.c:403 #: ../src/editor.c:465
msgid "Text not found" msgid "Text not found"
msgstr "Texte non trouvé" msgstr "Texte non trouvé"
#: ../src/editor.c:448 #: ../src/editor.c:510
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to discard them?" "Are you sure you want to discard them?"
@ -169,27 +173,27 @@ msgstr ""
"Il y a des changements non enregistrés.\n" "Il y a des changements non enregistrés.\n"
"Êtes-vous sûr de vouloir les annuler ?" "Êtes-vous sûr de vouloir les annuler ?"
#: ../src/editor.c:455 #: ../src/editor.c:517
msgid "Discard" msgid "Discard"
msgstr "Annuler" msgstr "Annuler"
#: ../src/editor.c:514 #: ../src/editor.c:576
msgid "Open file..." msgid "Open file..."
msgstr "Ouvrir un fichier..." msgstr "Ouvrir un fichier..."
#: ../src/editor.c:564 #: ../src/editor.c:626
msgid "Partial write" msgid "Partial write"
msgstr "Écriture partielle" msgstr "Écriture partielle"
#: ../src/editor.c:592 #: ../src/editor.c:654
msgid "File exists. Overwrite?" msgid "File exists. Overwrite?"
msgstr "Le fichier existe. L'écraser ?" msgstr "Le fichier existe. L'écraser ?"
#: ../src/editor.c:601 #: ../src/editor.c:663
msgid "Allocation error" msgid "Allocation error"
msgstr "Erreur d'allocation" msgstr "Erreur d'allocation"
#: ../src/editor.c:616 #: ../src/editor.c:678
msgid "Save as..." msgid "Save as..."
msgstr "Enregistrer sous..." msgstr "Enregistrer sous..."

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Editor 0.1.1\n" "Project-Id-Version: Editor 0.1.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-26 03:39+0200\n" "POT-Creation-Date: 2010-10-26 04:16+0200\n"
"PO-Revision-Date: 2010-04-09 16:43+0200\n" "PO-Revision-Date: 2010-04-09 16:43+0200\n"
"Last-Translator: Pierre Pronchery <khorben@defora.org>\n" "Last-Translator: Pierre Pronchery <khorben@defora.org>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
@ -17,176 +17,180 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../src/callbacks.c:70 #: ../src/callbacks.c:67
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "" msgstr ""
#: ../src/callbacks.c:87 #: ../src/callbacks.c:84
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:59 #: ../src/editor.c:64
msgid "_New" msgid "_New"
msgstr "" msgstr ""
#: ../src/editor.c:61 #: ../src/editor.c:66
msgid "_Open" msgid "_Open"
msgstr "" msgstr ""
#: ../src/editor.c:64 #: ../src/editor.c:69
msgid "_Save" msgid "_Save"
msgstr "" msgstr ""
#: ../src/editor.c:66 #: ../src/editor.c:71
msgid "_Save as..." msgid "_Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:69 #: ../src/editor.c:74
msgid "_Close" msgid "_Close"
msgstr "" msgstr ""
#: ../src/editor.c:76 #: ../src/editor.c:81
msgid "_Undo" msgid "_Undo"
msgstr "" msgstr ""
#: ../src/editor.c:78 #: ../src/editor.c:83
msgid "_Redo" msgid "_Redo"
msgstr "" msgstr ""
#: ../src/editor.c:80 #: ../src/editor.c:85
msgid "_Cut" msgid "_Cut"
msgstr "" msgstr ""
#: ../src/editor.c:81 #: ../src/editor.c:86
msgid "_Copy" msgid "_Copy"
msgstr "" msgstr ""
#: ../src/editor.c:82 #: ../src/editor.c:87
msgid "_Paste" msgid "_Paste"
msgstr "" msgstr ""
#: ../src/editor.c:84 #: ../src/editor.c:89
msgid "Select _all" msgid "Select _all"
msgstr "" msgstr ""
#: ../src/editor.c:91 #: ../src/editor.c:96
msgid "_Unselect all" msgid "_Unselect all"
msgstr "" msgstr ""
#: ../src/editor.c:93 #: ../src/editor.c:98
msgid "_Find" msgid "_Find"
msgstr "" msgstr ""
#: ../src/editor.c:96 #: ../src/editor.c:101
msgid "_Preferences" msgid "_Preferences"
msgstr "" msgstr ""
#: ../src/editor.c:103 #: ../src/editor.c:108
msgid "_About" msgid "_About"
msgstr "" msgstr ""
#: ../src/editor.c:114 #: ../src/editor.c:119
msgid "_File" msgid "_File"
msgstr "" msgstr ""
#: ../src/editor.c:115 #: ../src/editor.c:120
msgid "_Edit" msgid "_Edit"
msgstr "" msgstr ""
#: ../src/editor.c:116 #: ../src/editor.c:121
msgid "_Help" msgid "_Help"
msgstr "" msgstr ""
#: ../src/editor.c:123 #: ../src/editor.c:128
msgid "New" msgid "New"
msgstr "" msgstr ""
#: ../src/editor.c:124 #: ../src/editor.c:129
msgid "Open" msgid "Open"
msgstr "" msgstr ""
#: ../src/editor.c:126 #: ../src/editor.c:131
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: ../src/editor.c:127 #: ../src/editor.c:132
msgid "Save as" msgid "Save as"
msgstr "" msgstr ""
#: ../src/editor.c:131 #: ../src/editor.c:136
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
#: ../src/editor.c:221 #: ../src/editor.c:227
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:222 #: ../src/editor.c:228
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:293 ../src/editor.c:298 #: ../src/editor.c:341
msgid "Could not save configuration"
msgstr ""
#: ../src/editor.c:355 ../src/editor.c:360
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: ../src/editor.c:325 ../src/editor.c:334 ../src/editor.c:444 #: ../src/editor.c:387 ../src/editor.c:396 ../src/editor.c:506
#: ../src/editor.c:458 ../src/editor.c:588 ../src/editor.c:593 #: ../src/editor.c:520 ../src/editor.c:650 ../src/editor.c:655
msgid "Warning" msgid "Warning"
msgstr "" msgstr ""
#: ../src/editor.c:329 #: ../src/editor.c:391
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to close?" "Are you sure you want to close?"
msgstr "" msgstr ""
#: ../src/editor.c:364 #: ../src/editor.c:426
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:371 #: ../src/editor.c:433
msgid "Text:" msgid "Text:"
msgstr "" msgstr ""
#: ../src/editor.c:378 #: ../src/editor.c:440
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:380 #: ../src/editor.c:442
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:403 #: ../src/editor.c:465
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:448 #: ../src/editor.c:510
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Are you sure you want to discard them?" "Are you sure you want to discard them?"
msgstr "" msgstr ""
#: ../src/editor.c:455 #: ../src/editor.c:517
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:514 #: ../src/editor.c:576
msgid "Open file..." msgid "Open file..."
msgstr "" msgstr ""
#: ../src/editor.c:564 #: ../src/editor.c:626
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:592 #: ../src/editor.c:654
msgid "File exists. Overwrite?" msgid "File exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:601 #: ../src/editor.c:663
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:616 #: ../src/editor.c:678
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ CPPFLAGSF= -I $(PREFIX)/include
CPPFLAGS= CPPFLAGS=
CFLAGSF = -W `pkg-config --cflags gtk+-2.0` CFLAGSF = -W `pkg-config --cflags gtk+-2.0`
CFLAGS = -Wall -g -O2 -pedantic CFLAGS = -Wall -g -O2 -pedantic
LDFLAGSF= `pkg-config --libs gtk+-2.0` -lDesktop LDFLAGSF= `pkg-config --libs gtk+-2.0` -lSystem -lDesktop
LDFLAGS = -L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib LDFLAGS = -L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib
RM = rm -f RM = rm -f
LN = ln -f LN = ln -f
@ -24,7 +24,7 @@ editor_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
editor: $(editor_OBJS) editor: $(editor_OBJS)
$(CC) -o editor $(editor_OBJS) $(editor_LDFLAGS) $(CC) -o editor $(editor_OBJS) $(editor_LDFLAGS)
callbacks.o: callbacks.c callbacks.h callbacks.o: callbacks.c editor.h callbacks.h
$(CC) $(editor_CFLAGS) -c callbacks.c $(CC) $(editor_CFLAGS) -c callbacks.c
editor.o: editor.c callbacks.h editor.h ../config.h editor.o: editor.c callbacks.h editor.h ../config.h

View File

@ -53,7 +53,6 @@ static void _preferences_on_ok(gpointer data);
void on_edit_preferences(gpointer data) void on_edit_preferences(gpointer data)
{ {
Editor * editor = data; Editor * editor = data;
PangoFontDescription * desc;
GtkWidget * vbox; GtkWidget * vbox;
GtkWidget * hbox; GtkWidget * hbox;
GtkWidget * widget; GtkWidget * widget;
@ -64,8 +63,6 @@ void on_edit_preferences(gpointer data)
gtk_widget_show(editor->pr_window); gtk_widget_show(editor->pr_window);
return; return;
} }
desc = pango_font_description_new();
pango_font_description_set_weight(desc, PANGO_WEIGHT_BOLD);
editor->pr_window = gtk_dialog_new_with_buttons( editor->pr_window = gtk_dialog_new_with_buttons(
_("Text editor preferences"), _("Text editor preferences"),
GTK_WINDOW(editor->window), GTK_WINDOW(editor->window),
@ -85,7 +82,6 @@ void on_edit_preferences(gpointer data)
group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* font */ /* font */
widget = gtk_label_new(_("Font:")); widget = gtk_label_new(_("Font:"));
gtk_widget_modify_font(widget, desc);
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 4); gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, TRUE, 4);
editor->pr_font = gtk_font_button_new(); editor->pr_font = gtk_font_button_new();
gtk_font_button_set_use_font(GTK_FONT_BUTTON(editor->pr_font), TRUE); gtk_font_button_set_use_font(GTK_FONT_BUTTON(editor->pr_font), TRUE);
@ -99,7 +95,7 @@ void on_edit_preferences(gpointer data)
static void _preferences_set(Editor * editor) static void _preferences_set(Editor * editor)
{ {
gtk_font_button_set_font_name(GTK_FONT_BUTTON(editor->pr_font), gtk_font_button_set_font_name(GTK_FONT_BUTTON(editor->pr_font),
editor->font); editor_get_font(editor));
} }
static gboolean _preferences_on_closex(gpointer data) static gboolean _preferences_on_closex(gpointer data)
@ -136,6 +132,7 @@ static void _preferences_on_ok(gpointer data)
gtk_widget_hide(editor->pr_window); gtk_widget_hide(editor->pr_window);
font = gtk_font_button_get_font_name(GTK_FONT_BUTTON(editor->pr_font)); font = gtk_font_button_get_font_name(GTK_FONT_BUTTON(editor->pr_font));
editor_set_font(editor, font); editor_set_font(editor, font);
editor_config_save(editor);
} }

View File

@ -33,6 +33,11 @@ static char const _license[] =
/* Editor */ /* Editor */
/* private */ /* private */
/* constants */
#define EDITOR_CONFIG_FILE ".editor"
#define EDITOR_DEFAULT_FONT "Monospace 9"
/* variables */ /* variables */
static char const * _authors[] = static char const * _authors[] =
{ {
@ -136,6 +141,7 @@ static DesktopToolbar _editor_toolbar[] =
/* prototypes */ /* prototypes */
static char * _editor_config_filename(void);
static gboolean _editor_find(Editor * editor, char const * text, static gboolean _editor_find(Editor * editor, char const * text,
gboolean sensitive, gboolean wrap); gboolean sensitive, gboolean wrap);
@ -149,20 +155,21 @@ Editor * editor_new(void)
{ {
Editor * editor; Editor * editor;
GtkAccelGroup * group; GtkAccelGroup * group;
GtkSettings * settings;
GtkWidget * vbox; GtkWidget * vbox;
GtkWidget * widget; GtkWidget * widget;
PangoFontDescription * desc; PangoFontDescription * desc;
if((editor = malloc(sizeof(*editor))) == NULL) if((editor = malloc(sizeof(*editor))) == NULL)
return NULL; return NULL;
editor->font = NULL; editor->config = config_new();
settings = gtk_settings_get_default(); if(editor->config == NULL)
g_object_get(G_OBJECT(settings), "gtk-font-name", &editor->font, NULL); {
if(editor->font == NULL) editor_delete(editor);
editor->font = EDITOR_DEFAULT_FONT; return NULL;
}
editor->filename = NULL; editor->filename = NULL;
editor->search = 0; editor->search = 0;
editor_config_load(editor);
/* widgets */ /* widgets */
group = gtk_accel_group_new(); group = gtk_accel_group_new();
editor->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); editor->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
@ -193,8 +200,7 @@ Editor * editor_new(void)
/* FIXME make it an option */ /* FIXME make it an option */
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editor->view), gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(editor->view),
GTK_WRAP_WORD_CHAR); GTK_WRAP_WORD_CHAR);
desc = pango_font_description_from_string(editor->font); desc = pango_font_description_from_string(editor_get_font(editor));
pango_font_description_set_family(desc, "monospace");
editor_set_font(editor, pango_font_description_to_string(desc)); editor_set_font(editor, pango_font_description_to_string(desc));
pango_font_description_free(desc); pango_font_description_free(desc);
gtk_container_add(GTK_CONTAINER(widget), editor->view); gtk_container_add(GTK_CONTAINER(widget), editor->view);
@ -230,19 +236,50 @@ void editor_delete(Editor * editor)
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s()\n", __func__); fprintf(stderr, "DEBUG: %s()\n", __func__);
#endif #endif
if(editor->config != NULL)
config_delete(editor->config);
free(editor); free(editor);
} }
/* accessors */ /* accessors */
/* editor_get_font */
char const * editor_get_font(Editor * editor)
{
char const * p;
char * q;
GtkSettings * settings;
PangoFontDescription * desc;
if((p = config_get(editor->config, NULL, "font")) != NULL)
return p;
settings = gtk_settings_get_default();
g_object_get(G_OBJECT(settings), "gtk-font-name", &q, NULL);
if(q != NULL)
{
desc = pango_font_description_from_string(q);
g_free(q);
pango_font_description_set_family(desc, "monospace");
q = pango_font_description_to_string(desc);
config_set(editor->config, NULL, "font", q);
g_free(q);
pango_font_description_free(desc);
if((p = config_get(editor->config, NULL, "font")) != NULL)
return p;
}
return EDITOR_DEFAULT_FONT;
}
/* editor_set_font */
void editor_set_font(Editor * editor, char const * font) void editor_set_font(Editor * editor, char const * font)
{ {
PangoFontDescription * desc; PangoFontDescription * desc;
editor->font = font;
desc = pango_font_description_from_string(font); desc = pango_font_description_from_string(font);
gtk_widget_modify_font(editor->view, desc); gtk_widget_modify_font(editor->view, desc);
pango_font_description_free(desc); pango_font_description_free(desc);
config_set(editor->config, NULL, "font", font);
} }
@ -281,6 +318,31 @@ static gboolean _about_on_closex(gpointer data)
} }
/* editor_config_load */
void editor_config_load(Editor * editor)
{
char * filename;
if((filename = _editor_config_filename()) == NULL)
return;
config_load(editor->config, filename); /* we can ignore errors */
free(filename);
}
/* editor_config_save */
void editor_config_save(Editor * editor)
{
char * filename;
if((filename = _editor_config_filename()) == NULL)
return;
if(config_save(editor->config, filename) != 0)
editor_error(editor, _("Could not save configuration"), 0);
free(filename);
}
/* editor_error */ /* editor_error */
int editor_error(Editor * editor, char const * message, int ret) int editor_error(Editor * editor, char const * message, int ret)
{ {
@ -664,6 +726,23 @@ void editor_unselect_all(Editor * editor)
/* private */ /* private */
/* functions */ /* functions */
/* editor_config_filename */
static char * _editor_config_filename(void)
{
char const * homedir;
size_t len;
char * filename;
if((homedir = getenv("HOME")) == NULL)
homedir = g_get_home_dir();
len = strlen(homedir) + 1 + sizeof(EDITOR_CONFIG_FILE);
if((filename = malloc(len)) == NULL)
return NULL;
snprintf(filename, len, "%s/%s", homedir, EDITOR_CONFIG_FILE);
return filename;
}
/* editor_find */ /* editor_find */
static char const * _find_string(char const * big, char const * little, static char const * _find_string(char const * big, char const * little,
gboolean sensitive); gboolean sensitive);

View File

@ -18,6 +18,7 @@
#ifndef EDITOR_EDITOR_H #ifndef EDITOR_EDITOR_H
# define EDITOR_EDITOR_H # define EDITOR_EDITOR_H
# include <System.h>
# include <gtk/gtk.h> # include <gtk/gtk.h>
@ -25,10 +26,11 @@
/* types */ /* types */
typedef struct _Editor typedef struct _Editor
{ {
char const * font;
char * filename; char * filename;
size_t search; size_t search;
Config * config;
/* widgets */ /* widgets */
GtkWidget * window; GtkWidget * window;
GtkWidget * view; GtkWidget * view;
@ -46,20 +48,20 @@ typedef struct _Editor
} Editor; } Editor;
/* constants */
# define EDITOR_DEFAULT_FONT "monospace"
/* functions */ /* functions */
Editor * editor_new(void); Editor * editor_new(void);
void editor_delete(Editor * editor); void editor_delete(Editor * editor);
/* accessors */ /* accessors */
char const * editor_get_font(Editor * editor);
void editor_set_font(Editor * editor, char const * font); void editor_set_font(Editor * editor, char const * font);
/* useful */ /* useful */
void editor_about(Editor * editor); void editor_about(Editor * editor);
void editor_config_load(Editor * editor);
void editor_config_save(Editor * editor);
int editor_error(Editor * editor, char const * message, int ret); int editor_error(Editor * editor, char const * message, int ret);
gboolean editor_close(Editor * editor); gboolean editor_close(Editor * editor);

View File

@ -3,7 +3,7 @@ cppflags_force=-I $(PREFIX)/include
#cppflags=-D EMBEDDED #cppflags=-D EMBEDDED
cflags_force=-W `pkg-config --cflags gtk+-2.0` cflags_force=-W `pkg-config --cflags gtk+-2.0`
cflags=-Wall -g -O2 -pedantic cflags=-Wall -g -O2 -pedantic
ldflags_force=`pkg-config --libs gtk+-2.0` -lDesktop ldflags_force=`pkg-config --libs gtk+-2.0` -lSystem -lDesktop
ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib ldflags=-L $(PREFIX)/lib -Wl,-rpath,$(PREFIX)/lib
dist=Makefile,callbacks.h,editor.h dist=Makefile,callbacks.h,editor.h
@ -13,7 +13,7 @@ sources=callbacks.c,editor.c,main.c
install=$(BINDIR) install=$(BINDIR)
[callbacks.c] [callbacks.c]
depends=callbacks.h depends=editor.h,callbacks.h
[editor.c] [editor.c]
depends=callbacks.h,editor.h,../config.h depends=callbacks.h,editor.h,../config.h