2007-03-21 [colin] 2.8.1cvs32
authorColin Leroy <colin@colino.net>
Wed, 21 Mar 2007 17:44:45 +0000 (17:44 +0000)
committerColin Leroy <colin@colino.net>
Wed, 21 Mar 2007 17:44:45 +0000 (17:44 +0000)
* claws-mail-40x40.png
* claws-mail-26x26.png
* src/account.c
* src/addressbook.c
* src/compose.c
* src/folderview.c
* src/folderview.h
* src/main.c
* src/mainwindow.c
* src/mainwindow.h
* src/messageview.c
* src/prefs_account.c
* src/prefs_common.c
* src/summary_search.c
* src/summaryview.c
* src/summaryview.h
* src/gtk/authors.h
* src/gtk/gtkutils.c
* src/gtk/gtkutils.h
* src/gtk/logwindow.c
* src/gtk/menu.c
* src/gtk/prefswindow.c
Add Maemo port (patch mainly by Jean-Luc Biort)
Add a new 'Little screen' layout to help on such
platforms (patch by me)
Make some default preferences different (more
adapted) on Maemo (patch by me)

25 files changed:
ChangeLog
PATCHSETS
claws-mail-26x26.png [new file with mode: 0644]
claws-mail-40x40.png [new file with mode: 0644]
configure.ac
src/account.c
src/addressbook.c
src/compose.c
src/folderview.c
src/folderview.h
src/gtk/authors.h
src/gtk/gtkutils.c
src/gtk/gtkutils.h
src/gtk/logwindow.c
src/gtk/menu.c
src/gtk/prefswindow.c
src/main.c
src/mainwindow.c
src/mainwindow.h
src/messageview.c
src/prefs_account.c
src/prefs_common.c
src/summary_search.c
src/summaryview.c
src/summaryview.h

index 8fd1c98..1b7c989 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2007-03-21 [colin]     2.8.1cvs32
+
+       * claws-mail-40x40.png
+       * claws-mail-26x26.png
+       * src/account.c
+       * src/addressbook.c
+       * src/compose.c
+       * src/folderview.c
+       * src/folderview.h
+       * src/main.c
+       * src/mainwindow.c
+       * src/mainwindow.h
+       * src/messageview.c
+       * src/prefs_account.c
+       * src/prefs_common.c
+       * src/summary_search.c
+       * src/summaryview.c
+       * src/summaryview.h
+       * src/gtk/authors.h
+       * src/gtk/gtkutils.c
+       * src/gtk/gtkutils.h
+       * src/gtk/logwindow.c
+       * src/gtk/menu.c
+       * src/gtk/prefswindow.c
+               Add Maemo port (patch mainly by Jean-Luc Biort)
+               Add a new 'Little screen' layout to help on such
+               platforms (patch by me)
+               Make some default preferences different (more
+               adapted) on Maemo (patch by me)
+
 2007-03-21 [wwp]       2.8.1cvs31
 
        * src/prefs_logging.c
index 91f2672..51d17cf 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/etpan/Makefile.am;  cvs diff -u -r 1.1.4.74 -r 1.1.4.75 src/etpan/imap-thread.c;  ) > 2.8.1cvs29.patchset
 ( cvs diff -u -r 1.155.2.54 -r 1.155.2.55 src/Makefile.am;  cvs diff -u -r 1.60.2.29 -r 1.60.2.30 src/filtering.c;  cvs diff -u -r 1.21.2.12 -r 1.21.2.13 src/filtering.h;  cvs diff -u -r 1.213.2.136 -r 1.213.2.137 src/folder.c;  cvs diff -u -r 1.207.2.151 -r 1.207.2.152 src/folderview.c;  cvs diff -u -r 1.179.2.159 -r 1.179.2.160 src/imap.c;  cvs diff -u -r 1.149.2.67 -r 1.149.2.68 src/inc.c;  cvs diff -u -r 1.115.2.144 -r 1.115.2.145 src/main.c;  cvs diff -u -r 1.274.2.177 -r 1.274.2.178 src/mainwindow.c;  cvs diff -u -r 1.39.2.33 -r 1.39.2.34 src/mainwindow.h;  cvs diff -u -r 1.75.2.38 -r 1.75.2.39 src/matcher.c;  cvs diff -u -r 1.94.2.126 -r 1.94.2.127 src/messageview.c;  cvs diff -u -r 1.101.2.36 -r 1.101.2.37 src/news.c;  cvs diff -u -r 1.56.2.47 -r 1.56.2.48 src/pop.c;  cvs diff -u -r 1.204.2.123 -r 1.204.2.124 src/prefs_common.c;  cvs diff -u -r 1.103.2.77 -r 1.103.2.78 src/prefs_common.h;  diff -u /dev/null src/prefs_logging.c;  diff -u /dev/null src/prefs_logging.h;  cvs diff -u -r 1.1.2.21 -r 1.1.2.22 src/prefs_other.c;  cvs diff -u -r 1.150.2.93 -r 1.150.2.94 src/procmsg.c;  cvs diff -u -r 1.17.2.37 -r 1.17.2.38 src/send_message.c;  cvs diff -u -r 1.395.2.286 -r 1.395.2.287 src/summaryview.c;  cvs diff -u -r 1.6.2.9 -r 1.6.2.10 src/common/log.c;  cvs diff -u -r 1.4.2.5 -r 1.4.2.6 src/common/log.h;  cvs diff -u -r 1.6.2.12 -r 1.6.2.13 src/common/nntp.c;  cvs diff -u -r 1.23.2.13 -r 1.23.2.14 src/common/session.c;  cvs diff -u -r 1.11.2.20 -r 1.11.2.21 src/common/smtp.c;  cvs diff -u -r 1.13.2.27 -r 1.13.2.28 src/common/socket.c;  cvs diff -u -r 1.1.4.75 -r 1.1.4.76 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.27 -r 1.1.4.28 src/gtk/logwindow.c;  cvs diff -u -r 1.1.4.12 -r 1.1.4.13 src/gtk/logwindow.h;  cvs diff -u -r 1.1.2.27 -r 1.1.2.28 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.18.2.48 -r 1.18.2.49 src/plugins/spamassassin/spamassassin.c;  ) > 2.8.1cvs30.patchset
 ( cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_logging.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/prefs_logging.h;  ) > 2.8.1cvs31.patchset
+( diff -u /dev/null claws-mail-40x40.png;  diff -u /dev/null claws-mail-26x26.png;  cvs diff -u -r 1.61.2.60 -r 1.61.2.61 src/account.c;  cvs diff -u -r 1.60.2.83 -r 1.60.2.84 src/addressbook.c;  cvs diff -u -r 1.382.2.361 -r 1.382.2.362 src/compose.c;  cvs diff -u -r 1.207.2.152 -r 1.207.2.153 src/folderview.c;  cvs diff -u -r 1.20.2.18 -r 1.20.2.19 src/folderview.h;  cvs diff -u -r 1.115.2.145 -r 1.115.2.146 src/main.c;  cvs diff -u -r 1.274.2.178 -r 1.274.2.179 src/mainwindow.c;  cvs diff -u -r 1.39.2.34 -r 1.39.2.35 src/mainwindow.h;  cvs diff -u -r 1.94.2.127 -r 1.94.2.128 src/messageview.c;  cvs diff -u -r 1.105.2.88 -r 1.105.2.89 src/prefs_account.c;  cvs diff -u -r 1.204.2.124 -r 1.204.2.125 src/prefs_common.c;  cvs diff -u -r 1.15.2.44 -r 1.15.2.45 src/summary_search.c;  cvs diff -u -r 1.395.2.287 -r 1.395.2.288 src/summaryview.c;  cvs diff -u -r 1.68.2.33 -r 1.68.2.34 src/summaryview.h;  cvs diff -u -r 1.1.2.33 -r 1.1.2.34 src/gtk/authors.h;  cvs diff -u -r 1.5.2.55 -r 1.5.2.56 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.32 -r 1.4.2.33 src/gtk/gtkutils.h;  cvs diff -u -r 1.1.4.28 -r 1.1.4.29 src/gtk/logwindow.c;  cvs diff -u -r 1.5.2.21 -r 1.5.2.22 src/gtk/menu.c;  cvs diff -u -r 1.12.2.32 -r 1.12.2.33 src/gtk/prefswindow.c;  ) > 2.8.1cvs32.patchset
diff --git a/claws-mail-26x26.png b/claws-mail-26x26.png
new file mode 100644 (file)
index 0000000..afc3a44
Binary files /dev/null and b/claws-mail-26x26.png differ
diff --git a/claws-mail-40x40.png b/claws-mail-40x40.png
new file mode 100644 (file)
index 0000000..e136f3b
Binary files /dev/null and b/claws-mail-40x40.png differ
index e4432dc..1216840 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=32
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -433,6 +433,18 @@ dnl check if GDB is somewhere
        AC_MSG_RESULT($ac_cv_enable_crash_dialog)
 fi
 
