Code cleanup

This commit is contained in:
Pierre Pronchery 2011-06-27 01:46:43 +00:00
parent 777c2e25c7
commit 6c0ad9e1c7
5 changed files with 102 additions and 105 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: 2011-05-27 16:36+0200\n" "POT-Creation-Date: 2011-06-27 03:46+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"
@ -136,100 +136,100 @@ msgstr ""
msgid "words then characters" msgid "words then characters"
msgstr "" msgstr ""
#: ../src/editor.c:271 #: ../src/editor.c:268
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:272 #: ../src/editor.c:269
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:419 #: ../src/editor.c:416
msgid "Could not save configuration" msgid "Could not save configuration"
msgstr "" msgstr ""
#: ../src/editor.c:433 ../src/editor.c:438 #: ../src/editor.c:430 ../src/editor.c:435
msgid "Error" msgid "Error"
msgstr "Fehler" msgstr "Fehler"
#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 #: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614
#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 #: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782
msgid "Warning" msgid "Warning"
msgstr "Achtung" msgstr "Achtung"
#: ../src/editor.c:469 #: ../src/editor.c:466
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Discard or save them?" "Discard or save them?"
msgstr "" msgstr ""
#: ../src/editor.c:533 #: ../src/editor.c:530
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:544 #: ../src/editor.c:541
msgid "Text:" msgid "Text:"
msgstr "Text:" msgstr "Text:"
#: ../src/editor.c:551 #: ../src/editor.c:548
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:553 #: ../src/editor.c:550
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:576 #: ../src/editor.c:573
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:621 #: ../src/editor.c:618
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:628 #: ../src/editor.c:625
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:688 #: ../src/editor.c:685
msgid "Open file..." msgid "Open file..."
msgstr "Offnen..." msgstr "Offnen..."
#: ../src/editor.c:694 #: ../src/editor.c:691
msgid "Text files" msgid "Text files"
msgstr "" msgstr ""
#: ../src/editor.c:698 #: ../src/editor.c:695
msgid "All files" msgid "All files"
msgstr "" msgstr ""
#: ../src/editor.c:756 #: ../src/editor.c:753
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:784 #: ../src/editor.c:781
msgid "This file already exists. Overwrite?" msgid "This file already exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:793 #: ../src/editor.c:790
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:808 #: ../src/editor.c:805
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:865 #: ../src/editor.c:862
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "Text Editor Einstellungen" msgstr "Text Editor Einstellungen"
#: ../src/editor.c:882 #: ../src/editor.c:879
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:892 #: ../src/editor.c:889
msgid "Wrap mode:" msgid "Wrap mode:"
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: 2011-05-27 16:36+0200\n" "POT-Creation-Date: 2011-06-27 03:46+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"
@ -136,100 +136,100 @@ msgstr ""
msgid "words then characters" msgid "words then characters"
msgstr "" msgstr ""
#: ../src/editor.c:271 #: ../src/editor.c:268
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:272 #: ../src/editor.c:269
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:419 #: ../src/editor.c:416
msgid "Could not save configuration" msgid "Could not save configuration"
msgstr "" msgstr ""
#: ../src/editor.c:433 ../src/editor.c:438 #: ../src/editor.c:430 ../src/editor.c:435
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 #: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614
#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 #: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782
msgid "Warning" msgid "Warning"
msgstr "" msgstr ""
#: ../src/editor.c:469 #: ../src/editor.c:466
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Discard or save them?" "Discard or save them?"
msgstr "" msgstr ""
#: ../src/editor.c:533 #: ../src/editor.c:530
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:544 #: ../src/editor.c:541
msgid "Text:" msgid "Text:"
msgstr "" msgstr ""
#: ../src/editor.c:551 #: ../src/editor.c:548
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:553 #: ../src/editor.c:550
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:576 #: ../src/editor.c:573
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:621 #: ../src/editor.c:618
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:628 #: ../src/editor.c:625
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:688 #: ../src/editor.c:685
msgid "Open file..." msgid "Open file..."
msgstr "" msgstr ""
#: ../src/editor.c:694 #: ../src/editor.c:691
msgid "Text files" msgid "Text files"
msgstr "" msgstr ""
#: ../src/editor.c:698 #: ../src/editor.c:695
msgid "All files" msgid "All files"
msgstr "" msgstr ""
#: ../src/editor.c:756 #: ../src/editor.c:753
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:784 #: ../src/editor.c:781
msgid "This file already exists. Overwrite?" msgid "This file already exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:793 #: ../src/editor.c:790
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:808 #: ../src/editor.c:805
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:865 #: ../src/editor.c:862
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "" msgstr ""
#: ../src/editor.c:882 #: ../src/editor.c:879
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:892 #: ../src/editor.c:889
msgid "Wrap mode:" msgid "Wrap mode:"
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: 2011-05-27 16:36+0200\n" "POT-Creation-Date: 2011-06-27 03:46+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"
@ -136,28 +136,28 @@ msgstr "mots"
msgid "words then characters" msgid "words then characters"
msgstr "mots puis caractères" msgstr "mots puis caractères"
#: ../src/editor.c:271 #: ../src/editor.c:268
msgid "Text editor - " msgid "Text editor - "
msgstr "Éditeur de texte - " msgstr "Éditeur de texte - "
#: ../src/editor.c:272 #: ../src/editor.c:269
msgid "(Untitled)" msgid "(Untitled)"
msgstr "(Sans titre)" msgstr "(Sans titre)"
#: ../src/editor.c:419 #: ../src/editor.c:416
msgid "Could not save configuration" msgid "Could not save configuration"
msgstr "Erreur lors de la sauvegarde de la configuration" msgstr "Erreur lors de la sauvegarde de la configuration"
#: ../src/editor.c:433 ../src/editor.c:438 #: ../src/editor.c:430 ../src/editor.c:435
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 #: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614
#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 #: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782
msgid "Warning" msgid "Warning"
msgstr "Avertissement" msgstr "Avertissement"
#: ../src/editor.c:469 #: ../src/editor.c:466
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Discard or save them?" "Discard or save them?"
@ -165,27 +165,27 @@ msgstr ""
"Il y a des changements non enregistrés.\n" "Il y a des changements non enregistrés.\n"
"Ignorer ou sauvegarder ?" "Ignorer ou sauvegarder ?"
#: ../src/editor.c:533 #: ../src/editor.c:530
msgid "Find text" msgid "Find text"
msgstr "Rechercher" msgstr "Rechercher"
#: ../src/editor.c:544 #: ../src/editor.c:541
msgid "Text:" msgid "Text:"
msgstr "Texte :" msgstr "Texte :"
#: ../src/editor.c:551 #: ../src/editor.c:548
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "Sensible à la casse" msgstr "Sensible à la casse"
#: ../src/editor.c:553 #: ../src/editor.c:550
msgid "Wrap" msgid "Wrap"
msgstr "Boucler" msgstr "Boucler"
#: ../src/editor.c:576 #: ../src/editor.c:573
msgid "Text not found" msgid "Text not found"
msgstr "Texte non trouvé" msgstr "Texte non trouvé"
#: ../src/editor.c:621 #: ../src/editor.c:618
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?"
@ -193,47 +193,47 @@ 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:628 #: ../src/editor.c:625
msgid "Discard" msgid "Discard"
msgstr "Annuler" msgstr "Annuler"
#: ../src/editor.c:688 #: ../src/editor.c:685
msgid "Open file..." msgid "Open file..."
msgstr "Ouvrir un fichier..." msgstr "Ouvrir un fichier..."
#: ../src/editor.c:694 #: ../src/editor.c:691
msgid "Text files" msgid "Text files"
msgstr "Fichiers texte" msgstr "Fichiers texte"
#: ../src/editor.c:698 #: ../src/editor.c:695
msgid "All files" msgid "All files"
msgstr "Tous les fichiers" msgstr "Tous les fichiers"
#: ../src/editor.c:756 #: ../src/editor.c:753
msgid "Partial write" msgid "Partial write"
msgstr "Écriture partielle" msgstr "Écriture partielle"
#: ../src/editor.c:784 #: ../src/editor.c:781
msgid "This file already exists. Overwrite?" msgid "This file already exists. Overwrite?"
msgstr "Le fichier existe déjà. L'écraser ?" msgstr "Le fichier existe déjà. L'écraser ?"
#: ../src/editor.c:793 #: ../src/editor.c:790
msgid "Allocation error" msgid "Allocation error"
msgstr "Erreur d'allocation" msgstr "Erreur d'allocation"
#: ../src/editor.c:808 #: ../src/editor.c:805
msgid "Save as..." msgid "Save as..."
msgstr "Enregistrer sous..." msgstr "Enregistrer sous..."
#: ../src/editor.c:865 #: ../src/editor.c:862
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/editor.c:882 #: ../src/editor.c:879
msgid "Font:" msgid "Font:"
msgstr "Police :" msgstr "Police :"
#: ../src/editor.c:892 #: ../src/editor.c:889
msgid "Wrap mode:" msgid "Wrap mode:"
msgstr "Retour à la ligne :" msgstr "Retour à la ligne :"

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: 2011-05-27 16:36+0200\n" "POT-Creation-Date: 2011-06-27 03:46+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"
@ -137,100 +137,100 @@ msgstr ""
msgid "words then characters" msgid "words then characters"
msgstr "" msgstr ""
#: ../src/editor.c:271 #: ../src/editor.c:268
msgid "Text editor - " msgid "Text editor - "
msgstr "" msgstr ""
#: ../src/editor.c:272 #: ../src/editor.c:269
msgid "(Untitled)" msgid "(Untitled)"
msgstr "" msgstr ""
#: ../src/editor.c:419 #: ../src/editor.c:416
msgid "Could not save configuration" msgid "Could not save configuration"
msgstr "" msgstr ""
#: ../src/editor.c:433 ../src/editor.c:438 #: ../src/editor.c:430 ../src/editor.c:435
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 #: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614
#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 #: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782
msgid "Warning" msgid "Warning"
msgstr "" msgstr ""
#: ../src/editor.c:469 #: ../src/editor.c:466
msgid "" msgid ""
"There are unsaved changes.\n" "There are unsaved changes.\n"
"Discard or save them?" "Discard or save them?"
msgstr "" msgstr ""
#: ../src/editor.c:533 #: ../src/editor.c:530
msgid "Find text" msgid "Find text"
msgstr "" msgstr ""
#: ../src/editor.c:544 #: ../src/editor.c:541
msgid "Text:" msgid "Text:"
msgstr "" msgstr ""
#: ../src/editor.c:551 #: ../src/editor.c:548
msgid "Case-sensitive" msgid "Case-sensitive"
msgstr "" msgstr ""
#: ../src/editor.c:553 #: ../src/editor.c:550
msgid "Wrap" msgid "Wrap"
msgstr "" msgstr ""
#: ../src/editor.c:576 #: ../src/editor.c:573
msgid "Text not found" msgid "Text not found"
msgstr "" msgstr ""
#: ../src/editor.c:621 #: ../src/editor.c:618
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:628 #: ../src/editor.c:625
msgid "Discard" msgid "Discard"
msgstr "" msgstr ""
#: ../src/editor.c:688 #: ../src/editor.c:685
msgid "Open file..." msgid "Open file..."
msgstr "" msgstr ""
#: ../src/editor.c:694 #: ../src/editor.c:691
msgid "Text files" msgid "Text files"
msgstr "" msgstr ""
#: ../src/editor.c:698 #: ../src/editor.c:695
msgid "All files" msgid "All files"
msgstr "" msgstr ""
#: ../src/editor.c:756 #: ../src/editor.c:753
msgid "Partial write" msgid "Partial write"
msgstr "" msgstr ""
#: ../src/editor.c:784 #: ../src/editor.c:781
msgid "This file already exists. Overwrite?" msgid "This file already exists. Overwrite?"
msgstr "" msgstr ""
#: ../src/editor.c:793 #: ../src/editor.c:790
msgid "Allocation error" msgid "Allocation error"
msgstr "" msgstr ""
#: ../src/editor.c:808 #: ../src/editor.c:805
msgid "Save as..." msgid "Save as..."
msgstr "" msgstr ""
#: ../src/editor.c:865 #: ../src/editor.c:862
msgid "Text editor preferences" msgid "Text editor preferences"
msgstr "" msgstr ""
#: ../src/editor.c:882 #: ../src/editor.c:879
msgid "Font:" msgid "Font:"
msgstr "" msgstr ""
#: ../src/editor.c:892 #: ../src/editor.c:889
msgid "Wrap mode:" msgid "Wrap mode:"
msgstr "" msgstr ""

