From 36cb765f06af315e49ce010057f69147237d0be6 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Sun, 18 Aug 2002 08:06:40 +0000 Subject: [PATCH] fix non-translated tooltips bug --- ChangeLog.claws | 10 +++++++++ configure.in | 2 +- src/toolbar.c | 57 +++++++++++++++++++++++++++++++++---------------- src/toolbar.h | 5 ++--- 4 files changed, 52 insertions(+), 22 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 3e070b08e..be00da3e8 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,13 @@ +2002-08-18 [paul] 0.8.1claws73 + + * src/toolbar.[ch] + fix bug where tooltips were displayed untranslated + + * src/prefs_toolbar.c + fix bug where clicking 'Cancel' creates an icon & text + toolbar regardless of prefs + + 2002-08-17 [oliver] 0.8.1claws72 * src/prefs_toolbar.c diff --git a/configure.in b/configure.in index 17fe67df1..95713e289 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws72 +EXTRA_VERSION=claws73 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/toolbar.c b/src/toolbar.c index 17877aeb9..1b0acfaa7 100644 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -858,9 +858,12 @@ void toolbar_create(MainWindow *mainwin, GtkWidget *icon_news = NULL; GtkWidget *item_news = NULL; GtkWidget *item; + GtkTooltips *toolbar_tips; ToolbarSylpheedActions *syl_action; GSList *cur; + toolbar_tips = gtk_tooltips_new(); + toolbar_destroy(mainwin); toolbar_read_config_file(); @@ -894,12 +897,21 @@ void toolbar_create(MainWindow *mainwin, switch (toolbar_item->action) { case A_RECEIVE_ALL: mainwin->toolbar->getall_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->getall_btn, + _("Receive Mail on all Accounts"), NULL); break; case A_RECEIVE_CUR: mainwin->toolbar->get_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->get_btn, + _("Receive Mail on current Account"), NULL); break; case A_SEND_QUEUED: mainwin->toolbar->send_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->send_btn, + _("Send Queued Message(s)"), NULL); break; case A_COMPOSE_EMAIL: icon_news = stock_pixmap_widget(container, STOCK_PIXMAP_NEWS_COMPOSE); @@ -910,10 +922,19 @@ void toolbar_create(MainWindow *mainwin, icon_news, toolbar_actions_cb, toolbar_item); mainwin->toolbar->compose_mail_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->compose_mail_btn, + _("Compose Email"), NULL); mainwin->toolbar->compose_news_btn = item_news; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->compose_news_btn, + _("Compose News"), NULL); break; case A_REPLY_MESSAGE: mainwin->toolbar->reply_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->reply_btn, + _("Reply to Message"), NULL); gtk_signal_connect(GTK_OBJECT(mainwin->toolbar->reply_btn), "button_press_event", GTK_SIGNAL_FUNC(toolbar_reply_popup_cb), @@ -921,6 +942,9 @@ void toolbar_create(MainWindow *mainwin, break; case A_REPLY_SENDER: mainwin->toolbar->replysender_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->replysender_btn, + _("Reply to Sender"), NULL); gtk_signal_connect(GTK_OBJECT(mainwin->toolbar->replysender_btn), "button_press_event", GTK_SIGNAL_FUNC(toolbar_reply_to_sender_popup_cb), @@ -928,6 +952,9 @@ void toolbar_create(MainWindow *mainwin, break; case A_REPLY_ALL: mainwin->toolbar->replyall_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->replyall_btn, + _("Reply to All"), NULL); gtk_signal_connect(GTK_OBJECT(mainwin->toolbar->replyall_btn), "button_press_event", GTK_SIGNAL_FUNC(toolbar_reply_to_all_popup_cb), @@ -935,6 +962,9 @@ void toolbar_create(MainWindow *mainwin, break; case A_FORWARD: mainwin->toolbar->fwd_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->fwd_btn, + _("Forward Message"), NULL); gtk_signal_connect(GTK_OBJECT(mainwin->toolbar->fwd_btn), "button_press_event", GTK_SIGNAL_FUNC(toolbar_forward_popup_cb), @@ -942,12 +972,21 @@ void toolbar_create(MainWindow *mainwin, break; case A_DELETE: mainwin->toolbar->delete_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->delete_btn, + _("Delete Message"), NULL); break; case A_EXECUTE: mainwin->toolbar->exec_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->exec_btn, + _("Execute"), NULL); break; case A_GOTO_NEXT: mainwin->toolbar->next_btn = item; + gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), + mainwin->toolbar->next_btn, + _("Goto Next Message"), NULL); break; case A_SYL_ACTIONS: syl_action = g_new0(ToolbarSylpheedActions, 1); @@ -963,24 +1002,6 @@ void toolbar_create(MainWindow *mainwin, } } - /* we always create an exec button, if there isn't one yet */ - if (!mainwin->toolbar->exec_btn) { - toolbar_item = g_new0(ToolbarItem, 1); - toolbar_item->action = A_EXECUTE; - toolbar_item->file = stock_pixmap_get_name(STOCK_PIXMAP_EXEC); - toolbar_item->text = toolbar_ret_text_from_val(A_EXECUTE); - - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_EXEC); - item = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), - _("Execute"), - toolbar_ret_descr_from_val(A_EXECUTE), - (""), - icon_wid, toolbar_actions_cb, - toolbar_item); - mainwin->toolbar->exec_btn = item; - g_free(toolbar_item); - } - mainwin->toolbar->toolbar = toolbar; activate_compose_button(mainwin->toolbar, diff --git a/src/toolbar.h b/src/toolbar.h index a3589f49e..9d50f5958 100644 --- a/src/toolbar.h +++ b/src/toolbar.h @@ -39,13 +39,12 @@ typedef enum A_EXECUTE, A_GOTO_NEXT, A_SYL_ACTIONS, - A_COMPOSE_NEWS, N_ACTION_VAL } CTActionVal; -#define A_SEPARATOR N_ACTION_VAL + 1 - +#define A_COMPOSE_NEWS N_ACTION_VAL + 1 +#define A_SEPARATOR N_ACTION_VAL + 2 typedef struct _ToolbarAction ToolbarAction; struct _ToolbarAction -- 2.25.1