+dnl Maemo platform
+AC_ARG_ENABLE(maemo,
+       [  --enable-maemo   Build for the Maemo platform [default=no]],
+       [ac_cv_enable_maemo=$enableval], [ac_cv_enable_maemo=no])
+if test $ac_cv_enable_maemo = yes; then
+       AC_MSG_CHECKING([whether to build for Maemo])
+       if test $ac_cv_enable_maemo = yes; then
+               AC_DEFINE(MAEMO, 1, Build for Maemo)
+       fi
+       AC_MSG_RESULT($ac_cv_enable_maemo)
+fi
+
 dnl Check for X-Face support
 AC_ARG_ENABLE(compface,
        [  --disable-compface      Do not use compface (X-Face)],
@@ -921,6 +933,7 @@ echo "Libgnomeprint : $ac_cv_enable_gnomeprint"
 echo "LibSM         : $ac_cv_enable_libsm"
 echo "Manual        : $ac_cv_enable_manual"
 echo "Plugins       : $PLUGINS"
+echo "Maemo  build  : $ac_cv_enable_maemo"
 echo "Config dir    : $ac_cv_with_config_dir"
 echo ""
 echo "The binary will be installed in $prefix/bin"
index ba09acc..3e9425c 100644 (file)
@@ -680,8 +680,12 @@ static void account_edit_create(void)
        gtk_window_set_modal (GTK_WINDOW (window), TRUE);
        g_signal_connect (G_OBJECT (window), "delete_event",
                          G_CALLBACK (account_delete_event), NULL);
+#ifdef MAEMO
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(window));
+#else
        g_signal_connect (G_OBJECT (window), "key_press_event",
                          G_CALLBACK (account_key_pressed), NULL);
+#endif                   
        MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_widget_realize(window);
 
@@ -799,7 +803,7 @@ static void account_edit_create(void)
 
        if (!geometry.min_height) {
                geometry.min_width = 500;
-               geometry.min_height = 350;
+               geometry.min_height = 380;
        }
 
        gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL, &geometry,
@@ -810,6 +814,9 @@ static void account_edit_create(void)
        edit_account.window    = window;
        edit_account.list_view = list_view;
        edit_account.close_btn = close_btn;
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(edit_account.window));
+#endif
 }
 
 static void account_edit_prefs(GtkWidget *widget, gpointer data)
index 87b2183..cfb0c1b 100644 (file)
@@ -634,6 +634,10 @@ void addressbook_open(Compose *target)
        }
 
        gtk_widget_show_all(addrbook.window);
+#ifdef MAEMO
+               maemo_window_full_screen_if_needed(GTK_WINDOW(addrbook.window));
+               maemo_connect_key_press_to_mainwindow(GTK_WINDOW(addrbook.window));
+#endif
        if (!prefs_common.addressbook_use_editaddress_dialog)
                addressbook_edit_person_widgetset_hide();
 
index a322568..f0e9f69 100644 (file)
@@ -367,7 +367,6 @@ static gboolean attach_button_pressed       (GtkWidget      *widget,
 static gboolean attach_key_pressed     (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         gpointer        data);
-
 static void compose_send_cb            (gpointer        data,
                                         guint           action,
                                         GtkWidget      *widget);
@@ -6154,6 +6153,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
        compose->tooltips = gtk_tooltips_new();
 
        window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "compose");
+
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
        gtk_widget_set_size_request(window, -1, prefs_common.compose_height);
 
@@ -6170,11 +6170,12 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
        }
        gtk_window_set_geometry_hints(GTK_WINDOW(window), NULL,
                                      &geometry, GDK_HINT_MIN_SIZE);
-       
+
+#ifndef MAEMO  
        if (compose_force_window_origin)
                gtk_widget_set_uposition(window, prefs_common.compose_x, 
                                 prefs_common.compose_y);
-
+#endif
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(compose_delete_cb), compose);
        MANAGE_WINDOW_SIGNALS_CONNECT(window);
@@ -6310,8 +6311,17 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
        paned = gtk_vpaned_new();
        gtk_paned_set_gutter_size(GTK_PANED(paned), 12);
        gtk_container_add(GTK_CONTAINER(vbox2), paned);
+#ifdef MAEMO
+       if( maemo_mainwindow_is_fullscreen(mainwindow_get_mainwindow()->window) )
+               gtk_widget_set_size_request(edit_vbox, -1, mode == COMPOSE_NEW ? 300 : 280);
+       else
+               gtk_widget_set_size_request(edit_vbox, -1, mode == COMPOSE_NEW ? 250 : 230);
+       gtk_paned_add1(GTK_PANED(paned), edit_vbox);
+       gtk_paned_add2(GTK_PANED(paned), notebook);
+#else
        gtk_paned_add1(GTK_PANED(paned), notebook);
        gtk_paned_add2(GTK_PANED(paned), edit_vbox);
+#endif
        gtk_widget_show_all(paned);
 
 
@@ -6503,6 +6513,10 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
                gtk_widget_realize(window);
        } else {
                gtk_widget_show(window);
+#ifdef MAEMO
+               maemo_window_full_screen_if_needed(GTK_WINDOW(window));
+               maemo_connect_key_press_to_mainwindow(GTK_WINDOW(window));
+#endif
        }
        
        return compose;
index 3df356a..498cc77 100644 (file)
@@ -2014,6 +2014,28 @@ static gboolean postpone_select(void *data)
        return FALSE;
 }
 
+void folderview_close_opened(FolderView *folderview)
+{
+       if (folderview->opened) {
+               FolderItem *olditem;
+               
+               olditem = gtk_ctree_node_get_row_data(folderview->ctree, folderview->opened);
+               if (olditem) {
+                       gchar *buf = g_strdup_printf(_("Closing Folder %s..."), 
+                               olditem->path ? olditem->path:olditem->name);
+                       /* will be null if we just moved the previously opened folder */
+                       STATUSBAR_PUSH(folderview->mainwin, buf);
+                       main_window_cursor_wait(folderview->mainwin);
+                       g_free(buf);
+                       summary_save_prefs_to_folderitem(folderview->summaryview, olditem);
+                       summary_show(folderview->summaryview, NULL);
+                       folder_item_close(olditem);
+                       main_window_cursor_normal(folderview->mainwin);
+                       STATUSBAR_POP(folderview->mainwin);
+               }
+       }
+       folderview->opened = NULL;
+}
 static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
                                gint column, FolderView *folderview)
 {
@@ -2058,24 +2080,7 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
 
        /* Save cache for old folder */
        /* We don't want to lose all caches if sylpheed crashed */
-       if (folderview->opened) {
-               FolderItem *olditem;
-               
-               olditem = gtk_ctree_node_get_row_data(ctree, folderview->opened);
-               if (olditem) {
-                       buf = g_strdup_printf(_("Closing Folder %s..."), 
-                               olditem->path ? olditem->path:olditem->name);
-                       /* will be null if we just moved the previously opened folder */
-                       STATUSBAR_PUSH(folderview->mainwin, buf);
-                       main_window_cursor_wait(folderview->mainwin);
-                       g_free(buf);
-                       summary_save_prefs_to_folderitem(folderview->summaryview, olditem);
-                       summary_show(folderview->summaryview, NULL);
-                       folder_item_close(olditem);
-                       main_window_cursor_normal(folderview->mainwin);
-                       STATUSBAR_POP(folderview->mainwin);
-               }
-       }
+       folderview_close_opened(folderview);
 
        /* CLAWS: set compose button type: news folder items 
         * always have a news folder as parent */
index b014e5b..3daccb8 100644 (file)
@@ -132,5 +132,6 @@ void folderview_finish_dnd          (const gchar            *data,
                                         GdkDragContext         *drag_context,
                                         guint                   time, 
                                         FolderItem             *item);
+void folderview_close_opened           (FolderView             *folderview);
 
 #endif /* __FOLDERVIEW_H__ */
index 28e706b..1607983 100644 (file)
@@ -9,6 +9,7 @@ static char *TEAM_LIST[] = {
 "Paul Mangan <paul@claws-mail.org>",
 "Martin Schaaf <mascha1@users.sf.net>",
 "Fabien Vantard <fzzzzz@gmail.com>",
+"Fabien Vantard <fzzzzz@gmail.com>",
 NULL
 };
 
@@ -88,6 +89,7 @@ static char *CONTRIBS_LIST[] = {
 "Fabio Junior Beneditto",
 "M. Benkmann",
 "Wilbert Berendsen",
+"Jean-Luc Biord",
 "Eugene Brevdo",
 "André Filipe de Assunção e Brito",
 "Henrik Carlqvist",
index 705a6e3..a0750a5 100644 (file)
@@ -1569,6 +1569,16 @@ gboolean gtkut_tree_model_get_iter_last(GtkTreeModel *model,
        return gtk_tree_model_iter_nth_child(model, iter, NULL, count - 1);
 }
 
+#ifdef MAEMO
+HildonWindow *gtkut_window_new         (GtkWindowType   type,
+                                        const gchar    *class)
+{
+       HildonWindow *window = HILDON_WINDOW(hildon_window_new());
+       gtk_window_set_role(GTK_WINDOW(window), class);
+       hildon_program_add_window(hildon_program(), window);
+       return window;
+}
+#else
 GtkWidget *gtkut_window_new            (GtkWindowType   type,
                                         const gchar    *class)
 {
@@ -1576,3 +1586,4 @@ GtkWidget *gtkut_window_new               (GtkWindowType   type,
        gtk_window_set_role(GTK_WINDOW(window), class);
        return window;
 }
+#endif
index c307806..bf8dbe5 100644 (file)
 #  include <wchar.h>
 #endif
 
+#ifdef MAEMO
+#include <hildon-widgets/hildon-program.h>
+#include <gtk/gtkmain.h>
+#endif
+
 typedef struct _ComboButton    ComboButton;
 
 struct _ComboButton
@@ -183,8 +188,13 @@ gboolean gtkut_text_view_search_string_backward    (GtkTextView *text, const gchar
 
 GtkWidget *label_window_create(const gchar *str);
 void gtkut_window_popup                        (GtkWidget      *window);
+#ifdef MAEMO
+HildonWindow *gtkut_window_new         (GtkWindowType   type,
+                                        const gchar    *class);
+#else
 GtkWidget *gtkut_window_new            (GtkWindowType   type,
                                         const gchar    *class);
+#endif
 
 void gtkut_widget_get_uposition                (GtkWidget      *widget,
                                         gint           *px,
index 5f6afd6..d2c761d 100644 (file)
@@ -251,6 +251,10 @@ void log_window_show(LogWindow *logwin)
        gtk_text_view_scroll_mark_onscreen(text, mark);
 
        gtk_widget_show(logwin->window);
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(logwin->window));
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(logwin->window));
+#endif
 }
 
 static void log_window_jump_to_error(LogWindow *logwin)
index 03c75f7..d73dbe6 100644 (file)
 #include "menu.h"
 #include "utils.h"
 
+#ifdef MAEMO
+#include <hildon-widgets/hildon-program.h>
+#include <gtk/gtkmain.h>
+#endif
+
 static void connect_accel_change_signals(GtkWidget* widget, GtkWidget *wid2) ;
 
 
@@ -42,14 +47,23 @@ GtkWidget *menubar_create(GtkWidget *window, GtkItemFactoryEntry *entries,
                          guint n_entries, const gchar *path, gpointer data)
 {
        GtkItemFactory *factory;
-
+       GtkWidget *menubar;
+       
+#ifdef MAEMO
+       factory = gtk_item_factory_new(GTK_TYPE_MENU, path, NULL);
+#else
        factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, path, NULL);
+#endif
        gtk_item_factory_set_translate_func(factory, menu_translate,
                                            NULL, NULL);
        gtk_item_factory_create_items(factory, n_entries, entries, data);
        gtk_window_add_accel_group (GTK_WINDOW (window), factory->accel_group);
 
-       return gtk_item_factory_get_widget(factory, path);
+       menubar  = gtk_item_factory_get_widget(factory, path);
+#ifdef MAEMO
+       hildon_window_set_menu(HILDON_WINDOW(window), GTK_MENU(menubar));
+#endif
+       return menubar;
 }
 
 GtkWidget *menu_create_items(GtkItemFactoryEntry *entries,
index 9dc7ac8..07cbabe 100644 (file)
@@ -432,8 +432,14 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages, gpointer dat
                         G_CALLBACK(apply_button_clicked), prefswindow);
        g_signal_connect(G_OBJECT(prefswindow->window), "delete_event", 
                         G_CALLBACK(window_closed), prefswindow);
+
+#ifdef MAEMO
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(prefswindow->window));
+#else
        g_signal_connect(G_OBJECT(prefswindow->window), "key_press_event",
                           G_CALLBACK(prefswindow_key_pressed), &(prefswindow->window));
