From fb1250dd639f2f9b69f146098a5aafc8b0e6c96c Mon Sep 17 00:00:00 2001 From: Cactus64k Date: Tue, 21 Apr 2015 13:11:21 +0300 Subject: [PATCH] Fix about dialog, translations and bug who found EXL --- intl/en_US.po | 59 ++++++++++++++++++++----------------- intl/ru.po | 59 ++++++++++++++++++++----------------- intl/simple-fb2-reader.pot | 47 +++++++++++++++-------------- res/simple-fb2-reader.glade | 26 +++++++++++----- src/init/init_dialogs.c | 43 +++++++++++++++------------ 5 files changed, 132 insertions(+), 102 deletions(-) diff --git a/intl/en_US.po b/intl/en_US.po index 9ce5008..b4d36cd 100644 --- a/intl/en_US.po +++ b/intl/en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" -"POT-Creation-Date: 2015-04-05 18:09+0300\n" -"PO-Revision-Date: 2015-04-05 18:09+0300\n" +"POT-Creation-Date: 2015-04-21 13:09+0300\n" +"PO-Revision-Date: 2015-04-21 13:09+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" "Language: en_US\n" @@ -17,38 +17,42 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: ../res/simple-fb2-reader.glade:64 +#: ../res/simple-fb2-reader.glade:66 msgid "Forget all books position and endodings?" msgstr "Forget all books position and endodings?" -#: ../res/simple-fb2-reader.glade:65 +#: ../res/simple-fb2-reader.glade:67 msgid "without the possibility of restoration" msgstr "without the possibility of restoration" -#: ../res/simple-fb2-reader.glade:128 +#: ../res/simple-fb2-reader.glade:154 msgid "" -"ctrl+f\tsearch\n" -"ctrl+c\tcopy selected text\n" -"ctrl+m3 \tfont scale\n" "\n" -"Have nice reading!\n" +"ctrl + f\t\t\t\t\tsearch\n" +"ctrl + c\t\t\t\t\tcopy selected text\n" +"ctrl + mouse-wheel \t\tfont scale\n" +"left-arrow\t\t\t\t\tlink backward\n" +"\n" +"\t\t\tHave nice reading!\n" msgstr "" -"ctrl+f\tsearch\n" -"ctrl+c\tcopy selected text\n" -"ctrl+m3 \tfont scale\n" "\n" -"Have nice reading!\n" +"ctrl + f\t\t\t\t\tsearch\n" +"ctrl + c\t\t\t\t\tcopy selected text\n" +"ctrl + mouse-wheel \t\tfont scale\n" +"left-arrow\t\t\t\t\tlink backward\n" +"\n" +"\t\t\tHave nice reading!\n" -#: ../res/simple-fb2-reader.glade:229 +#: ../res/simple-fb2-reader.glade:244 #: ../src/callbacks/text_view_callback/popup_menu_callback.c:14 msgid "Backward" msgstr "Backward" -#: ../res/simple-fb2-reader.glade:246 +#: ../res/simple-fb2-reader.glade:261 msgid "Forward" msgstr "Forward" -#: ../res/simple-fb2-reader.glade:287 +#: ../res/simple-fb2-reader.glade:302 msgid "Case ensitive" msgstr "Case ensitive" @@ -108,41 +112,42 @@ msgstr "End read book\n" msgid "ERROR: Failed to parsing fb2 file: %s\n" msgstr "ERROR: Failed to parsing fb2 file: %s\n" -#: ../src/fb2/FictionBook/body/section/image_inline.c:29 -#: ../src/fb2/FictionBook/body/image.c:32 +#: ../src/fb2/FictionBook/body/section/image_inline.c:28 +#: ../src/fb2/FictionBook/body/image.c:38 #, c-format msgid "Image %s not found in table\n" msgstr "Image %s not found in table\n" -#: ../src/fb2/FictionBook/body/section/image_inline.c:32 -#: ../src/fb2/FictionBook/body/image.c:35 +#: ../src/fb2/FictionBook/body/section/image_inline.c:31 +#: ../src/fb2/FictionBook/body/image.c:41 msgid "Not local links not supported\n" msgstr "Not local links not supported\n" -#: ../src/fb2/FictionBook/body/section.c:18 ../src/fb2/FictionBook/body.c:15 +#: ../src/fb2/FictionBook/body/section/section.c:18 +#: ../src/fb2/FictionBook/body/body.c:15 msgid "No Title" msgstr "No Title" -#: ../src/fb2/FictionBook/attributes/id.c:26 +#: ../src/fb2/FictionBook/attributes/id.c:22 #, c-format msgid "ERROR: id %s already exist in table\n" msgstr "ERROR: id %s already exist in table\n" -#: ../src/fb2/FictionBook/binary/binary.c:42 +#: ../src/fb2/FictionBook/binary/binary.c:34 msgid "ERROR: no content in tag\n" msgstr "ERROR: no content in tag\n" -#: ../src/fb2/FictionBook/binary/binary.c:45 +#: ../src/fb2/FictionBook/binary/binary.c:37 #, c-format msgid "ERROR: image %s already exist in table\n" msgstr "ERROR: image %s already exist in table\n" -#: ../src/fb2/FictionBook/binary/binary.c:49 +#: ../src/fb2/FictionBook/binary/binary.c:40 msgid "ERROR: no id properties in tag\n" msgstr "ERROR: no id properties in tag\n" -#: ../src/fb2/FictionBook/binary/binary.c:81 -#: ../src/fb2/FictionBook/binary/binary.c:97 +#: ../src/fb2/FictionBook/binary/binary.c:72 +#: ../src/fb2/FictionBook/binary/binary.c:88 #, c-format msgid "ERROR: GdkPixbufLoader: %s\n" msgstr "ERROR: GdkPixbufLoader: %s\n" diff --git a/intl/ru.po b/intl/ru.po index facf798..c5d9f61 100644 --- a/intl/ru.po +++ b/intl/ru.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" -"POT-Creation-Date: 2015-04-05 18:09+0300\n" +"POT-Creation-Date: 2015-04-21 13:09+0300\n" "PO-Revision-Date: 2015-03-30 18:11+0300\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -19,38 +19,42 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: ../res/simple-fb2-reader.glade:64 +#: ../res/simple-fb2-reader.glade:66 msgid "Forget all books position and endodings?" msgstr "Забыть все позиции чтения и кодировки книг?" -#: ../res/simple-fb2-reader.glade:65 +#: ../res/simple-fb2-reader.glade:67 msgid "without the possibility of restoration" msgstr "Без возможности востановления" -#: ../res/simple-fb2-reader.glade:128 +#: ../res/simple-fb2-reader.glade:154 msgid "" -"ctrl+f\tsearch\n" -"ctrl+c\tcopy selected text\n" -"ctrl+m3 \tfont scale\n" "\n" -"Have nice reading!\n" +"ctrl + f\t\t\t\t\tsearch\n" +"ctrl + c\t\t\t\t\tcopy selected text\n" +"ctrl + mouse-wheel \t\tfont scale\n" +"left-arrow\t\t\t\t\tlink backward\n" +"\n" +"\t\t\tHave nice reading!\n" msgstr "" -"ctrl+f\tПоиск\n" -"ctrl+c\tКопирование выделенного текста\n" -"ctrl+m3 \tРазмер шрифта\n" "\n" -"Приятного чтения!\n" +"ctrl + f\t\t\t\t\tПоиск\n" +"ctrl + c\t\t\t\t\tКопирование выделенного текста\n" +"ctrl + mouse-wheel \t\tРазмер шрифта\n" +"left-arrow\t\t\t\t\tПереход назад по ссылке\n" +"\n" +"\t\t\tПриятного чтения!\n" -#: ../res/simple-fb2-reader.glade:229 +#: ../res/simple-fb2-reader.glade:244 #: ../src/callbacks/text_view_callback/popup_menu_callback.c:14 msgid "Backward" msgstr "Назад" -#: ../res/simple-fb2-reader.glade:246 +#: ../res/simple-fb2-reader.glade:261 msgid "Forward" msgstr "Вперед" -#: ../res/simple-fb2-reader.glade:287 +#: ../res/simple-fb2-reader.glade:302 msgid "Case ensitive" msgstr "С учетом регистра" @@ -110,41 +114,42 @@ msgstr "Окончание чтения книги\n" msgid "ERROR: Failed to parsing fb2 file: %s\n" msgstr "ОШИБКА: не удалось разобрать fb2 файл: %s\n" -#: ../src/fb2/FictionBook/body/section/image_inline.c:29 -#: ../src/fb2/FictionBook/body/image.c:32 +#: ../src/fb2/FictionBook/body/section/image_inline.c:28 +#: ../src/fb2/FictionBook/body/image.c:38 #, c-format msgid "Image %s not found in table\n" msgstr "Картинка %s не найдена в таблице\n" -#: ../src/fb2/FictionBook/body/section/image_inline.c:32 -#: ../src/fb2/FictionBook/body/image.c:35 +#: ../src/fb2/FictionBook/body/section/image_inline.c:31 +#: ../src/fb2/FictionBook/body/image.c:41 msgid "Not local links not supported\n" msgstr "Поддерживаются только локальные ссылки\n" -#: ../src/fb2/FictionBook/body/section.c:18 ../src/fb2/FictionBook/body.c:15 +#: ../src/fb2/FictionBook/body/section/section.c:18 +#: ../src/fb2/FictionBook/body/body.c:15 msgid "No Title" msgstr "Нет Заголовка" -#: ../src/fb2/FictionBook/attributes/id.c:26 +#: ../src/fb2/FictionBook/attributes/id.c:22 #, c-format msgid "ERROR: id %s already exist in table\n" msgstr "ОШИБКА: id %s уже присутствует в таблице\n" -#: ../src/fb2/FictionBook/binary/binary.c:42 +#: ../src/fb2/FictionBook/binary/binary.c:34 msgid "ERROR: no content in tag\n" msgstr "ОШИБКА: нет содержимого в теге \n" -#: ../src/fb2/FictionBook/binary/binary.c:45 +#: ../src/fb2/FictionBook/binary/binary.c:37 #, c-format msgid "ERROR: image %s already exist in table\n" msgstr "ОШИБКА: картинка %s уже содержится в таблице\n" -#: ../src/fb2/FictionBook/binary/binary.c:49 +#: ../src/fb2/FictionBook/binary/binary.c:40 msgid "ERROR: no id properties in tag\n" msgstr "ОШИБКА: не найдено свойство id в теге \n" -#: ../src/fb2/FictionBook/binary/binary.c:81 -#: ../src/fb2/FictionBook/binary/binary.c:97 +#: ../src/fb2/FictionBook/binary/binary.c:72 +#: ../src/fb2/FictionBook/binary/binary.c:88 #, c-format msgid "ERROR: GdkPixbufLoader: %s\n" msgstr "ОШИБКА: GdkPixbufLoader: %s\n" @@ -219,7 +224,7 @@ msgstr "" "\n" #: ../src/main.c:59 -#, fuzzy, c-format +#, c-format msgid "ERROR: Failed to load gui construct file %s\n" msgstr "ОШИБКА: не удалось загрузить файл с каркасом gui: %s\n" diff --git a/intl/simple-fb2-reader.pot b/intl/simple-fb2-reader.pot index eb7cc49..f178c32 100644 --- a/intl/simple-fb2-reader.pot +++ b/intl/simple-fb2-reader.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Report-Msgid-Bugs-To: medved_cool@mail.ru\n" - "POT-Creation-Date: 2015-04-05 18:09+0300\n" + "POT-Creation-Date: 2015-04-21 13:09+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,32 +16,34 @@ msgstr "Project-Id-Version: simple-fb2-reader 1.0.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ../res/simple-fb2-reader.glade:64 +#: ../res/simple-fb2-reader.glade:66 msgid "Forget all books position and endodings?" msgstr "" -#: ../res/simple-fb2-reader.glade:65 +#: ../res/simple-fb2-reader.glade:67 msgid "without the possibility of restoration" msgstr "" -#: ../res/simple-fb2-reader.glade:128 -msgid "ctrl+f\tsearch\n" - "ctrl+c\tcopy selected text\n" - "ctrl+m3 \tfont scale\n" +#: ../res/simple-fb2-reader.glade:154 +msgid "\n" + "ctrl + f\t\t\t\t\tsearch\n" + "ctrl + c\t\t\t\t\tcopy selected text\n" + "ctrl + mouse-wheel \t\tfont scale\n" + "left-arrow\t\t\t\t\tlink backward\n" "\n" - "Have nice reading!\n" + "\t\t\tHave nice reading!\n" msgstr "" -#: ../res/simple-fb2-reader.glade:229 +#: ../res/simple-fb2-reader.glade:244 #: ../src/callbacks/text_view_callback/popup_menu_callback.c:14 msgid "Backward" msgstr "" -#: ../res/simple-fb2-reader.glade:246 +#: ../res/simple-fb2-reader.glade:261 msgid "Forward" msgstr "" -#: ../res/simple-fb2-reader.glade:287 +#: ../res/simple-fb2-reader.glade:302 msgid "Case ensitive" msgstr "" @@ -92,41 +94,42 @@ msgstr "" msgid "ERROR: Failed to parsing fb2 file: %s\n" msgstr "" -#: ../src/fb2/FictionBook/body/section/image_inline.c:29 -#: ../src/fb2/FictionBook/body/image.c:32 +#: ../src/fb2/FictionBook/body/section/image_inline.c:28 +#: ../src/fb2/FictionBook/body/image.c:38 #, c-format msgid "Image %s not found in table\n" msgstr "" -#: ../src/fb2/FictionBook/body/section/image_inline.c:32 -#: ../src/fb2/FictionBook/body/image.c:35 +#: ../src/fb2/FictionBook/body/section/image_inline.c:31 +#: ../src/fb2/FictionBook/body/image.c:41 msgid "Not local links not supported\n" msgstr "" -#: ../src/fb2/FictionBook/body/section.c:18 ../src/fb2/FictionBook/body.c:15 +#: ../src/fb2/FictionBook/body/section/section.c:18 +#: ../src/fb2/FictionBook/body/body.c:15 msgid "No Title" msgstr "" -#: ../src/fb2/FictionBook/attributes/id.c:26 +#: ../src/fb2/FictionBook/attributes/id.c:22 #, c-format msgid "ERROR: id %s already exist in table\n" msgstr "" -#: ../src/fb2/FictionBook/binary/binary.c:42 +#: ../src/fb2/FictionBook/binary/binary.c:34 msgid "ERROR: no content in tag\n" msgstr "" -#: ../src/fb2/FictionBook/binary/binary.c:45 +#: ../src/fb2/FictionBook/binary/binary.c:37 #, c-format msgid "ERROR: image %s already exist in table\n" msgstr "" -#: ../src/fb2/FictionBook/binary/binary.c:49 +#: ../src/fb2/FictionBook/binary/binary.c:40 msgid "ERROR: no id properties in tag\n" msgstr "" -#: ../src/fb2/FictionBook/binary/binary.c:81 -#: ../src/fb2/FictionBook/binary/binary.c:97 +#: ../src/fb2/FictionBook/binary/binary.c:72 +#: ../src/fb2/FictionBook/binary/binary.c:88 #, c-format msgid "ERROR: GdkPixbufLoader: %s\n" msgstr "" diff --git a/res/simple-fb2-reader.glade b/res/simple-fb2-reader.glade index 68b00a0..520871f 100644 --- a/res/simple-fb2-reader.glade +++ b/res/simple-fb2-reader.glade @@ -127,13 +127,6 @@ main_wnd Simple FB2 Reader 1.0.0 - <ctrl> + <f> search -<ctrl> + <c> copy selected text -<ctrl> + <mouse-wheel> font scale -<left-arrow> link backward - -Have nice reading! - https://github.com/Cactus64k/simple-fb2-reader Cactus <medved_cool@mail.ru> simple-fb2-reader @@ -154,6 +147,25 @@ Have nice reading! 0 + + + True + False + +ctrl + f search +ctrl + c copy selected text +ctrl + mouse-wheel font scale +left-arrow link backward + + Have nice reading! + + + + False + True + 2 + + diff --git a/src/init/init_dialogs.c b/src/init/init_dialogs.c index 13c54ed..0ad92db 100644 --- a/src/init/init_dialogs.c +++ b/src/init/init_dialogs.c @@ -6,14 +6,14 @@ int init_search_wnd(GtkBuilder* builder, FB2_READER_SEARCH_WINDOW* obj) { memset(obj, 0, sizeof(*obj)); - obj->search_wnd = GTK_WIDGET( gtk_builder_get_object(builder, "search_wnd")); - obj->search_query_entry = GTK_ENTRY( gtk_builder_get_object(builder, "search_query_entry")); - obj->forward = GTK_RADIO_BUTTON( gtk_builder_get_object(builder, "search_forward_radiobutton")); - obj->backward = GTK_RADIO_BUTTON( gtk_builder_get_object(builder, "search_backward_radiobutton")); - obj->case_sensitive = GTK_CHECK_BUTTON( gtk_builder_get_object(builder, "search_case_sensitive_checkbutton")); + obj->search_wnd = GTK_WIDGET( gtk_builder_get_object(builder, "search_wnd")); + obj->search_query_entry = GTK_ENTRY( gtk_builder_get_object(builder, "search_query_entry")); + obj->forward = GTK_RADIO_BUTTON( gtk_builder_get_object(builder, "search_forward_radiobutton")); + obj->backward = GTK_RADIO_BUTTON( gtk_builder_get_object(builder, "search_backward_radiobutton")); + obj->case_sensitive = GTK_CHECK_BUTTON( gtk_builder_get_object(builder, "search_case_sensitive_checkbutton")); GtkTextIter text_iter; - obj->last_pos = gtk_text_iter_copy(&text_iter); + obj->last_pos = gtk_text_iter_copy(&text_iter); assert(obj->search_wnd != NULL); assert(obj->search_query_entry != NULL); @@ -29,10 +29,10 @@ int init_search_wnd(GtkBuilder* builder, FB2_READER_SEARCH_WINDOW* obj) int init_encode_wnd(GtkBuilder* builder, FB2_READER_ENCODE_DIALOG* obj) { - obj->dialog = GTK_DIALOG( gtk_builder_get_object(builder, "txt_encode_dialog")); - obj->liststore = GTK_LIST_STORE( gtk_builder_get_object(builder, "encode_liststore")); - obj->treeview = GTK_TREE_VIEW( gtk_builder_get_object(builder, "encode_treeview")); - obj->textbuffer = GTK_TEXT_BUFFER( gtk_builder_get_object(builder, "encode_textbuffer")); + obj->dialog = GTK_DIALOG( gtk_builder_get_object(builder, "txt_encode_dialog")); + obj->liststore = GTK_LIST_STORE( gtk_builder_get_object(builder, "encode_liststore")); + obj->treeview = GTK_TREE_VIEW( gtk_builder_get_object(builder, "encode_treeview")); + obj->textbuffer = GTK_TEXT_BUFFER( gtk_builder_get_object(builder, "encode_textbuffer")); assert(obj->dialog != NULL); assert(obj->liststore != NULL); @@ -49,20 +49,25 @@ int fill_encode_liststore(GtkListStore* list_store) char buff[128]; FILE* f = fopen(ENCODE_LIST_PATH, "rb"); GtkTreeIter tree_iter; - while(feof(f) == 0) + + if(f != NULL) { - fgets(buff, sizeof(buff), f); - char* line = strchr(buff, '\n'); - if(line != NULL) + while(feof(f) == 0) { - *line = 0; - - gtk_list_store_append(list_store, &tree_iter); - gtk_list_store_set(list_store, &tree_iter, 0, buff, -1); + fgets(buff, sizeof(buff), f); + char* line = strchr(buff, '\n'); + if(line != NULL) + { + *line = 0; + + gtk_list_store_append(list_store, &tree_iter); + gtk_list_store_set(list_store, &tree_iter, 0, buff, -1); + } } + + fclose(f); } - fclose(f); return 0; }