[Commits] [SCM] claws branch, master, updated. 3.9.3-181-ga5a0678

ticho at claws-mail.org ticho at claws-mail.org
Mon May 12 18:41:34 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  a5a06781957dde46bf24e75d0c2e9919a980ea54 (commit)
       via  b976c1dc267711cee1bfea10ab241b38b2c99a21 (commit)
       via  f7b587992455c454657ffa65cb47a04c066c32c0 (commit)
      from  d8592a0f73658dc2e5e7fb685a81f4dda9bfe843 (commit)


- Log -----------------------------------------------------------------
commit a5a06781957dde46bf24e75d0c2e9919a980ea54
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Mon May 12 18:39:29 2014 +0200

    Make Up key bring focus to Subject line, if the cursor is on the first line of body textview.

diff --git a/src/compose.c b/src/compose.c
index cad91a1..7a1f177 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -11005,6 +11005,10 @@ static gboolean completion_set_focus_to_subject
 					 GdkEventKey  *event,
 					 Compose      *compose)
 {
+	GtkTextBuffer *buffer;
+	GtkTextMark *mark;
+	GtkTextIter iter;
+
 	cm_return_val_if_fail(compose != NULL, FALSE);
 
 	/* make backtab move to subject field */
@@ -11012,6 +11016,24 @@ static gboolean completion_set_focus_to_subject
 		gtk_widget_grab_focus(compose->subject_entry);
 		return TRUE;
 	}
+
+	// Up key should also move the focus to subject field, if the cursor
+	// is on the first line.
+	if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_KP_Up) {
+		buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
+		g_return_val_if_fail(buffer != NULL, FALSE);
+
+		mark = gtk_text_buffer_get_mark(buffer, "insert");
+		g_return_val_if_fail(mark != NULL, FALSE);
+
+		gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark);
+
+		if (gtk_text_iter_get_line(&iter) == 0) {
+			gtk_widget_grab_focus(compose->subject_entry);
+			return TRUE;
+		}
+	}
+
 	return FALSE;
 }
 

commit b976c1dc267711cee1bfea10ab241b38b2c99a21
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Mon May 12 18:36:43 2014 +0200

    Add a mnemonic to compose window's Subject line, allowing alt+s to bring focus there.

diff --git a/src/compose.c b/src/compose.c
index 2306477..cad91a1 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7696,7 +7696,7 @@ static Compose *compose_create(PrefsAccount *account,
 	gtk_container_set_border_width(GTK_CONTAINER(subject), 0);
 	gtk_widget_show(subject);
 
-	label = gtk_label_new(_("Subject:"));
+	label = gtk_label_new_with_mnemonic(_("Subject:"));
 	gtk_box_pack_start(GTK_BOX(subject), label, FALSE, FALSE, 0);
 	gtk_widget_show(label);
 
@@ -7708,6 +7708,7 @@ static Compose *compose_create(PrefsAccount *account,
 	gtk_box_pack_start(GTK_BOX(subject), subject_entry, TRUE, TRUE, 0);
 	g_signal_connect_after(G_OBJECT(subject_entry), "grab_focus",
 			 G_CALLBACK(compose_grab_focus_cb), compose);
+	gtk_label_set_mnemonic_widget(GTK_LABEL(label), subject_entry);
 	gtk_widget_show(subject_entry);
 	compose->subject_entry = subject_entry;
 	gtk_container_add(GTK_CONTAINER(subject_frame), subject);

commit f7b587992455c454657ffa65cb47a04c066c32c0
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun May 11 21:39:51 2014 +0200

    Do not allow the compose window's slider between headers and body to hide widgets on either side.

diff --git a/src/compose.c b/src/compose.c
index b23d091..2306477 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7657,7 +7657,6 @@ static Compose *compose_create(PrefsAccount *account,
 	
 	/* Notebook */
 	notebook = gtk_notebook_new();
-	gtk_widget_set_size_request(notebook, -1, prefs_common.compose_notebook_height);
 	gtk_widget_show(notebook);
 
 	/* header labels and entries */
@@ -7785,8 +7784,9 @@ static Compose *compose_create(PrefsAccount *account,
 	/* pane between attach clist and text */
 	paned = gtk_vpaned_new();
 	gtk_container_add(GTK_CONTAINER(vbox2), paned);
-	gtk_paned_add1(GTK_PANED(paned), notebook);
-	gtk_paned_add2(GTK_PANED(paned), edit_vbox);
+	gtk_paned_pack1(GTK_PANED(paned), notebook, FALSE, FALSE);
+	gtk_paned_pack2(GTK_PANED(paned), edit_vbox, TRUE, FALSE);
+	gtk_paned_set_position(GTK_PANED(paned), prefs_common.compose_notebook_height);
 	gtk_widget_show_all(paned);
 
 
diff --git a/src/main.c b/src/main.c
index 0b62821..e042115 100644
--- a/src/main.c
+++ b/src/main.c
@@ -957,7 +957,29 @@ static void reset_statistics(void)
 	session_stats.forwarded = 0;
 	session_stats.time_started = time(NULL);
 }
-		
+
+static void test_strftime(void)
+{
+	int i;
+	char buf[64];
+	time_t dummy = time(NULL);
+	struct tm tbuf;
+	struct tm *lt = localtime_r(&dummy, &tbuf);
+
+	{
+	START_TIMING("fast_strftime");
+	for (i = 0; i < 100000; i++)
+		fast_strftime(buf, 64, "%x %X %r", lt);
+	END_TIMING();
+	}
+	{
+	START_TIMING("strftime");
+	for (i = 0; i < 100000; i++)
+		strftime(buf, 64, "%x %X %r", lt);
+	END_TIMING();
+	}
+}
+
 int main(int argc, char *argv[])
 {
 #ifdef HAVE_DBUS_GLIB
@@ -1552,6 +1574,7 @@ int main(int argc, char *argv[])
 
 	END_TIMING();
 
+	test_strftime();
 	gtk_main();
 
 #ifdef HAVE_NETWORKMANAGER_SUPPORT

-----------------------------------------------------------------------

Summary of changes:
 src/compose.c |   31 +++++++++++++++++++++++++++----
 src/main.c    |   25 ++++++++++++++++++++++++-
 2 files changed, 51 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list