+#endif
+
        /* connect to callback only if we hhave non-NULL pointers to store size to */
        if (prefswindow->save_width && prefswindow->save_height) {
                g_signal_connect(G_OBJECT(prefswindow->window), "size_allocate",
@@ -450,7 +456,6 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages, gpointer dat
                        geometry.min_height = 550;
                }
        }
-
        gtk_window_set_geometry_hints(GTK_WINDOW(prefswindow->window), NULL, &geometry,
                                      GDK_HINT_MIN_SIZE);
        if (prefswindow->save_width && prefswindow->save_height) {
@@ -459,6 +464,9 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages, gpointer dat
        }
 
        gtk_widget_show(prefswindow->window);
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(prefswindow->window));
+#endif
 }
 
 void prefswindow_open(const gchar *title, GSList *prefs_pages, gpointer data,
index 17d0e12..76e391f 100644 (file)
 
 #include "timing.h"
 
+#ifdef MAEMO
+#include <hildon-widgets/hildon-program.h>
+#include <gtk/gtkmain.h>
+#include <libosso.h>
+
+#define OSSO_EXAMPLE_NAME    "claws-mail"
+#define OSSO_EXAMPLE_SERVICE "org.maemo."OSSO_EXAMPLE_NAME
+#define OSSO_EXAMPLE_OBJECT  "/org/maemo/"OSSO_EXAMPLE_NAME
+#define OSSO_EXAMPLE_IFACE   "org.maemo."OSSO_EXAMPLE_NAME
+
+typedef struct _AppData AppData;
+struct _AppData {
+    HildonProgram *program;
+    HildonWindow *window;
+    osso_context_t *osso_context;
+};
+#endif
+
 gchar *prog_version;
 gchar *argv0;
 
@@ -186,6 +204,34 @@ static void exit_claws                     (MainWindow *mainwin);
 }
 
 static MainWindow *static_mainwindow;
+
+#ifdef MAEMO
+static HildonProgram *static_hildonprogram;
+void exit_event_handler(gboolean die_now, gpointer data)
+{
+       AppData *appdata;
+       appdata = (AppData *) data;
+       /* Do whatever application needs to do before exiting */
+       exit_claws(static_mainwindow);
+       hildon_banner_show_information(GTK_WIDGET(appdata->window), NULL,
+                                   _("Exiting..."));
+
+}
+
+/* Callback for normal D-BUS messages */
+gint dbus_req_handler(const gchar * interface, const gchar * method,
+                      GArray * arguments, gpointer data,
+                      osso_rpc_t * retval)
+{
+    AppData *appdata;
+    appdata = (AppData *) data;
+
+    osso_system_note_infoprint(appdata->osso_context, method, retval);
+    osso_rpc_free_val(retval);
+
+    return OSSO_OK;
+}
+#endif
 static gboolean emergency_exit = FALSE;
 
 #ifdef HAVE_STARTUP_NOTIFICATION
@@ -560,6 +606,10 @@ void main_set_show_at_startup(gboolean show)
 
 int main(int argc, char *argv[])
 {
+#ifdef MAEMO
+       osso_context_t *osso_context;
+       osso_return_t result;
+#endif
        gchar *userrc;
        MainWindow *mainwin;
        FolderView *folderview;
@@ -620,6 +670,13 @@ int main(int argc, char *argv[])
        gtk_set_locale();
        gtk_init(&argc, &argv);
 
+#ifdef MAEMO
+       osso_context = osso_initialize(PACKAGE, VERSION, TRUE, NULL);
+       if (osso_context == NULL) {
+               return OSSO_ERROR;
+       }
+       static_hildonprogram = HILDON_PROGRAM(hildon_program_get_instance());
+#endif 
        gdk_rgb_init();
        gtk_widget_set_default_colormap(gdk_rgb_get_colormap());
        gtk_widget_set_default_visual(gdk_rgb_get_visual());
@@ -778,7 +835,29 @@ int main(int argc, char *argv[])
        news_gtk_init();
 
        mainwin = main_window_create();
+#ifdef MAEMO
+       AppData *appdata;
+       appdata = g_new0(AppData, 1);
+       appdata->program = static_hildonprogram;
+       appdata->window = mainwin->window;
+       appdata->osso_context = osso_context;
+       result = osso_rpc_set_cb_f(appdata->osso_context, 
+                               OSSO_EXAMPLE_SERVICE, 
+                               OSSO_EXAMPLE_OBJECT, 
+                               OSSO_EXAMPLE_IFACE,
+                               dbus_req_handler, appdata);
+       if (result != OSSO_OK) {
+               return OSSO_ERROR;
+       }
 
+       /* Add handler for Exit D-BUS messages */
+       result = osso_application_set_exit_cb(appdata->osso_context,
+                                               exit_event_handler,
+                                               (gpointer) appdata);
+       if (result != OSSO_OK) {
+               return OSSO_ERROR;
+       }
+#endif
        manage_window_focus_in(mainwin->window, NULL, NULL);
        folderview = mainwin->folderview;
 
@@ -989,6 +1068,9 @@ int main(int argc, char *argv[])
 
        gtk_main();
 
+#ifdef MAEMO
+       osso_deinitialize(osso_context);
+#endif
        exit_claws(mainwin);
 
        return 0;
@@ -1716,3 +1798,10 @@ static void install_basic_sighandlers()
        sigprocmask(SIG_UNBLOCK, &mask, 0);
 #endif /* !G_OS_WIN32 */
 }