View File

@ -203,7 +203,6 @@ Editor * editor_new(void)
GtkAccelGroup * group; GtkAccelGroup * group;
GtkWidget * vbox; GtkWidget * vbox;
GtkWidget * widget; GtkWidget * widget;
PangoFontDescription * desc;
if((editor = malloc(sizeof(*editor))) == NULL) if((editor = malloc(sizeof(*editor))) == NULL)
return NULL; return NULL;
@ -243,15 +242,13 @@ Editor * editor_new(void)
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget), gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
editor->view = gtk_text_view_new(); editor->view = gtk_text_view_new();
desc = pango_font_description_from_string(editor_get_font(editor)); editor_set_font(editor, editor_get_font(editor));
editor_set_font(editor, pango_font_description_to_string(desc));
editor_set_wrap_mode(editor, editor_get_wrap_mode(editor)); editor_set_wrap_mode(editor, editor_get_wrap_mode(editor));
pango_font_description_free(desc);
gtk_container_add(GTK_CONTAINER(widget), editor->view); gtk_container_add(GTK_CONTAINER(widget), editor->view);
gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
/* statusbar */ /* statusbar */
editor->statusbar = gtk_statusbar_new(); editor->statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(vbox), editor->statusbar, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), editor->statusbar, FALSE, TRUE, 0);
/* preferences */ /* preferences */
editor->pr_window = NULL; editor->pr_window = NULL;
/* find */ /* find */