aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-01-23 16:18:09 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-01-23 16:18:09 +0800
commit7eb6adbed960267ef2f240a7f268b97aa2c29984 (patch)
tree4c539bc216d90869aab4e42b4d571077d85b627e
parent977171ff51243dd2df800f9f1977902a704665d9 (diff)
downloadgsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar.gz
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar.bz2
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar.lz
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar.xz
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.tar.zst
gsoc2013-evolution-7eb6adbed960267ef2f240a7f268b97aa2c29984.zip
Committing ChangeLog em-account-prefs.c em-format-html-display.c em-message-browser.c
svn path=/trunk/; revision=31272
-rw-r--r--mail/ChangeLog18
-rw-r--r--mail/em-account-prefs.c7
-rw-r--r--mail/em-format-html-display.c29
-rw-r--r--mail/em-message-browser.c15
4 files changed, 64 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 38894ae699..d950f75407 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,21 @@
+2006-01-23 Ranjan Somani <sranjan@novell.com>
+
+ ** Fixes #326795
+
+ * em-message-browser.c: Pressing Esc key lets u close the window
+
+2006-01-20 Nancy Cai <nancy.cai@sun.com>
+
+ ** Fixes #326649
+
+ * em-account-prefs.c: (mail_accounts_load):select the first row
+
+2006-01-23 Srinivasa Ragavan <sragavan@novell.com>
+
+ * em-format-html-display.c (efhd_attachment_bar_refresh),
+ (efhd_mnemonic_show_bar), (efhd_add_bar): Added Mnemonics for Save /
+ Save All and for show/hide attachment bar.
+
2006-01-19 Ranjan Somani <sranjan@novell.com>
** Fixes #318785
diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c
index 4207a66455..8cd3b9105e 100644
--- a/mail/em-account-prefs.c
+++ b/mail/em-account-prefs.c
@@ -433,6 +433,7 @@ mail_accounts_load (EMAccountPrefs *prefs)
char *name, *val;
EIterator *node;
int row = 0;
+ GtkTreeSelection *selection;
model = (GtkListStore *) gtk_tree_view_get_model (prefs->table);
gtk_list_store_clear (model);
@@ -441,6 +442,8 @@ mail_accounts_load (EMAccountPrefs *prefs)
accounts = mail_config_get_accounts ();
node = e_list_get_iterator ((EList *) accounts);
+ selection = gtk_tree_view_get_selection(prefs->table);
+
while (e_iterator_is_valid (node)) {
EAccount *account;
CamelURL *url;
@@ -470,6 +473,10 @@ mail_accounts_load (EMAccountPrefs *prefs)
if (url)
camel_url_free (url);
+ /* select the first row by default */
+ if (row == 0)
+ gtk_tree_selection_select_iter (selection, &iter);
+
row++;
}
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 389a5b46a2..ee9f44ea22 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -132,6 +132,7 @@ struct _EMFormatHTMLDisplayPrivate {
GtkWidget *attachment_bar;
GtkWidget *attachment_box;
GtkWidget *label;
+ GtkWidget *save_txt;
GtkWidget *arrow;
GtkWidget *forward;
GtkWidget *down;
@@ -1937,13 +1938,14 @@ efhd_attachment_bar_refresh (EMFormatHTMLDisplay *efhd)
char *txt;
/* Cant i put in the number of attachments here ?*/
- txt = g_strdup_printf(ngettext("%d attachment", "%d attachments", nattachments), nattachments);
- gtk_label_set_text ((GtkLabel *)efhd->priv->label, txt);
+ txt = g_strdup_printf(ngettext("%d attachme_nt", "%d attachme_nts", nattachments), nattachments);
+ gtk_label_set_text_with_mnemonic ((GtkLabel *)efhd->priv->label, txt);
g_free (txt);
/* Show the bar even when the first attachment is added */
if (nattachments == 1) {
gtk_widget_show_all (efhd->priv->attachment_area);
+ gtk_label_set_text_with_mnemonic ((GtkLabel *)efhd->priv->save_txt, _("S_ave"));
if (efhd->priv->show_bar) {
gtk_widget_show(efhd->priv->down);
@@ -1953,6 +1955,8 @@ efhd_attachment_bar_refresh (EMFormatHTMLDisplay *efhd)
gtk_widget_hide(efhd->priv->down);
gtk_widget_hide(efhd->priv->attachment_box);
}
+ } else if (nattachments > 1) {
+ gtk_label_set_text_with_mnemonic ((GtkLabel *)efhd->priv->save_txt, _("S_ave All"));
}
}
}
@@ -1983,15 +1987,25 @@ efhd_bar_scroll_event(GtkWidget *w, GdkEventScroll *event, EMFormatHTMLDisplay *
return TRUE;
}
+gboolean
+efhd_mnemonic_show_bar (GtkWidget *widget, gboolean focus, GtkWidget *efhd)
+{
+ attachment_bar_arrow_clicked (NULL, efhd);
+
+ return TRUE;
+}
+
static gboolean
efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject)
{
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh;
struct _EMFormatHTMLDisplayPrivate *priv = efhd->priv;
- GtkWidget *hbox1, *hbox2, *hbox3, *vbox, *txt, *image, *save;
+ GtkWidget *hbox1, *hbox2, *hbox3, *vbox, *txt, *image, *save, *scroll;
int width, height;
priv->attachment_bar = e_attachment_bar_new(NULL);
+ scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (scroll, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
((EAttachmentBar *)priv->attachment_bar)->expand = TRUE;
priv->forward = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
@@ -2000,12 +2014,16 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec
gtk_box_pack_start ((GtkBox *)hbox3, priv->forward, FALSE, FALSE, 0);
gtk_box_pack_start ((GtkBox *)hbox3, priv->down, FALSE, FALSE, 0);
priv->arrow = (GtkWidget *)gtk_tool_button_new(hbox3, NULL);
+ g_signal_connect (priv->arrow, "mnemonic_activate", G_CALLBACK (efhd_mnemonic_show_bar), efh);
+ printf("it is %d %d \n", priv->arrow, efh);
atk_object_set_name (gtk_widget_get_accessible (priv->arrow), _("Toggle Attachment Bar"));
priv->label = gtk_label_new(_("No Attachment"));
+ gtk_label_set_mnemonic_widget (priv->label, priv->arrow);
save = gtk_button_new();
image = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_BUTTON);
- txt = gtk_label_new(_("Save All"));
+ txt = gtk_label_new_with_mnemonic(_("S_ave"));
+ priv->save_txt = txt;
hbox1 = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start((GtkBox *)hbox1, image, FALSE, FALSE, 2);
gtk_box_pack_start((GtkBox *)hbox1, txt, FALSE, FALSE, 0);
@@ -2017,7 +2035,8 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec
gtk_box_pack_start ((GtkBox *)hbox2, priv->label, FALSE, FALSE, 2);
gtk_box_pack_start ((GtkBox *)hbox2, save, FALSE, FALSE, 2);
- priv->attachment_box = gtk_frame_new (NULL);
+ priv->attachment_box = scroll;
+ gtk_scrolled_window_set_shadow_type (scroll, GTK_SHADOW_IN);
gtk_container_add ((GtkContainer *)priv->attachment_box, priv->attachment_bar);
gtk_widget_get_size_request(priv->attachment_bar, &width, &height);
diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c
index f8e2d5bdd1..fb6369608e 100644
--- a/mail/em-message-browser.c
+++ b/mail/em-message-browser.c
@@ -37,6 +37,8 @@
#include <gtk/gtkscrolledwindow.h>
#include <gtk/gtkbutton.h>
+#include <gdk/gdkkeysyms.h>
+
#include <gconf/gconf-client.h>
#include <camel/camel-folder.h>
@@ -214,6 +216,18 @@ GtkWidget *em_message_browser_new(void)
return (GtkWidget *)emmb;
}
+static int
+messagebrowser_key_pressed (EMMessageBrowser *emmb, GdkEventKey *event, void *user_data)
+{
+ if (event->keyval == GDK_Escape) {
+ gtk_widget_destroy(gtk_widget_get_toplevel((GtkWidget *)emmb));
+ g_signal_stop_emission_by_name (emmb, "key-press-event");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
GtkWidget *em_message_browser_window_new(void)
{
EMMessageBrowser *emmb;
@@ -257,6 +271,7 @@ GtkWidget *em_message_browser_window_new(void)
gtk_window_set_default_size ((GtkWindow *) emmb->window, window_size.width, window_size.height);
g_signal_connect (emmb->window, "size-allocate", G_CALLBACK (window_size_allocate), NULL);
g_signal_connect (((EMFolderView *) emmb)->list, "message_selected", G_CALLBACK (emmb_list_message_selected), emmb);
+ g_signal_connect (emmb, "key-press-event" , G_CALLBACK (messagebrowser_key_pressed), NULL);
/* cleanup? */