+
+#ifdef MAEMO
+HildonProgram *hildon_program()
+{
+       return static_hildonprogram;
+}
+#endif
index 853bcc3..d77eb5d 100644 (file)
@@ -565,6 +565,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/Layout/_Three columns"),    NULL, set_layout_cb, VERTICAL_LAYOUT, "/View/Layout/Standard"},
        {N_("/_View/Layout/_Wide message"),     NULL, set_layout_cb, WIDE_LAYOUT, "/View/Layout/Standard"},
        {N_("/_View/Layout/W_ide message list"),NULL, set_layout_cb, WIDE_MSGLIST_LAYOUT, "/View/Layout/Standard"},
+       {N_("/_View/Layout/_Little screen"),    NULL, set_layout_cb, LITTLE_LAYOUT, "/View/Layout/Standard"},
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Sort"),                    NULL, NULL, 0, "<Branch>"},
        {N_("/_View/_Sort/by _number"),         NULL, sort_summary_cb, SORT_BY_NUMBER, "<RadioItem>"},
@@ -1052,7 +1053,6 @@ static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refr
                                   GDK_1+i, GDK_CONTROL_MASK,
                                   GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
        }
-
        gtk_widget_show(menu);
        gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
        mainwin->colorlabel_menu = menu;
@@ -1471,8 +1471,10 @@ MainWindow *main_window_create()
                         G_CALLBACK(mainwindow_visibility_event_cb), mainwin);
        gtk_widget_add_events(GTK_WIDGET(window), GDK_VISIBILITY_NOTIFY_MASK);
 
-       if (prefs_common.layout_mode == VERTICAL_LAYOUT)
+       if (prefs_common.layout_mode == VERTICAL_LAYOUT ||
+           prefs_common.layout_mode == LITTLE_LAYOUT) {
                summary_relayout(mainwin->summaryview); 
+       }
 
        gtk_widget_show(mainwin->window);
 
@@ -1913,9 +1915,16 @@ static void main_window_separation_change(MainWindow *mainwin, LayoutType layout
        gtk_widget_unref(message_wid);
 }
 
-static void mainwin_reset_paned(GtkPaned *paned)
+void mainwindow_reset_paned(GtkPaned *paned)
 {
                gint min, max, mid;
+
+               if (gtk_paned_get_child1(GTK_PANED(paned)))
+                       gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
+               if (gtk_paned_get_child2(GTK_PANED(paned)))
+                       gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
+
+GTK_EVENTS_FLUSH();
                g_object_get (G_OBJECT(paned),
                                "min-position",
                                &min, NULL);
@@ -1923,10 +1932,37 @@ static void mainwin_reset_paned(GtkPaned *paned)
                                "max-position",
                                &max, NULL);
                mid = (min+max)/2;
-
                gtk_paned_set_position(GTK_PANED(paned), mid);
 }
 
+static void mainwin_paned_show_first(GtkPaned *paned)
+{
+               gint max;
+               g_object_get (G_OBJECT(paned),
+                               "max-position",
+                               &max, NULL);
+
+               if (gtk_paned_get_child1(GTK_PANED(paned)))
+                       gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
+               if (gtk_paned_get_child2(GTK_PANED(paned)))
+                       gtk_widget_hide(gtk_paned_get_child2(GTK_PANED(paned)));
+               gtk_paned_set_position(GTK_PANED(paned), max);
+}
+
+static void mainwin_paned_show_last(GtkPaned *paned)
+{
+               gint min;
+               g_object_get (G_OBJECT(paned),
+                               "min-position",
+                               &min, NULL);
+
+               if (gtk_paned_get_child1(GTK_PANED(paned)))
+                       gtk_widget_hide(gtk_paned_get_child1(GTK_PANED(paned)));
+               if (gtk_paned_get_child2(GTK_PANED(paned)))
+                       gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
+               gtk_paned_set_position(GTK_PANED(paned), min);
+}
+
 void main_window_toggle_message_view(MainWindow *mainwin)
 {
        SummaryView *summaryview = mainwin->summaryview;
@@ -1936,6 +1972,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
        switch (prefs_common.layout_mode) {
        case NORMAL_LAYOUT:
        case VERTICAL_LAYOUT:
+       case LITTLE_LAYOUT:
                ppaned = mainwin->vpaned;
                container = mainwin->hpaned;
                if (ppaned->parent != NULL) {
@@ -2653,18 +2690,28 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        GtkWidget *vbox_body = mainwin->vbox_body;
        GtkItemFactory *ifactory = mainwin->menu_factory;
        GtkWidget *menuitem;
-
+       gboolean first_set = (mainwin->hpaned == NULL);
        debug_print("Setting widgets... ");
 
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
+       if (layout_mode == LITTLE_LAYOUT && first_set) {
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
                                    prefs_common.folderview_width,
                                    prefs_common.folderview_height);
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
+                                   0,0);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
+                                   0,0);
+       } else {
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
+                                   prefs_common.folderview_width,
+                                   prefs_common.folderview_height);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
                                    prefs_common.summaryview_width,
                                    prefs_common.summaryview_height);
-       gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
                                    prefs_common.msgview_width,
                                    prefs_common.msgview_height);
+       }
 
        mainwin->messageview->statusbar = mainwin->statusbar;
        mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
@@ -2677,10 +2724,12 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                        gtk_widget_destroy(mainwin->hpaned);
        }
 
-       menu_set_sensitive(ifactory, "/View/Show or hide/Message view", (layout_mode != WIDE_MSGLIST_LAYOUT));
+       menu_set_sensitive(ifactory, "/View/Show or hide/Message view", 
+               (layout_mode != WIDE_MSGLIST_LAYOUT && layout_mode != LITTLE_LAYOUT));
        switch (layout_mode) {
        case VERTICAL_LAYOUT:
        case NORMAL_LAYOUT:
+       case LITTLE_LAYOUT:
                hpaned = gtk_hpaned_new();
                if (layout_mode == VERTICAL_LAYOUT)
                        vpaned = gtk_hpaned_new();
@@ -2704,6 +2753,9 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                gtk_paned_add2(GTK_PANED(vpaned),
                               GTK_WIDGET_PTR(mainwin->messageview));
                gtk_widget_show(vpaned);
+               if (layout_mode == LITTLE_LAYOUT && first_set) {
+                       mainwin_paned_show_first(GTK_PANED(hpaned));
+               }
                gtk_widget_queue_resize(vpaned);
                break;
        case WIDE_LAYOUT:
@@ -2761,6 +2813,28 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        mainwin->hpaned = hpaned;
        mainwin->vpaned = vpaned;
 
+       if (layout_mode == LITTLE_LAYOUT) {
+               if (mainwin->messageview->visible)
+                       main_window_toggle_message_view(mainwin);
+       } 
+
+       if (layout_mode == LITTLE_LAYOUT && first_set) {
+               gtk_widget_realize(mainwin->window);
+               gtk_widget_realize(mainwin->folderview->ctree);
+               gtk_widget_realize(mainwin->summaryview->hbox);
+               gtk_widget_realize(mainwin->summaryview->hbox_l);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->folderview),
+                                   prefs_common.folderview_width,
+                                   prefs_common.folderview_height);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->summaryview),
+                                   0,0);
+               gtk_widget_set_size_request(GTK_WIDGET_PTR(mainwin->messageview),
+                                   0,0);
+               gtk_widget_set_size_request(GTK_WIDGET(mainwin->window),
+                               prefs_common.mainwin_width,
+                               prefs_common.mainwin_height);
+               gtk_paned_set_position(GTK_PANED(mainwin->hpaned), 800);
+       } 
        /* remove headerview if not in prefs */
        headerview_set_visibility(mainwin->messageview->headerview,
                                  prefs_common.display_header_pane);
@@ -2817,6 +2891,9 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        case WIDE_MSGLIST_LAYOUT:
                SET_CHECK_MENU_ACTIVE("/View/Layout/Wide message list", TRUE);
                break;
+       case LITTLE_LAYOUT:
+               SET_CHECK_MENU_ACTIVE("/View/Layout/Little screen", TRUE);
+               break;
        }
 #undef SET_CHECK_MENU_ACTIVE
 
@@ -2908,7 +2985,6 @@ static void main_window_size_allocate_cb(GtkWidget *widget,
                                         gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
-
        main_window_get_size(mainwin);
 }
 
