From 6c0ad9e1c78d5ad16ccdda51d25e0ab1e8e1ae9a Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 27 Jun 2011 01:46:43 +0000 Subject: [PATCH] Code cleanup --- po/de.po | 50 +++++++++++++++++++++++++------------------------- po/es.po | 50 +++++++++++++++++++++++++------------------------- po/fr.po | 50 +++++++++++++++++++++++++------------------------- po/it.po | 50 +++++++++++++++++++++++++------------------------- src/editor.c | 7 ++----- 5 files changed, 102 insertions(+), 105 deletions(-) diff --git a/po/de.po b/po/de.po index 9f5f312..adf5351 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-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" "Last-Translator: Pierre Pronchery \n" "Language-Team: German\n" @@ -136,100 +136,100 @@ msgstr "" msgid "words then characters" msgstr "" -#: ../src/editor.c:271 +#: ../src/editor.c:268 msgid "Text editor - " msgstr "" -#: ../src/editor.c:272 +#: ../src/editor.c:269 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:419 +#: ../src/editor.c:416 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:433 ../src/editor.c:438 +#: ../src/editor.c:430 ../src/editor.c:435 msgid "Error" msgstr "Fehler" -#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 -#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 +#: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614 +#: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782 msgid "Warning" msgstr "Achtung" -#: ../src/editor.c:469 +#: ../src/editor.c:466 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:533 +#: ../src/editor.c:530 msgid "Find text" msgstr "" -#: ../src/editor.c:544 +#: ../src/editor.c:541 msgid "Text:" msgstr "Text:" -#: ../src/editor.c:551 +#: ../src/editor.c:548 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:553 +#: ../src/editor.c:550 msgid "Wrap" msgstr "" -#: ../src/editor.c:576 +#: ../src/editor.c:573 msgid "Text not found" msgstr "" -#: ../src/editor.c:621 +#: ../src/editor.c:618 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:628 +#: ../src/editor.c:625 msgid "Discard" msgstr "" -#: ../src/editor.c:688 +#: ../src/editor.c:685 msgid "Open file..." msgstr "Offnen..." -#: ../src/editor.c:694 +#: ../src/editor.c:691 msgid "Text files" msgstr "" -#: ../src/editor.c:698 +#: ../src/editor.c:695 msgid "All files" msgstr "" -#: ../src/editor.c:756 +#: ../src/editor.c:753 msgid "Partial write" msgstr "" -#: ../src/editor.c:784 +#: ../src/editor.c:781 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:793 +#: ../src/editor.c:790 msgid "Allocation error" msgstr "" -#: ../src/editor.c:808 +#: ../src/editor.c:805 msgid "Save as..." msgstr "" -#: ../src/editor.c:865 +#: ../src/editor.c:862 msgid "Text editor preferences" msgstr "Text Editor Einstellungen" -#: ../src/editor.c:882 +#: ../src/editor.c:879 msgid "Font:" msgstr "" -#: ../src/editor.c:892 +#: ../src/editor.c:889 msgid "Wrap mode:" msgstr "" diff --git a/po/es.po b/po/es.po index f96b37a..fba94ba 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-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" "Last-Translator: Pierre Pronchery \n" "Language-Team: Spanish\n" @@ -136,100 +136,100 @@ msgstr "" msgid "words then characters" msgstr "" -#: ../src/editor.c:271 +#: ../src/editor.c:268 msgid "Text editor - " msgstr "" -#: ../src/editor.c:272 +#: ../src/editor.c:269 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:419 +#: ../src/editor.c:416 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:433 ../src/editor.c:438 +#: ../src/editor.c:430 ../src/editor.c:435 msgid "Error" msgstr "" -#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 -#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 +#: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614 +#: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782 msgid "Warning" msgstr "" -#: ../src/editor.c:469 +#: ../src/editor.c:466 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:533 +#: ../src/editor.c:530 msgid "Find text" msgstr "" -#: ../src/editor.c:544 +#: ../src/editor.c:541 msgid "Text:" msgstr "" -#: ../src/editor.c:551 +#: ../src/editor.c:548 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:553 +#: ../src/editor.c:550 msgid "Wrap" msgstr "" -#: ../src/editor.c:576 +#: ../src/editor.c:573 msgid "Text not found" msgstr "" -#: ../src/editor.c:621 +#: ../src/editor.c:618 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:628 +#: ../src/editor.c:625 msgid "Discard" msgstr "" -#: ../src/editor.c:688 +#: ../src/editor.c:685 msgid "Open file..." msgstr "" -#: ../src/editor.c:694 +#: ../src/editor.c:691 msgid "Text files" msgstr "" -#: ../src/editor.c:698 +#: ../src/editor.c:695 msgid "All files" msgstr "" -#: ../src/editor.c:756 +#: ../src/editor.c:753 msgid "Partial write" msgstr "" -#: ../src/editor.c:784 +#: ../src/editor.c:781 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:793 +#: ../src/editor.c:790 msgid "Allocation error" msgstr "" -#: ../src/editor.c:808 +#: ../src/editor.c:805 msgid "Save as..." msgstr "" -#: ../src/editor.c:865 +#: ../src/editor.c:862 msgid "Text editor preferences" msgstr "" -#: ../src/editor.c:882 +#: ../src/editor.c:879 msgid "Font:" msgstr "" -#: ../src/editor.c:892 +#: ../src/editor.c:889 msgid "Wrap mode:" msgstr "" diff --git a/po/fr.po b/po/fr.po index c2ef171..fde60ef 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-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" "Last-Translator: Calimero \n" "Language-Team: French\n" @@ -136,28 +136,28 @@ msgstr "mots" msgid "words then characters" msgstr "mots puis caractères" -#: ../src/editor.c:271 +#: ../src/editor.c:268 msgid "Text editor - " msgstr "Éditeur de texte - " -#: ../src/editor.c:272 +#: ../src/editor.c:269 msgid "(Untitled)" msgstr "(Sans titre)" -#: ../src/editor.c:419 +#: ../src/editor.c:416 msgid "Could not save 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" msgstr "Erreur" -#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 -#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 +#: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614 +#: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782 msgid "Warning" msgstr "Avertissement" -#: ../src/editor.c:469 +#: ../src/editor.c:466 msgid "" "There are unsaved changes.\n" "Discard or save them?" @@ -165,27 +165,27 @@ msgstr "" "Il y a des changements non enregistrés.\n" "Ignorer ou sauvegarder ?" -#: ../src/editor.c:533 +#: ../src/editor.c:530 msgid "Find text" msgstr "Rechercher" -#: ../src/editor.c:544 +#: ../src/editor.c:541 msgid "Text:" msgstr "Texte :" -#: ../src/editor.c:551 +#: ../src/editor.c:548 msgid "Case-sensitive" msgstr "Sensible à la casse" -#: ../src/editor.c:553 +#: ../src/editor.c:550 msgid "Wrap" msgstr "Boucler" -#: ../src/editor.c:576 +#: ../src/editor.c:573 msgid "Text not found" msgstr "Texte non trouvé" -#: ../src/editor.c:621 +#: ../src/editor.c:618 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" @@ -193,47 +193,47 @@ msgstr "" "Il y a des changements non enregistrés.\n" "Êtes-vous sûr de vouloir les annuler ?" -#: ../src/editor.c:628 +#: ../src/editor.c:625 msgid "Discard" msgstr "Annuler" -#: ../src/editor.c:688 +#: ../src/editor.c:685 msgid "Open file..." msgstr "Ouvrir un fichier..." -#: ../src/editor.c:694 +#: ../src/editor.c:691 msgid "Text files" msgstr "Fichiers texte" -#: ../src/editor.c:698 +#: ../src/editor.c:695 msgid "All files" msgstr "Tous les fichiers" -#: ../src/editor.c:756 +#: ../src/editor.c:753 msgid "Partial write" msgstr "Écriture partielle" -#: ../src/editor.c:784 +#: ../src/editor.c:781 msgid "This file already exists. Overwrite?" msgstr "Le fichier existe déjà. L'écraser ?" -#: ../src/editor.c:793 +#: ../src/editor.c:790 msgid "Allocation error" msgstr "Erreur d'allocation" -#: ../src/editor.c:808 +#: ../src/editor.c:805 msgid "Save as..." msgstr "Enregistrer sous..." -#: ../src/editor.c:865 +#: ../src/editor.c:862 msgid "Text editor preferences" msgstr "Préférences de l'éditeur de texte" -#: ../src/editor.c:882 +#: ../src/editor.c:879 msgid "Font:" msgstr "Police :" -#: ../src/editor.c:892 +#: ../src/editor.c:889 msgid "Wrap mode:" msgstr "Retour à la ligne :" diff --git a/po/it.po b/po/it.po index 3c80f42..bfe4650 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-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" "Last-Translator: Pierre Pronchery \n" "Language-Team: Italian\n" @@ -137,100 +137,100 @@ msgstr "" msgid "words then characters" msgstr "" -#: ../src/editor.c:271 +#: ../src/editor.c:268 msgid "Text editor - " msgstr "" -#: ../src/editor.c:272 +#: ../src/editor.c:269 msgid "(Untitled)" msgstr "" -#: ../src/editor.c:419 +#: ../src/editor.c:416 msgid "Could not save configuration" msgstr "" -#: ../src/editor.c:433 ../src/editor.c:438 +#: ../src/editor.c:430 ../src/editor.c:435 msgid "Error" msgstr "" -#: ../src/editor.c:465 ../src/editor.c:475 ../src/editor.c:617 -#: ../src/editor.c:631 ../src/editor.c:780 ../src/editor.c:785 +#: ../src/editor.c:462 ../src/editor.c:472 ../src/editor.c:614 +#: ../src/editor.c:628 ../src/editor.c:777 ../src/editor.c:782 msgid "Warning" msgstr "" -#: ../src/editor.c:469 +#: ../src/editor.c:466 msgid "" "There are unsaved changes.\n" "Discard or save them?" msgstr "" -#: ../src/editor.c:533 +#: ../src/editor.c:530 msgid "Find text" msgstr "" -#: ../src/editor.c:544 +#: ../src/editor.c:541 msgid "Text:" msgstr "" -#: ../src/editor.c:551 +#: ../src/editor.c:548 msgid "Case-sensitive" msgstr "" -#: ../src/editor.c:553 +#: ../src/editor.c:550 msgid "Wrap" msgstr "" -#: ../src/editor.c:576 +#: ../src/editor.c:573 msgid "Text not found" msgstr "" -#: ../src/editor.c:621 +#: ../src/editor.c:618 msgid "" "There are unsaved changes.\n" "Are you sure you want to discard them?" msgstr "" -#: ../src/editor.c:628 +#: ../src/editor.c:625 msgid "Discard" msgstr "" -#: ../src/editor.c:688 +#: ../src/editor.c:685 msgid "Open file..." msgstr "" -#: ../src/editor.c:694 +#: ../src/editor.c:691 msgid "Text files" msgstr "" -#: ../src/editor.c:698 +#: ../src/editor.c:695 msgid "All files" msgstr "" -#: ../src/editor.c:756 +#: ../src/editor.c:753 msgid "Partial write" msgstr "" -#: ../src/editor.c:784 +#: ../src/editor.c:781 msgid "This file already exists. Overwrite?" msgstr "" -#: ../src/editor.c:793 +#: ../src/editor.c:790 msgid "Allocation error" msgstr "" -#: ../src/editor.c:808 +#: ../src/editor.c:805 msgid "Save as..." msgstr "" -#: ../src/editor.c:865 +#: ../src/editor.c:862 msgid "Text editor preferences" msgstr "" -#: ../src/editor.c:882 +#: ../src/editor.c:879 msgid "Font:" msgstr "" -#: ../src/editor.c:892 +#: ../src/editor.c:889 msgid "Wrap mode:" msgstr "" diff --git a/src/editor.c b/src/editor.c index bfbfc1a..b0d2e61 100644 --- a/src/editor.c +++ b/src/editor.c @@ -203,7 +203,6 @@ Editor * editor_new(void) GtkAccelGroup * group; GtkWidget * vbox; GtkWidget * widget; - PangoFontDescription * desc; if((editor = malloc(sizeof(*editor))) == NULL) return NULL; @@ -243,15 +242,13 @@ 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(); - desc = pango_font_description_from_string(editor_get_font(editor)); - editor_set_font(editor, pango_font_description_to_string(desc)); + editor_set_font(editor, editor_get_font(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_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0); /* statusbar */ 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 */ editor->pr_window = NULL; /* find */