From bbf7ba32bb53fa94ba36e5da39577c23640d851d Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 4 Mar 2010 11:44:31 +0800 Subject: [PATCH 1/4] add .gitignore file --- .gitignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c49d15 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Normal rules +# + +!.gitignore +.* +series +*.orig +*~ +\#*# From dd4446d4fe4d78801020d9dcaa4f54ec9abb126a Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Thu, 4 Mar 2010 13:10:54 +0800 Subject: [PATCH 2/4] [stardict] fix wrong stardict.png patch --- stardict/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stardict/Makefile b/stardict/Makefile index adfd6b5..eaadeda 100644 --- a/stardict/Makefile +++ b/stardict/Makefile @@ -62,7 +62,7 @@ define Package/stardict/install $(INSTALL_DIR) \ $(1)/usr/bin \ $(1)/usr/share \ - $(1)/usr/share/icons + $(1)/usr/share/pixmaps $(INSTALL_BIN) \ $(PKG_INSTALL_DIR)/usr/bin/stardict \ @@ -70,7 +70,7 @@ define Package/stardict/install $(INSTALL_DATA) \ $(PKG_INSTALL_DIR)/usr/share/pixmaps/stardict.png \ - $(1)/usr/share/icons/ + $(1)/usr/share/pixmaps/ $(CP) \ $(PKG_INSTALL_DIR)/usr/share/stardict \ From 985540c7c748e4f146a565365613963b80a789c7 Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Wed, 10 Mar 2010 21:03:41 +0800 Subject: [PATCH 3/4] [stardict] remove-useless-buttions and splie-window patch --- .../patches/040-remove-useless-buttons.patch | 205 ++++++++++++++++++ ...it-the-index-word-and-result-windows.patch | 66 ++++++ 2 files changed, 271 insertions(+) create mode 100644 stardict/patches/040-remove-useless-buttons.patch create mode 100644 stardict/patches/050-split-the-index-word-and-result-windows.patch diff --git a/stardict/patches/040-remove-useless-buttons.patch b/stardict/patches/040-remove-useless-buttons.patch new file mode 100644 index 0000000..2411823 --- /dev/null +++ b/stardict/patches/040-remove-useless-buttons.patch @@ -0,0 +1,205 @@ +remove useless buttons + +From: Xiangfu Liu + +Signed-off-by: Xiangfu Liu +--- + + src/mainwin.cpp | 47 ++++++++++++++++++++++++++--------------------- + src/stardict.cpp | 5 +++-- + 2 files changed, 29 insertions(+), 23 deletions(-) + + +diff --git a/src/mainwin.cpp b/src/mainwin.cpp +index f7dac0b..0361014 100644 +--- a/src/mainwin.cpp ++++ b/src/mainwin.cpp +@@ -79,18 +79,6 @@ void TopWin::Create(GtkWidget *vbox) + gtk_box_pack_start(GTK_BOX(vbox),hbox,false,false,3); + #endif + +- GtkWidget *button; +-#ifndef CONFIG_GPE +- button = gtk_button_new_from_stock(GTK_STOCK_CLEAR); +- gtk_widget_show(button); +- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); +- GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); +- g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(ClearCallback),this); +- g_signal_connect(G_OBJECT(button),"enter_notify_event", G_CALLBACK(stardict_on_enter_notify), NULL); +- gtk_box_pack_start(GTK_BOX(hbox),button,false,false,3); +- gtk_widget_set_tooltip_text(button,_("Clear the search box")); +-#endif +- + GtkListStore* list_store = gtk_list_store_new(1, G_TYPE_STRING); + LoadHistory(list_store); + WordCombo = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(list_store), 0); +@@ -106,7 +94,17 @@ void TopWin::Create(GtkWidget *vbox) + G_CALLBACK (on_entry_activate), this); + gtk_box_pack_start(GTK_BOX(hbox),WordCombo,true,true,3); + +-#ifndef CONFIG_GPE ++#if !defined(CONFIG_NANONOTE) && !defined(CONFIG_GPE) ++ GtkWidget *button; ++ button = gtk_button_new_from_stock(GTK_STOCK_CLEAR); ++ gtk_widget_show(button); ++ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); ++ GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); ++ g_signal_connect(G_OBJECT(button),"clicked", G_CALLBACK(ClearCallback),this); ++ g_signal_connect(G_OBJECT(button),"enter_notify_event", G_CALLBACK(stardict_on_enter_notify), NULL); ++ gtk_box_pack_start(GTK_BOX(hbox),button,false,false,3); ++ gtk_widget_set_tooltip_text(button,_("Clear the search box")); ++ + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_FIND,GTK_ICON_SIZE_BUTTON)); + gtk_widget_show_all(button); +@@ -118,6 +116,7 @@ void TopWin::Create(GtkWidget *vbox) + gtk_widget_set_tooltip_text(button,_("Fuzzy Query")); + #endif + ++#ifndef CONFIG_NANONOTE + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_UNDO,GTK_ICON_SIZE_BUTTON)); + gtk_widget_show_all(button); +@@ -129,12 +128,10 @@ void TopWin::Create(GtkWidget *vbox) + gtk_box_pack_start(GTK_BOX(hbox),button,false,false,0); + gtk_widget_set_tooltip_text(button,_("Go Back - Right button: history (Alt+Left)")); + +-#ifndef CONFIG_NANONOTE + GtkWidget *label; + label = gtk_label_new("\t"); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(hbox),label,false,false,0); +-#endif + + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_HOME,GTK_ICON_SIZE_BUTTON)); +@@ -145,6 +142,7 @@ void TopWin::Create(GtkWidget *vbox) + g_signal_connect(G_OBJECT(button),"enter_notify_event", G_CALLBACK(stardict_on_enter_notify), NULL); + gtk_box_pack_start(GTK_BOX(hbox),button,false,false,0); + gtk_widget_set_tooltip_text(button,_("Show the main menu (Alt+M)")); ++#endif + } + + void TopWin::Destroy(void) +@@ -1246,6 +1244,10 @@ LeftWin::~LeftWin() + + void LeftWin::Create(GtkWidget *hbox, bool has_treedict) + { ++ choosegroup_menu = NULL; ++ UpdateChooseGroup(); ++ ++#ifndef CONFIG_NANONOTE + vbox = gtk_vbox_new(FALSE, 3); + if (!conf->get_bool_at("main_window/hide_list")) + gtk_widget_show(vbox); +@@ -1302,8 +1304,6 @@ void LeftWin::Create(GtkWidget *hbox, bool has_treedict) + g_signal_connect(G_OBJECT(choosegroup_button),"clicked", G_CALLBACK(on_choose_group_button_clicked),this); + gtk_box_pack_start(GTK_BOX(vbox),choosegroup_button,false,false,0); + gtk_widget_set_tooltip_text(choosegroup_button, _("Choose dict group")); +- choosegroup_menu = NULL; +- UpdateChooseGroup(); + + GtkWidget *button; + button=gtk_button_new(); +@@ -1325,6 +1325,7 @@ void LeftWin::Create(GtkWidget *hbox, bool has_treedict) + g_signal_connect(G_OBJECT(button),"enter_notify_event", G_CALLBACK(stardict_on_enter_notify), NULL); + gtk_box_pack_end(GTK_BOX(vbox),button,false,false,0); + gtk_widget_set_tooltip_text(button,_("Previous word (Alt+Up)")); ++#endif + } + + void LeftWin::on_wazard_button_toggled(GtkToggleButton *button, LeftWin *oLeftWin) +@@ -1499,6 +1500,7 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_box_pack_start(GTK_BOX(vbox),hbox,false,false,3); + #endif + ++#ifndef CONFIG_NANONOTE + GtkWidget *image; + ShowListButton=gtk_button_new(); + image = gtk_image_new_from_stock(GTK_STOCK_GOTO_LAST,GTK_ICON_SIZE_SMALL_TOOLBAR); +@@ -1535,10 +1537,10 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_widget_show(ShowListButton); + else + gtk_widget_show(HideListButton); +- ++#endif /* CONFIG_NANONOTE */ + + GtkWidget *button; +-#ifndef CONFIG_GPE ++#if !defined(CONFIG_NANONOTE) && !defined(CONFIG_GPE) + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_COPY,GTK_ICON_SIZE_SMALL_TOOLBAR)); + gtk_widget_show_all(button); +@@ -1563,6 +1565,7 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(PronounceWordMenuButton), _("Pronounce the word")); + gtk_widget_set_sensitive(GTK_WIDGET(PronounceWordMenuButton), false); + ++#ifndef CONFIG_NANONOTE + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_SAVE,GTK_ICON_SIZE_SMALL_TOOLBAR)); + gtk_widget_show_all(button); +@@ -1575,8 +1578,9 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_box_pack_start(GTK_BOX(hbox),button,false,false,5); + #endif + gtk_widget_set_tooltip_text(button,_("Save to file (Alt+E)")); ++#endif /* CONFIG_NANONOTE */ + +-#ifndef CONFIG_GPE ++#if !defined(CONFIG_NANONOTE) && !defined(CONFIG_GPE) + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_PRINT,GTK_ICON_SIZE_SMALL_TOOLBAR)); + gtk_widget_show_all(button); +@@ -1588,6 +1592,7 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_widget_set_sensitive(button, false); + #endif + ++#ifndef CONFIG_NANONOTE + button=gtk_button_new(); + gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_FIND,GTK_ICON_SIZE_SMALL_TOOLBAR)); + gtk_widget_show_all(button); +@@ -1600,6 +1605,7 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_box_pack_start(GTK_BOX(hbox),button,false,false,5); + #endif + gtk_widget_set_tooltip_text(button,_("Search in the definition text (Ctrl+F)")); ++#endif + } + + void ToolWin::ShowListCallback(GtkWidget *widget, gpointer data) +@@ -2691,7 +2697,6 @@ void MidWin::Create(GtkWidget *vbox) + oTransWin.Create(notebook); + } + +- + /*********************************************/ + BottomWin::BottomWin() + { +diff --git a/src/stardict.cpp b/src/stardict.cpp +index 2d4acb8..b84f5c5 100644 +--- a/src/stardict.cpp ++++ b/src/stardict.cpp +@@ -432,7 +432,7 @@ gboolean AppCore::on_delete_event(GtkWidget * window, GdkEvent *event , AppCore + #ifndef CONFIG_NANONOTE + app->oDockLet->minimize_to_tray(); + #endif +- g_print("Quitting..\n"); ++ g_print("by Windows Manager Quitting..\n"); + gtk_main_quit(); + return FALSE; + } +@@ -506,7 +506,7 @@ gboolean AppCore::vKeyPressReleaseCallback(GtkWidget * window, GdkEventKey *even + } + else if (event->keyval==GDK_F1 && (!(event->state & GDK_CONTROL_MASK)) && (!(event->state & GDK_MOD1_MASK)) && (!(event->state & GDK_SHIFT_MASK))) { + if (event->type==GDK_KEY_PRESS) +- show_help(NULL); ++ show_help(NULL); + } + else if ((event->keyval==GDK_f || event->keyval==GDK_F) && only_ctrl_pressed) { + if (event->type==GDK_KEY_PRESS) +@@ -588,6 +588,7 @@ gboolean AppCore::vKeyPressReleaseCallback(GtkWidget * window, GdkEventKey *even + gtk_tree_model_get(model, &iter, 0, &word, -1); + oAppCore->ListClick(word); + g_free(word); ++ /* here to dispaly the result windows */ + } + } + } diff --git a/stardict/patches/050-split-the-index-word-and-result-windows.patch b/stardict/patches/050-split-the-index-word-and-result-windows.patch new file mode 100644 index 0000000..bcd33ed --- /dev/null +++ b/stardict/patches/050-split-the-index-word-and-result-windows.patch @@ -0,0 +1,66 @@ +when search will only display the search index not the translate result + +From: Xiangfu Liu + +when press "enter" will goto the translate result text +"esc" will go back or new search + +Signed-off-by: Xiangfu Liu +--- + + src/mainwin.cpp | 4 +++- + src/mainwin.h | 1 + + src/stardict.cpp | 4 ++++ + 3 files changed, 8 insertions(+), 1 deletions(-) + + +diff --git a/src/mainwin.cpp b/src/mainwin.cpp +index 0361014..77fa6f0 100644 +--- a/src/mainwin.cpp ++++ b/src/mainwin.cpp +@@ -2688,8 +2688,10 @@ void MidWin::Create(GtkWidget *vbox) + oLeftWin.Create(hbox, has_treedict); + gtk_box_pack_start(GTK_BOX(hbox),notebook, true, true, 0); + +- GtkWidget *vbox1 = gtk_vbox_new(FALSE, 0); ++ vbox1 = gtk_vbox_new(FALSE, 0); ++#ifndef CONFIG_NANONOTE + gtk_widget_show(vbox1); ++#endif + oToolWin.Create(vbox1); + oTextWin.Create(vbox1); + gtk_paned_pack2(GTK_PANED(hpaned), vbox1, TRUE, FALSE); +diff --git a/src/mainwin.h b/src/mainwin.h +index c3589c6..569c978 100644 +--- a/src/mainwin.h ++++ b/src/mainwin.h +@@ -307,6 +307,7 @@ class MidWin { + public: + GtkWidget* hpaned; + GtkWidget* notebook; ++ GtkWidget* vbox1; + + LeftWin oLeftWin; + IndexWin oIndexWin; +diff --git a/src/stardict.cpp b/src/stardict.cpp +index b84f5c5..8dd64ac 100644 +--- a/src/stardict.cpp ++++ b/src/stardict.cpp +@@ -588,6 +588,8 @@ gboolean AppCore::vKeyPressReleaseCallback(GtkWidget * window, GdkEventKey *even + gtk_tree_model_get(model, &iter, 0, &word, -1); + oAppCore->ListClick(word); + g_free(word); ++ gtk_widget_hide(oAppCore->oMidWin.oIndexWin.notebook); ++ gtk_widget_show(oAppCore->oMidWin.vbox1); + /* here to dispaly the result windows */ + } + } +@@ -613,6 +615,8 @@ gboolean AppCore::vKeyPressReleaseCallback(GtkWidget * window, GdkEventKey *even + oAppCore->oTopWin.InsertBackList(); + oAppCore->oTopWin.SetText(""); + oAppCore->oTopWin.grab_focus(); ++ gtk_widget_show(oAppCore->oMidWin.oIndexWin.notebook); ++ gtk_widget_hide(oAppCore->oMidWin.vbox1); + } else { + if (!oAppCore->oTopWin.has_focus()) + oAppCore->oTopWin.grab_focus(); From 1e8e401064349c65bddc9996e39859c5495106cf Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Wed, 10 Mar 2010 21:28:18 +0800 Subject: [PATCH 4/4] [stardict] remove the PronounceButton --- .../patches/040-remove-useless-buttons.patch | 39 ++++++++++++------- ...it-the-index-word-and-result-windows.patch | 4 +- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/stardict/patches/040-remove-useless-buttons.patch b/stardict/patches/040-remove-useless-buttons.patch index 2411823..8458546 100644 --- a/stardict/patches/040-remove-useless-buttons.patch +++ b/stardict/patches/040-remove-useless-buttons.patch @@ -5,13 +5,13 @@ From: Xiangfu Liu Signed-off-by: Xiangfu Liu --- - src/mainwin.cpp | 47 ++++++++++++++++++++++++++--------------------- + src/mainwin.cpp | 52 +++++++++++++++++++++++++++++----------------------- src/stardict.cpp | 5 +++-- - 2 files changed, 29 insertions(+), 23 deletions(-) + 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/mainwin.cpp b/src/mainwin.cpp -index f7dac0b..0361014 100644 +index f7dac0b..ccd5adc 100644 --- a/src/mainwin.cpp +++ b/src/mainwin.cpp @@ -79,18 +79,6 @@ void TopWin::Create(GtkWidget *vbox) @@ -109,7 +109,14 @@ index f7dac0b..0361014 100644 } void LeftWin::on_wazard_button_toggled(GtkToggleButton *button, LeftWin *oLeftWin) -@@ -1499,6 +1500,7 @@ void ToolWin::Create(GtkWidget *vbox) +@@ -1493,12 +1494,13 @@ void ToolWin::Create(GtkWidget *vbox) + GtkWidget *hbox; + hbox = gtk_hbox_new(false,0); + gtk_widget_show(hbox); +-#ifdef CONFIG_GPE ++#if defined(CONFIG_GPE) || defined(CONFIG_NANONOTE) + gtk_box_pack_start(GTK_BOX(vbox),hbox,false,false,0); + #else gtk_box_pack_start(GTK_BOX(vbox),hbox,false,false,3); #endif @@ -130,15 +137,19 @@ index f7dac0b..0361014 100644 button=gtk_button_new(); gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_COPY,GTK_ICON_SIZE_SMALL_TOOLBAR)); gtk_widget_show_all(button); -@@ -1563,6 +1565,7 @@ void ToolWin::Create(GtkWidget *vbox) - gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(PronounceWordMenuButton), _("Pronounce the word")); - gtk_widget_set_sensitive(GTK_WIDGET(PronounceWordMenuButton), false); +@@ -1549,8 +1551,10 @@ void ToolWin::Create(GtkWidget *vbox) + gtk_widget_set_tooltip_text(button,_("Copy")); + #endif +- PronounceWordMenuButton = gtk_menu_tool_button_new_from_stock(GTK_STOCK_EXECUTE); + UpdatePronounceMenu(); ++ +#ifndef CONFIG_NANONOTE - button=gtk_button_new(); - gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_SAVE,GTK_ICON_SIZE_SMALL_TOOLBAR)); - gtk_widget_show_all(button); -@@ -1575,8 +1578,9 @@ void ToolWin::Create(GtkWidget *vbox) ++ PronounceWordMenuButton = gtk_menu_tool_button_new_from_stock(GTK_STOCK_EXECUTE); + gtk_widget_show(GTK_WIDGET(PronounceWordMenuButton)); + GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET(PronounceWordMenuButton), GTK_CAN_FOCUS); + gtk_container_forall(GTK_CONTAINER(PronounceWordMenuButton), unfocus_menu_button, this); +@@ -1575,8 +1579,9 @@ void ToolWin::Create(GtkWidget *vbox) gtk_box_pack_start(GTK_BOX(hbox),button,false,false,5); #endif gtk_widget_set_tooltip_text(button,_("Save to file (Alt+E)")); @@ -149,7 +160,7 @@ index f7dac0b..0361014 100644 button=gtk_button_new(); gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_PRINT,GTK_ICON_SIZE_SMALL_TOOLBAR)); gtk_widget_show_all(button); -@@ -1588,6 +1592,7 @@ void ToolWin::Create(GtkWidget *vbox) +@@ -1588,6 +1593,7 @@ void ToolWin::Create(GtkWidget *vbox) gtk_widget_set_sensitive(button, false); #endif @@ -157,7 +168,7 @@ index f7dac0b..0361014 100644 button=gtk_button_new(); gtk_container_add(GTK_CONTAINER(button),gtk_image_new_from_stock(GTK_STOCK_FIND,GTK_ICON_SIZE_SMALL_TOOLBAR)); gtk_widget_show_all(button); -@@ -1600,6 +1605,7 @@ void ToolWin::Create(GtkWidget *vbox) +@@ -1600,6 +1606,7 @@ void ToolWin::Create(GtkWidget *vbox) gtk_box_pack_start(GTK_BOX(hbox),button,false,false,5); #endif gtk_widget_set_tooltip_text(button,_("Search in the definition text (Ctrl+F)")); @@ -165,7 +176,7 @@ index f7dac0b..0361014 100644 } void ToolWin::ShowListCallback(GtkWidget *widget, gpointer data) -@@ -2691,7 +2697,6 @@ void MidWin::Create(GtkWidget *vbox) +@@ -2691,7 +2698,6 @@ void MidWin::Create(GtkWidget *vbox) oTransWin.Create(notebook); } diff --git a/stardict/patches/050-split-the-index-word-and-result-windows.patch b/stardict/patches/050-split-the-index-word-and-result-windows.patch index bcd33ed..2f26430 100644 --- a/stardict/patches/050-split-the-index-word-and-result-windows.patch +++ b/stardict/patches/050-split-the-index-word-and-result-windows.patch @@ -15,10 +15,10 @@ Signed-off-by: Xiangfu Liu diff --git a/src/mainwin.cpp b/src/mainwin.cpp -index 0361014..77fa6f0 100644 +index ccd5adc..eaa0650 100644 --- a/src/mainwin.cpp +++ b/src/mainwin.cpp -@@ -2688,8 +2688,10 @@ void MidWin::Create(GtkWidget *vbox) +@@ -2689,8 +2689,10 @@ void MidWin::Create(GtkWidget *vbox) oLeftWin.Create(hbox, has_treedict); gtk_box_pack_start(GTK_BOX(hbox),notebook, true, true, 0);