@@ -3066,7 +3142,7 @@ static void set_layout_cb(MainWindow *mainwin, guint action,
                               GtkWidget *widget)
 {
        LayoutType layout_mode = action;
-
+       LayoutType old_layout_mode = prefs_common.layout_mode;
        if (mainwin->menu_lock_count) {
                return;
        }
@@ -3078,12 +3154,20 @@ static void set_layout_cb(MainWindow *mainwin, guint action,
                return;
        }
        
-       if (!mainwin->messageview->visible)
+       if (!mainwin->messageview->visible && layout_mode != LITTLE_LAYOUT)
+               main_window_toggle_message_view(mainwin);
+       else if (mainwin->messageview->visible && layout_mode == LITTLE_LAYOUT)
                main_window_toggle_message_view(mainwin);
 
        main_window_separation_change(mainwin, layout_mode);
-
-       mainwin_reset_paned(GTK_PANED(mainwin->vpaned));
+       mainwindow_reset_paned(GTK_PANED(mainwin->vpaned));
+       if (old_layout_mode == LITTLE_LAYOUT && layout_mode != LITTLE_LAYOUT) {
+               mainwindow_reset_paned(GTK_PANED(mainwin->hpaned));
+       }
+       if (old_layout_mode != LITTLE_LAYOUT && layout_mode == LITTLE_LAYOUT) {
+               mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
+               mainwindow_exit_folder(mainwin);
+       }
        summary_relayout(mainwin->summaryview); 
 }
 
@@ -3890,6 +3974,15 @@ gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                        folderview_select_next_unread(mainwin->folderview, TRUE);
                }
                break;
+#ifdef MAEMO
+       case GDK_F6:
+               if (maemo_mainwindow_is_fullscreen(widget)) {
+                       gtk_window_unfullscreen(GTK_WINDOW(widget));
+                } else {
+                       gtk_window_fullscreen(GTK_WINDOW(widget));
+                }
+               break;
+#endif
        default:
                break;
        }
@@ -4034,3 +4127,40 @@ void mainwindow_jump_to(const gchar *target)
        
        g_free(tmp);
 }
+
+void mainwindow_exit_folder(MainWindow *mainwin) {
+       if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+               folderview_close_opened(mainwin->folderview);
+               mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
+               mainwin->in_folder = FALSE;
+       }
+}
+
+void mainwindow_enter_folder(MainWindow *mainwin) {
+       if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+               mainwin_paned_show_last(GTK_PANED(mainwin->hpaned));
+               mainwin->in_folder = TRUE;
+       }
+}
+
+#ifdef MAEMO
+gboolean maemo_mainwindow_is_fullscreen(GtkWidget *widget)
+{
+       gint w, h;
+       gtk_window_get_size(GTK_WINDOW(widget), &w, &h); 
+       return (w == 800);
+}
+
+void maemo_window_full_screen_if_needed (GtkWindow *window)
+{
+       if (maemo_mainwindow_is_fullscreen(mainwindow_get_mainwindow()->window)) {
+               gtk_window_fullscreen(GTK_WINDOW(window));
+       }
+}
+
+void maemo_connect_key_press_to_mainwindow (GtkWindow *window)
+{
+       g_signal_connect(G_OBJECT(window), "key_press_event",
+                        G_CALLBACK(mainwindow_key_pressed), mainwindow_get_mainwindow());
+}
+#endif
index cf86280..7f03508 100644 (file)
@@ -65,7 +65,8 @@ typedef enum
        NORMAL_LAYOUT    = 0,
        VERTICAL_LAYOUT  = 1 << 0,
        WIDE_LAYOUT = 1 << 1,
-       WIDE_MSGLIST_LAYOUT = 1 << 2
+       WIDE_MSGLIST_LAYOUT = 1 << 2,
+       LITTLE_LAYOUT
 } LayoutType;
 
 typedef enum
@@ -132,6 +133,7 @@ struct _MainWindow
 #ifdef HAVE_LIBSM
        gpointer smc_conn;
 #endif
+       gboolean         in_folder;
 };
 
 MainWindow *main_window_create         (void);
@@ -204,5 +206,15 @@ void mainwindow_learn                            (MainWindow *mainwin,
 void mainwindow_jump_to                              (const gchar       *target);
 void mainwindow_show_error                   (void);
 void mainwindow_clear_error                  (MainWindow *mainwin);
-gboolean mainwindow_is_obscured      (void);
+gboolean mainwindow_is_obscured                      (void);
+void mainwindow_exit_folder                  (MainWindow *mainwin);
+void mainwindow_enter_folder                 (MainWindow *mainwin);
+void mainwindow_reset_paned                  (GtkPaned *paned);
+
+#ifdef MAEMO
+gboolean maemo_mainwindow_is_fullscreen               (GtkWidget *widget);
+void maemo_window_full_screen_if_needed               (GtkWindow *window);
+void maemo_connect_key_press_to_mainwindow    (GtkWindow *window);
+#endif
+
 #endif /* __MAINWINDOW_H__ */
index 90b33f8..1dd3107 100644 (file)
@@ -472,9 +472,12 @@ static MessageView *messageview_create_with_new_window_visible(MainWindow *mainw
                         msgview);
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(messageview_delete_cb), msgview);
+#ifdef MAEMO
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(window));
+#else
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(key_pressed), msgview);
-
+#endif
        messageview_add_toolbar(msgview, window);
 
        if (show) {
@@ -900,6 +903,9 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
        }
 
        g_free(file);
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(messageview->window));
+#endif
 
        return 0;
 }
@@ -918,6 +924,8 @@ void messageview_reflect_prefs_pixmap_theme(void)
 
 void messageview_clear(MessageView *messageview)
 {
+       if (!messageview)
+               return;
        procmsg_msginfo_free(messageview->msginfo);
        messageview->msginfo = NULL;
        messageview->filtered = FALSE;
@@ -931,6 +939,12 @@ void messageview_destroy(MessageView *messageview)
        debug_print("destroy messageview\n");
        messageview_list = g_list_remove(messageview_list, messageview);
 
+       if (messageview->mainwin->summaryview->messageview == messageview)
+               messageview->mainwin->summaryview->messageview = NULL;
+
+       if (messageview->mainwin->summaryview->ext_messageview == messageview)
+               messageview->mainwin->summaryview->ext_messageview = NULL;
+
        if (!messageview->deferred_destroy) {
                hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
                              messageview->msginfo_update_callback_id);
index 32cdb1d..2e17e33 100644 (file)
@@ -351,10 +351,15 @@ static PrefParam param[] = {
         &receive.rmmail_checkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
 
+#ifndef MAEMO
        {"message_leave_time", "7", &tmp_ac_prefs.msg_leave_time, P_INT,
         &receive.leave_time_entry,
         prefs_set_data_from_entry, prefs_set_entry},
-
+#else
+       {"message_leave_time", "30", &tmp_ac_prefs.msg_leave_time, P_INT,
+        &receive.leave_time_entry,
+        prefs_set_data_from_entry, prefs_set_entry},
+#endif
        {"get_all_mail", "FALSE", &tmp_ac_prefs.getall, P_BOOL,
         &receive.getall_checkbtn,
         prefs_set_data_from_toggle, prefs_set_toggle},
index 46e6299..359370c 100644 (file)
@@ -101,7 +101,6 @@ static PrefParam param_os_specific[] = {
          &prefs_common.smallfont,              P_STRING, NULL, NULL, NULL},
        {"normal_font_gtk2",    "Sans 9",
          &prefs_common.normalfont,             P_STRING, NULL, NULL, NULL},
-
        /* Message */
        {"attach_save_directory", NULL,
         &prefs_common.attach_save_dir, P_STRING, NULL, NULL, NULL},
@@ -162,7 +161,7 @@ static PrefParam param[] = {
        P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_cmd", "", &SPECIFIC_PREFS.newmail_notify_cmd, P_STRING,
         NULL, NULL, NULL},
-       {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
+       {"receive_dialog_mode", "2", &prefs_common.recv_dialog_mode, P_ENUM,
         NULL, NULL, NULL},
        {"receivewin_width", "460", &prefs_common.receivewin_width, P_INT,
         NULL, NULL, NULL},
@@ -178,7 +177,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"confirm_send_queued_messages", "FALSE", &prefs_common.confirm_send_queued_messages,
         P_BOOL, NULL, NULL, NULL},
-       {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
+       {"send_dialog_mode", "1", &prefs_common.send_dialog_mode, P_ENUM,
         NULL, NULL, NULL},
        {"sendwin_width", "460", &prefs_common.sendwin_width, P_INT,
         NULL, NULL, NULL},
@@ -296,6 +295,7 @@ static PrefParam param[] = {
          &prefs_common.normalfont_gtk1,        P_STRING, NULL, NULL, NULL},
 
        /* new fonts */
+#ifndef MAEMO
        {"widget_font_gtk2",    NULL,
          &SPECIFIC_PREFS.widgetfont,           P_STRING, NULL, NULL, NULL},
        {"message_font_gtk2",   "Monospace 9",
@@ -306,7 +306,18 @@ static PrefParam param[] = {
          &SPECIFIC_PREFS.smallfont,            P_STRING, NULL, NULL, NULL},
        {"normal_font_gtk2",    "Sans 9",
          &SPECIFIC_PREFS.normalfont,           P_STRING, NULL, NULL, NULL},
-
+#else
+       {"widget_font_gtk2",    NULL,
+         &SPECIFIC_PREFS.widgetfont,           P_STRING, NULL, NULL, NULL},
+       {"message_font_gtk2",   "Monospace 8",
+        &SPECIFIC_PREFS.textfont,                      P_STRING, NULL, NULL, NULL},
+        {"print_font_gtk2",     "Monospace 8",
+         &SPECIFIC_PREFS.printfont,             P_STRING, NULL, NULL, NULL},
+       {"small_font_gtk2",     "Sans 8",
+         &SPECIFIC_PREFS.smallfont,            P_STRING, NULL, NULL, NULL},
+       {"normal_font_gtk2",    "Sans 8",
+         &SPECIFIC_PREFS.normalfont,           P_STRING, NULL, NULL, NULL},
+#endif
        /* custom colors */
        {"custom_color1", "#ff9900", &prefs_common.custom_colorlabel[0].color, P_COLOR,
         NULL, NULL, NULL},
@@ -400,22 +411,29 @@ static PrefParam param[] = {
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
+#ifndef MAEMO
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
         NULL, NULL, NULL},
+#else
+       {"toolbar_style", "1", &prefs_common.toolbar_style, P_ENUM,
+        NULL, NULL, NULL},
+#endif
        {"toolbar_detachable", "FALSE", &prefs_common.toolbar_detachable, P_BOOL,
         NULL, NULL, NULL},
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
         NULL, NULL, NULL},
+#ifndef MAEMO
        {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
         NULL, NULL, NULL},
-
+#else
+       {"show_searchbar", "FALSE", &prefs_common.show_searchbar, P_BOOL,
+        NULL, NULL, NULL},
+#endif
 
        {"summary_col_show_mark", "TRUE",
         &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_unread", "TRUE",
         &prefs_common.summary_col_visible[S_COL_STATUS], P_BOOL, NULL, NULL, NULL},
-       {"summary_col_show_mime", "TRUE",
-        &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_subject", "TRUE",
         &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_from", "TRUE",
@@ -424,6 +442,8 @@ static PrefParam param[] = {
         &prefs_common.summary_col_visible[S_COL_TO], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_date", "TRUE",
         &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
+       {"summary_col_show_mime", "TRUE",
+        &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_size", "TRUE",
         &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_number", "FALSE",
@@ -462,12 +482,22 @@ static PrefParam param[] = {
         &prefs_common.summary_col_size[S_COL_STATUS], P_INT, NULL, NULL, NULL},
        {"summary_col_size_mime", "10",
         &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
+#ifndef MAEMO
        {"summary_col_size_subject", "200",
         &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
        {"summary_col_size_from", "120",
         &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
        {"summary_col_size_to", "120",
         &prefs_common.summary_col_size[S_COL_TO], P_INT, NULL, NULL, NULL},
+#else
+       {"summary_col_size_subject", "300",
+        &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
+       {"summary_col_size_from", "150",
+        &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
+       {"summary_col_size_to", "150",
+        &prefs_common.summary_col_size[S_COL_TO], P_INT, NULL, NULL, NULL},
+
+#endif
        {"summary_col_size_date", "118",
         &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
        {"summary_col_size_size", "45",
@@ -509,6 +539,7 @@ static PrefParam param[] = {
        {"folder_col_pos_total", "3",
         &prefs_common.folder_col_pos[F_COL_TOTAL], P_INT, NULL, NULL, NULL},
 
+#ifndef MAEMO
        {"folder_col_size_folder", "120",
         &prefs_common.folder_col_size[F_COL_FOLDER], P_INT, NULL, NULL, NULL},
        {"folder_col_size_new", "32",
@@ -517,7 +548,16 @@ static PrefParam param[] = {
         &prefs_common.folder_col_size[F_COL_UNREAD], P_INT, NULL, NULL, NULL},
        {"folder_col_size_total", "32",
         &prefs_common.folder_col_size[F_COL_TOTAL], P_INT, NULL, NULL, NULL},
-
+#else
+       {"folder_col_size_folder", "400",
+        &prefs_common.folder_col_size[F_COL_FOLDER], P_INT, NULL, NULL, NULL},
+       {"folder_col_size_new", "32",
+        &prefs_common.folder_col_size[F_COL_NEW], P_INT, NULL, NULL, NULL},
+       {"folder_col_size_unread", "32",
+        &prefs_common.folder_col_size[F_COL_UNREAD], P_INT, NULL, NULL, NULL},
+       {"folder_col_size_total", "32",
+        &prefs_common.folder_col_size[F_COL_TOTAL], P_INT, NULL, NULL, NULL},
+#endif
        {"summaryview_width", "500", &prefs_common.summaryview_width, P_INT,
         NULL, NULL, NULL},
        {"summaryview_height", "244", &prefs_common.summaryview_height, P_INT,
@@ -546,6 +586,7 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
         NULL, NULL, NULL},
+#ifndef MAEMO
        {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
         NULL, NULL, NULL},
        {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
@@ -562,6 +603,24 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"compose_height", "560", &prefs_common.compose_height, P_INT,
         NULL, NULL, NULL},
+#else
+       {"mainwin_width", "700", &prefs_common.mainwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"mainwin_height", "470", &prefs_common.mainwin_height, P_INT,
+        NULL, NULL, NULL},
+       {"messagewin_width", "700", &prefs_common.msgwin_width, P_INT,
+        NULL, NULL, NULL},
+       {"messagewin_height", "470", &prefs_common.msgwin_height, P_INT,
+        NULL, NULL, NULL},
+       {"sourcewin_width", "700", &prefs_common.sourcewin_width, P_INT,
+        NULL, NULL, NULL},
+       {"sourcewin_height", "470", &prefs_common.sourcewin_height, P_INT,
+        NULL, NULL, NULL},
+       {"compose_width", "700", &prefs_common.compose_width, P_INT,
+        NULL, NULL, NULL},
+       {"compose_height", "470", &prefs_common.compose_height, P_INT,
+        NULL, NULL, NULL},
+#endif
        {"compose_x", "0", &prefs_common.compose_x, P_INT,
         NULL, NULL, NULL},
        {"compose_y", "0", &prefs_common.compose_y, P_INT,
@@ -638,9 +697,13 @@ static PrefParam param[] = {
         &SPECIFIC_PREFS.mime_open_cmd,     P_STRING, NULL, NULL, NULL},
 
        /* Interface */
+#ifndef MAEMO
        {"layout_mode", "0", &prefs_common.layout_mode, P_INT,
         NULL, NULL, NULL},
-
+#else
+       {"layout_mode", "5", &prefs_common.layout_mode, P_INT,
+        NULL, NULL, NULL},
+#endif
        /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
         NULL, NULL, NULL}, */
        {"always_show_message_when_selected", "FALSE",
@@ -700,8 +763,13 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
         NULL, NULL, NULL},
+#ifndef MAEMO
        {"summary_quicksearch_recurse", "1", &prefs_common.summary_quicksearch_recurse, P_INT,
         NULL, NULL, NULL},
+#else
+       {"summary_quicksearch_recurse", "0", &prefs_common.summary_quicksearch_recurse, P_INT,
+        NULL, NULL, NULL},
+#endif
 
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
         P_INT, NULL, NULL, NULL},
index 4b86ac0..09eaba1 100644 (file)
@@ -232,8 +232,12 @@ static void summary_search_create(void)
        gtk_container_set_border_width(GTK_CONTAINER (window), 8);
        g_signal_connect(G_OBJECT(window), "delete_event",
                         G_CALLBACK(gtk_widget_hide_on_delete), NULL);
+#ifdef MAEMO
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(window));
+#else
        g_signal_connect(G_OBJECT(window), "key_press_event",
                         G_CALLBACK(key_pressed), NULL);
+#endif
        MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox1 = gtk_vbox_new (FALSE, 0);
@@ -482,6 +486,9 @@ static void summary_search_create(void)
        search_window.stop_btn = stop_btn;
        search_window.matcher_list = NULL;
        search_window.is_searching = is_searching;
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(search_window.window));
+#endif
 }
 
 static void summary_search_execute(gboolean backward, gboolean search_all)
index 291466d..80ee3de 100644 (file)
@@ -256,6 +256,10 @@ static GtkWidget *summary_ctree_create     (SummaryView    *summaryview);
 static gint summary_toggle_pressed     (GtkWidget              *eventbox,
                                         GdkEventButton         *event,
                                         SummaryView            *summaryview);
+static gint summary_folder_eventbox_pressed    
+                                       (GtkWidget              *eventbox,
+                                        GdkEventButton         *event,
+                                        SummaryView            *summaryview);
 static gboolean summary_button_pressed (GtkWidget              *ctree,
                                         GdkEventButton         *event,
                                         SummaryView            *summaryview);
@@ -351,7 +355,9 @@ static gboolean summary_drag_motion_cb(GtkWidget      *widget,
                                          gint            y,
                                          guint           time,
                                          SummaryView    *summaryview);
-
+static void summary_drag_end(GtkWidget *widget,
+                                         GdkDragContext *drag_context,
+                                         SummaryView    *summaryview);
 /* custom compare functions for sorting */
 
 static gint summary_cmp_by_mark                (GtkCList               *clist,
@@ -404,7 +410,8 @@ static void summary_find_answers    (SummaryView    *summaryview,
                                         MsgInfo        *msg);
 
 static gboolean summary_update_msg     (gpointer source, gpointer data);
-static gboolean summary_update_folder_item_name(gpointer source, gpointer data);
+static gboolean summary_update_folder_item_hook(gpointer source, gpointer data);
+static gboolean summary_update_folder_hook(gpointer source, gpointer data);
 
 GtkTargetEntry summary_drag_types[2] =
 {
@@ -562,7 +569,6 @@ SummaryView *summary_create(void)
        GtkWidget *toggle_arrow;
        GtkWidget *popupmenu;
        GtkWidget *toggle_search;
-       GtkTooltips *search_tip;
        GtkItemFactory *popupfactory;
        gint n_entries;
        QuickSearch *quicksearch;
@@ -570,6 +576,7 @@ SummaryView *summary_create(void)
        debug_print("Creating summary view...\n");
        summaryview = g_new0(SummaryView, 1);
 
+       summaryview->tips = gtk_tooltips_new();
 #define SUMMARY_VBOX_SPACING 3
        vbox = gtk_vbox_new(FALSE, SUMMARY_VBOX_SPACING);
        
@@ -586,13 +593,12 @@ SummaryView *summary_create(void)
        stat_box2 = gtk_hbox_new(FALSE, 0);
        gtk_widget_show(stat_box2);
        
-       search_tip = gtk_tooltips_new();
        toggle_search = gtk_toggle_button_new();
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_search),
                                     prefs_common.show_searchbar);
        gtk_widget_show(toggle_search);
 
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(search_tip),
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips),
                             toggle_search,
                             _("Toggle quick search bar"), NULL);
        
@@ -693,7 +699,11 @@ SummaryView *summary_create(void)
                hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, summary_update_msg, (gpointer) summaryview);
        summaryview->folder_item_update_callback_id =
                hooks_register_hook(FOLDER_ITEM_UPDATE_HOOKLIST,
-                               summary_update_folder_item_name,
+                               summary_update_folder_item_hook,
+                               (gpointer) summaryview);
+       summaryview->folder_update_callback_id =
+               hooks_register_hook(FOLDER_UPDATE_HOOKLIST,
+                               summary_update_folder_hook,
                                (gpointer) summaryview);
 
        summaryview->target_list = gtk_target_list_new(summary_drag_types, 2);
@@ -713,7 +723,8 @@ SummaryView *summary_create(void)
        else
                quicksearch_hide(quicksearch);
        
-       if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT)
+       if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT ||
+           prefs_common.layout_mode == LITTLE_LAYOUT)
                gtk_widget_hide(summaryview->toggle_eventbox);
 
        return summaryview;
@@ -737,17 +748,23 @@ void summary_relayout(SummaryView *summaryview)
                gtk_box_pack_end(GTK_BOX(summaryview->stat_box), summaryview->statlabel_msgs, FALSE, FALSE, 4);
                gtk_widget_show_all(summaryview->stat_box);
                gtk_widget_show_all(summaryview->stat_box2);
-               if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT)
+               if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT ||
+                   prefs_common.layout_mode == LITTLE_LAYOUT)
                        gtk_widget_hide(summaryview->toggle_eventbox);
                else
                        gtk_widget_show(summaryview->toggle_eventbox);
                break;
        case VERTICAL_LAYOUT:
+       case LITTLE_LAYOUT:
                gtk_box_pack_start(GTK_BOX(summaryview->stat_box), summaryview->hbox_l, TRUE, TRUE, 0);
                gtk_box_pack_start(GTK_BOX(summaryview->stat_box2), summaryview->statlabel_msgs, FALSE, FALSE, 4);
                gtk_widget_show_all(summaryview->stat_box);
                gtk_widget_show_all(summaryview->stat_box2);
-               gtk_widget_show(summaryview->toggle_eventbox);
+               if (prefs_common.layout_mode == LITTLE_LAYOUT)
+                       gtk_widget_hide(summaryview->toggle_eventbox);
+               else
+                       gtk_widget_show(summaryview->toggle_eventbox);
+                       
                break;
        }
        gtk_widget_unref(summaryview->hbox_l);
@@ -793,6 +810,27 @@ static void summary_set_fonts(SummaryView *summaryview)
        pango_font_description_free(font_desc);
 }
 
+static void summary_set_folder_pixmap(SummaryView *summaryview, StockPixmap icon)
+{
+       GtkWidget *pixmap; 
+       if (!summaryview->folder_pixmap_eventbox) {
+               summaryview->folder_pixmap_eventbox = gtk_event_box_new();
+               gtk_widget_show(summaryview->folder_pixmap_eventbox);
+               gtk_box_pack_start(GTK_BOX(summaryview->hbox_l), summaryview->folder_pixmap_eventbox, FALSE, FALSE, 4);
+               gtk_box_reorder_child(GTK_BOX(summaryview->hbox_l), summaryview->folder_pixmap_eventbox, 0); /* search_toggle before */
+               g_signal_connect(G_OBJECT(summaryview->folder_pixmap_eventbox), "button_press_event",
+                        G_CALLBACK(summary_folder_eventbox_pressed),
+                        summaryview);
+       }
+       if (summaryview->folder_pixmap)
+               gtk_widget_destroy(summaryview->folder_pixmap);
+
+       pixmap = stock_pixmap_widget(summaryview->hbox_l, icon);
+       gtk_container_add(GTK_CONTAINER(summaryview->folder_pixmap_eventbox), pixmap);
+       gtk_widget_show(pixmap);
+       summaryview->folder_pixmap = pixmap; 
+}
+
 void summary_init(SummaryView *summaryview)
 {
        GtkWidget *pixmap;
@@ -833,11 +871,7 @@ void summary_init(SummaryView *summaryview)
 
        summary_set_fonts(summaryview);
 
-       pixmap = stock_pixmap_widget(summaryview->hbox_l, STOCK_PIXMAP_DIR_OPEN);
-       gtk_box_pack_start(GTK_BOX(summaryview->hbox_l), pixmap, FALSE, FALSE, 4);
-       gtk_box_reorder_child(GTK_BOX(summaryview->hbox_l), pixmap, 0);
-       gtk_widget_show(pixmap);
-       summaryview->folder_pixmap = pixmap;
+       summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
 
        pixmap = stock_pixmap_widget(summaryview->hbox, STOCK_PIXMAP_QUICKSEARCH);
        gtk_container_add (GTK_CONTAINER(summaryview->toggle_search), pixmap);
@@ -994,9 +1028,15 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
        is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
 
-       if (!is_refresh)
+       if (!is_refresh) {
                main_create_mailing_list_menu (summaryview->mainwin, NULL);
-
+               if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+                       if (item) {
+                               mainwindow_enter_folder(summaryview->mainwin);
+                               gtk_widget_grab_focus(summaryview->ctree);
+                       }
+               }
+       }
        if (!prefs_common.summary_quicksearch_sticky
         && !prefs_common.summary_quicksearch_recurse
         && !quicksearch_is_running(summaryview->quicksearch)
@@ -3002,7 +3042,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
        if (!new_window) {
                if (summaryview->displayed == row)
                        return;
-               else
+               else if (summaryview->messageview)
                        summaryview->messageview->filtered = FALSE;
        }                       
        g_return_if_fail(row != NULL);
@@ -3017,7 +3057,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
        
        g_return_if_fail(msginfo);
 
-       if (new_window) {
+       if (new_window && prefs_common.layout_mode != LITTLE_LAYOUT) {
                MessageView *msgview;
 
                msgview = messageview_create_with_new_window(summaryview->mainwin);
@@ -3025,18 +3065,33 @@ static void summary_display_msg_full(SummaryView *summaryview,
        } else {
                MessageView *msgview;
 
-               msgview = summaryview->messageview;
-               summaryview->last_displayed = summaryview->displayed;
-               summaryview->displayed = row;
-               if (!messageview_is_visible(msgview)) {
-                       main_window_toggle_message_view(summaryview->mainwin);
-                       GTK_EVENTS_FLUSH();
+               if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+                       if (summaryview->ext_messageview == NULL)
+                               summaryview->ext_messageview = messageview_create_with_new_window(summaryview->mainwin);
+                       else
+                               gtkut_window_popup(summaryview->ext_messageview->window);
+                       msgview = summaryview->ext_messageview;
+                       summaryview->last_displayed = summaryview->displayed;
+                       summaryview->displayed = row;
+                       val = messageview_show(msgview, msginfo, all_headers);
+                       if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
+                               gtk_widget_grab_focus(summaryview->ctree);
+                       gtkut_ctree_node_move_if_on_the_edge(ctree, row,
+                               GTK_CLIST(summaryview->ctree)->focus_row);
+               } else {
+                       msgview = summaryview->messageview;
+                       summaryview->last_displayed = summaryview->displayed;
+                       summaryview->displayed = row;
+                       if (!messageview_is_visible(msgview)) {
+                               main_window_toggle_message_view(summaryview->mainwin);
+                               GTK_EVENTS_FLUSH();
+                       }
+                       val = messageview_show(msgview, msginfo, all_headers);
+                       if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
+                               gtk_widget_grab_focus(summaryview->ctree);
+                       gtkut_ctree_node_move_if_on_the_edge(ctree, row,
+                               GTK_CLIST(summaryview->ctree)->focus_row);
                }
-               val = messageview_show(msgview, msginfo, all_headers);
-               if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
-                       gtk_widget_grab_focus(summaryview->ctree);
-               gtkut_ctree_node_move_if_on_the_edge(ctree, row,
-                       GTK_CLIST(summaryview->ctree)->focus_row);
        }
 
        if (val == 0 && MSG_IS_UNREAD(msginfo->flags)) {
@@ -3101,6 +3156,10 @@ void summary_view_source(SummaryView * summaryview)
        msginfo = gtk_ctree_node_get_row_data(ctree, summaryview->selected);
        source_window_show_msg(srcwin, msginfo);
        source_window_show(srcwin);
+#ifdef MAEMO
+       maemo_window_full_screen_if_needed(GTK_WINDOW(srcwin->window));
+       maemo_connect_key_press_to_mainwindow(GTK_WINDOW(srcwin->window));
+#endif
 }
 
 void summary_reedit(SummaryView *summaryview)
@@ -3171,6 +3230,8 @@ gboolean summary_step(SummaryView *summaryview, GtkScrollType type)
 
 void summary_toggle_view(SummaryView *summaryview)
 {
+       if (prefs_common.layout_mode == LITTLE_LAYOUT)
+               return;
        if (!messageview_is_visible(summaryview->messageview) &&
            summaryview->selected)
                summary_display_msg(summaryview,
@@ -5229,6 +5290,9 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
        g_signal_connect(G_OBJECT(ctree), "drag_data_get",
                         G_CALLBACK(summary_drag_data_get),
                         summaryview);
+       g_signal_connect(G_OBJECT(ctree), "drag_end",
+                        G_CALLBACK(summary_drag_end),
+                        summaryview);
 
        gtk_drag_dest_set(ctree, GTK_DEST_DEFAULT_ALL & ~GTK_DEST_DEFAULT_HIGHLIGHT,
                          summary_drag_types, 2,
@@ -5283,6 +5347,16 @@ void summary_set_column_order(SummaryView *summaryview)
 
 /* callback functions */
 
+static gint summary_folder_eventbox_pressed(GtkWidget *eventbox, GdkEventButton *event,
+                                           SummaryView *summaryview)
+{
+       if (event) {
+               gtk_widget_grab_focus(summaryview->folderview->ctree);
+               mainwindow_exit_folder(summaryview->mainwin);
+       }
+       return TRUE;
+}
+
 static gint summary_toggle_pressed(GtkWidget *eventbox, GdkEventButton *event,
                                   SummaryView *summaryview)
 {
@@ -5402,6 +5476,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                /* FALLTHROUGH */       
        case GDK_Escape:
                gtk_widget_grab_focus(summaryview->folderview->ctree);
+               mainwindow_exit_folder(summaryview->mainwin);
                return TRUE;
        case GDK_Home:
        case GDK_End:
@@ -5539,6 +5614,7 @@ static void summary_selected(GtkCTree *ctree, GtkCTreeNode *row,
 
        if (summary_is_locked(summaryview)
        && !GTK_SCTREE(ctree)->selecting_range
+       && summaryview->messageview
        && summaryview->messageview->mimeview
        && summaryview->messageview->mimeview->type == MIMEVIEW_TEXT
        && summaryview->messageview->mimeview->textview->loading) {
@@ -5823,6 +5899,29 @@ static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
        context = gtk_drag_begin(widget, summaryview->target_list,
                                 GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_DEFAULT, button, event);
        gtk_drag_set_icon_default(context);
+       if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+               gint min, max, mid;
+               GtkWidget *paned = GTK_WIDGET_PTR(summaryview)->parent;
+               if (paned && GTK_IS_PANED(paned)) {
+                       mainwindow_reset_paned(GTK_PANED(paned));
+               }
+       }
+}
+
+static gboolean summary_return_to_list(void *data)
+{
+       SummaryView *summaryview = (SummaryView *)data;
+       mainwindow_enter_folder(summaryview->mainwin);
+       return FALSE;
+}
+
+static void summary_drag_end      (GtkWidget       *widget, 
+                                  GdkDragContext   *drag_context,
+                                   SummaryView             *summaryview)
+{
+       if (prefs_common.layout_mode == LITTLE_LAYOUT) {
+               g_timeout_add(250, summary_return_to_list, summaryview);
+       }
 }
 
 static void summary_drag_data_get(GtkWidget        *widget,
@@ -6207,8 +6306,6 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
        GtkWidget *ctree = summaryview->ctree;
        GtkWidget *pixmap; 
 
-       gtk_widget_destroy(summaryview->folder_pixmap);
-
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_MARK, &markxpm, &markxpmmask);
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_DELETED, &deletedxpm, &deletedxpmmask);
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_NEW, &newxpm, &newxpmmask);
@@ -6226,11 +6323,7 @@ void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview)
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_MOVED, &movedxpm, &movedxpmmask);
        stock_pixmap_gdk(ctree, STOCK_PIXMAP_COPIED, &copiedxpm, &copiedxpmmask);
 
-       pixmap = stock_pixmap_widget(summaryview->hbox, STOCK_PIXMAP_DIR_OPEN);
-       gtk_box_pack_start(GTK_BOX(summaryview->hbox), pixmap, FALSE, FALSE, 4);
-       gtk_box_reorder_child(GTK_BOX(summaryview->hbox), pixmap, 1); /* search_toggle before */
-       gtk_widget_show(pixmap);
-       summaryview->folder_pixmap = pixmap; 
+       summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
 
        pixmap = stock_pixmap_widget(summaryview->hbox, STOCK_PIXMAP_QUICKSEARCH);
        gtk_container_remove (GTK_CONTAINER(summaryview->toggle_search), 
@@ -6369,7 +6462,32 @@ static gboolean summary_update_msg(gpointer source, gpointer data)
        return FALSE;
 }
 
-static gboolean summary_update_folder_item_name(gpointer source, gpointer data)
+static void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item)
+{
+       guint new, unread, unreadmarked, marked, total;
+       if (prefs_common.layout_mode != LITTLE_LAYOUT)
+               return;
+       folder_count_total_msgs(&new, &unread, &unreadmarked, &marked, &total);
+       if (removed_item) {
+               total -= removed_item->total_msgs;
+               new -= removed_item->new_msgs;
+               unread -= removed_item->unread_msgs;
+       }
+       
+       if (new > 0 || unread > 0) {
+               summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN_HRM);
+               gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips),
+                            summaryview->folder_pixmap_eventbox,
+                            _("Go back to the folder list (You have unread messages)"), NULL);
+       } else {
+               summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
+               gtk_tooltips_set_tip(GTK_TOOLTIPS(summaryview->tips),
+                            summaryview->folder_pixmap_eventbox,
+                            _("Go back to the folder list"), NULL);
+       }
+}
+
+static gboolean summary_update_folder_item_hook(gpointer source, gpointer data)
 {
        FolderItemUpdateData *hookdata = (FolderItemUpdateData *)source;
        SummaryView *summaryview = (SummaryView *)data;
@@ -6383,6 +6501,20 @@ static gboolean summary_update_folder_item_name(gpointer source, gpointer data)
                gtk_label_set_text(GTK_LABEL(summaryview->statlabel_folder), name);
                g_free(name);
        }
+       summary_update_unread(summaryview, NULL);
+
+       return FALSE;
+}
+
+static gboolean summary_update_folder_hook(gpointer source, gpointer data)
+{
+       FolderUpdateData *hookdata;
+       SummaryView *summaryview = (SummaryView *)data;
+       hookdata = source;
+       if (hookdata->update_flags & FOLDER_REMOVE_FOLDERITEM)
+               summary_update_unread(summaryview, hookdata->item);
+       else
+               summary_update_unread(summaryview, NULL);
 
        return FALSE;
 }
index f99792d..89fb465 100644 (file)
@@ -95,6 +95,7 @@ struct _SummaryView
        GtkWidget *stat_box;
        GtkWidget *stat_box2;
        GtkWidget *folder_pixmap;
+       GtkWidget *folder_pixmap_eventbox;
        GtkWidget *statlabel_folder;
        GtkWidget *statlabel_select;
        GtkWidget *statlabel_msgs;
@@ -128,6 +129,7 @@ struct _SummaryView
        FolderView   *folderview;
        HeaderView   *headerview;
        MessageView  *messageview;
+       MessageView  *ext_messageview;
        QuickSearch  *quicksearch;
 
        FolderItem *folder_item;
@@ -162,8 +164,11 @@ private:
 
        /* update folder label when renaming */
        gint folder_item_update_callback_id;
+       gint folder_update_callback_id;
 
        GtkTargetList *target_list; /* DnD */
+       
+       GtkTooltips *tips;
 };
 
 SummaryView    *summary_create(void);