2007-07-25 [colin] 2.10.0cvs63
authorColin Leroy <colin@colino.net>
Wed, 25 Jul 2007 16:37:48 +0000 (16:37 +0000)
committerColin Leroy <colin@colino.net>
Wed, 25 Jul 2007 16:37:48 +0000 (16:37 +0000)
* src/inc.c
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_receive.c
Maemo: Add a better way to notify of
new mails
* src/mainwindow.c
* src/statusbar.h
* src/summaryview.c
* src/toolbar.c
Maemo: Various layout fixes
* src/gtk/prefswindow.c
Maemo: Better prefs layout

12 files changed:
ChangeLog
PATCHSETS
configure.ac
src/gtk/prefswindow.c
src/inc.c
src/mainwindow.c
src/prefs_common.c
src/prefs_common.h
src/prefs_receive.c
src/statusbar.h
src/summaryview.c
src/toolbar.c

index 50240ddeac61f07de3b71c2e06cd189fadfb1e3a..798ccbd6206a4499a80281995c0157ee973b372c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-07-25 [colin]     2.10.0cvs63
+
+       * src/inc.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_receive.c
+               Maemo: Add a better way to notify of
+               new mails
+       * src/mainwindow.c
+       * src/statusbar.h
+       * src/summaryview.c
+       * src/toolbar.c
+               Maemo: Various layout fixes
+       * src/gtk/prefswindow.c
+               Maemo: Better prefs layout
+
 2007-07-25 [paul]      2.10.0cvs62
 
        * src/textview.c
index a9c85a938cadc5c71069fa04a056fbdb490f24aa..e914404c44d689b153bb3bd77b54fa5f50f831c2 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.96.2.177 -r 1.96.2.178 src/textview.c;  ) > 2.10.0cvs60.patchset
 ( cvs diff -u -r 1.395.2.312 -r 1.395.2.313 src/summaryview.c;  ) > 2.10.0cvs61.patchset
 ( cvs diff -u -r 1.96.2.178 -r 1.96.2.179 src/textview.c;  ) > 2.10.0cvs62.patchset
+( cvs diff -u -r 1.149.2.77 -r 1.149.2.78 src/inc.c;  cvs diff -u -r 1.274.2.200 -r 1.274.2.201 src/mainwindow.c;  cvs diff -u -r 1.204.2.142 -r 1.204.2.143 src/prefs_common.c;  cvs diff -u -r 1.103.2.88 -r 1.103.2.89 src/prefs_common.h;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/prefs_receive.c;  cvs diff -u -r 1.3.2.7 -r 1.3.2.8 src/statusbar.h;  cvs diff -u -r 1.395.2.313 -r 1.395.2.314 src/summaryview.c;  cvs diff -u -r 1.43.2.78 -r 1.43.2.79 src/toolbar.c;  cvs diff -u -r 1.12.2.37 -r 1.12.2.38 src/gtk/prefswindow.c;  ) > 2.10.0cvs63.patchset
index f6ba7aa706d270f842cf9e4498ff8aa187916db1..ec7e9626bd8013dbb3bf436ac9179aeb477a8b51 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=10
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=62
+EXTRA_VERSION=63
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
@@ -49,6 +49,11 @@ if test "$GNOME_CONFIG" != no; then
 fi
 AM_CONDITIONAL(CLAWS_GNOME, test -n "$gnomedatadir")
 
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test x$PKG_CONFIG = xno ; then
+  AC_MSG_ERROR([*** pkg-config not found. See http://www.freedesktop.org/software/pkgconfig/])
+fi
+
 dnl GNOME 2.x installed?
 PKG_CHECK_MODULES(GNOME2, libgnome-2.0 >= 2.0, ac_enable_gnome2=yes, ac_enable_gnome2=no)
 AM_CONDITIONAL(CLAWS_GNOME2, test x"$ac_enable_gnome2" = x"yes")
index c51cd962040f761ace54a7c9e51a3fc1cdfe7900..f9f32338902c2d68f971e3ec7942943ed75ec076 100644 (file)
@@ -48,7 +48,8 @@ typedef struct _PrefsTreeNode PrefsTreeNode;
 struct _PrefsWindow
 {
        GtkWidget *window;
-       GtkWidget *table1;
+       GtkWidget *vbox;
+       GtkWidget *paned;
        GtkWidget *scrolledwindow1;
        GtkWidget *scrolledwindow2;
        GtkWidget *tree_view;
@@ -129,11 +130,44 @@ static void close_all_pages(GSList *prefs_pages)
        }       
 }
 
+#ifdef MAEMO
+static void prefs_show_sections(PrefsWindow *prefswindow)
+{
+       gint max;
+       GtkWidget *paned = prefswindow->paned;
+       
+        g_object_get (G_OBJECT(paned),
+                        "max-position",
+                        &max, NULL);
+
+       gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
+       gtk_widget_hide(gtk_paned_get_child2(GTK_PANED(paned)));
+       gtk_paned_set_position(GTK_PANED(paned), max);
+}
+
+static void prefs_show_page(PrefsWindow *prefswindow)
+{
+       gint min;
+       GtkWidget *paned = prefswindow->paned;
+       
+        g_object_get (G_OBJECT(paned),
+                        "min-position",
+                        &min, NULL);
+
+       gtk_widget_hide(gtk_paned_get_child1(GTK_PANED(paned)));
+       gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
+       gtk_paned_set_position(GTK_PANED(paned), min);
+}
+#endif
+
 static void apply_button_clicked(GtkButton *button, gpointer user_data)
 {
        PrefsWindow *prefswindow = (PrefsWindow *) user_data;
 
        save_all_pages(prefswindow->prefs_pages);
+#ifdef MAEMO
+       prefs_show_sections(prefswindow);
+#endif
 }
 
 static void close_prefs_window(PrefsWindow *prefswindow)
@@ -170,7 +204,11 @@ static gboolean window_closed(GtkWidget *widget, GdkEvent *event, gpointer user_
 {
        PrefsWindow *prefswindow = (PrefsWindow *) user_data;
 
+#ifdef MAEMO
+       save_all_pages(prefswindow->prefs_pages);
+#endif
        close_prefs_window(prefswindow);
+
        return FALSE;
 }
 
@@ -182,7 +220,11 @@ static gboolean prefswindow_key_pressed(GtkWidget *widget, GdkEventKey *event,
        if (event) {
                switch (event->keyval) {
                        case GDK_Escape :
+#ifndef MAEMO
                                cancel_button_clicked(NULL, data);
+#else
+                               ok_button_clicked(NULL, data);
+#endif
                                break;
                        case GDK_Return : 
                        case GDK_KP_Enter :
@@ -276,7 +318,8 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
        gint index; /* index in pages list */
        GtkTreeSelection *selection;
        GtkTreeIter iter;
-       
+       GtkAdjustment *adj;
+
        for (cur = prefs_pages, index = 0; cur != NULL; cur = g_slist_next(cur), index++) {
                PrefsPage *page = (PrefsPage *)cur->data;
                FindNodeByName find_name;
@@ -363,6 +406,16 @@ static void prefswindow_build_tree(GtkWidget *tree_view, GSList *prefs_pages,
                }
                gtk_tree_selection_select_iter(selection, &iter);
        }
+
+       adj = gtk_scrolled_window_get_vadjustment(
+                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow1));
+       gtk_adjustment_set_value(adj, 0);
+       adj = gtk_scrolled_window_get_vadjustment(
+                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
+       gtk_adjustment_set_value(adj, 0);
+       adj = gtk_scrolled_window_get_hadjustment(
+                       GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
+       gtk_adjustment_set_value(adj, 0);
 }
 
 void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
@@ -391,16 +444,22 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
        gtk_window_set_resizable (GTK_WINDOW(prefswindow->window), TRUE);
        gtk_container_set_border_width(GTK_CONTAINER(prefswindow->window), 4);
 
-       prefswindow->table1 = gtk_table_new(2, 2, FALSE);
-       gtk_widget_show(prefswindow->table1);
-       gtk_container_add(GTK_CONTAINER(prefswindow->window), prefswindow->table1);
+       prefswindow->vbox = gtk_vbox_new(FALSE, 6);
+       gtk_widget_show(prefswindow->vbox);
+       
+       prefswindow->paned = gtk_hpaned_new();
+       gtk_widget_show(prefswindow->paned);
+
+       gtk_container_add(GTK_CONTAINER(prefswindow->window), prefswindow->vbox);
+
+       gtk_box_pack_start(GTK_BOX(prefswindow->vbox), prefswindow->paned, TRUE, TRUE, 0);
 
        prefswindow->scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
        gtk_widget_show(prefswindow->scrolledwindow1);
        gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow1),
                        GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-       gtk_table_attach(GTK_TABLE(prefswindow->table1), prefswindow->scrolledwindow1,
-                       0, 1, 0, 1, GTK_FILL, GTK_FILL | GTK_EXPAND, 2, 2);
+                       
+       gtk_paned_add1(GTK_PANED(prefswindow->paned), prefswindow->scrolledwindow1);
 
        prefswindow->tree_view = prefswindow_tree_view_create(prefswindow);
        gtk_widget_show(prefswindow->tree_view);
@@ -410,8 +469,8 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
        prefswindow->frame = gtk_frame_new(NULL);
        gtk_widget_show(prefswindow->frame);
        gtk_frame_set_shadow_type(GTK_FRAME(prefswindow->frame), GTK_SHADOW_IN);
-       gtk_table_attach(GTK_TABLE(prefswindow->table1), prefswindow->frame,
-                       1, 2, 0, 1, GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2);
+
+       gtk_paned_add2(GTK_PANED(prefswindow->paned), prefswindow->frame);
 
        prefswindow->table2 = gtk_table_new(1, 2, FALSE);
        gtk_widget_show(prefswindow->table2);
@@ -453,22 +512,36 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
 
        gtk_widget_grab_focus(prefswindow->tree_view);
 
+#ifndef MAEMO
        gtkut_stock_button_set_create(&prefswindow->confirm_area,
                                      &prefswindow->apply_btn,  GTK_STOCK_APPLY,
                                      &prefswindow->cancel_btn, GTK_STOCK_CANCEL,
                                      &prefswindow->ok_btn,     GTK_STOCK_OK);
-
+#else
+       gtkut_stock_button_set_create(&prefswindow->confirm_area,
+                                     &prefswindow->apply_btn,  GTK_STOCK_APPLY,
+                                     &prefswindow->ok_btn,     GTK_STOCK_CLOSE,
+                                     NULL,                     NULL);
+#endif
        gtk_widget_show_all(prefswindow->confirm_area);
+       gtk_widget_show_all(prefswindow->vbox);
 
-       gtk_table_attach(GTK_TABLE(prefswindow->table1), prefswindow->confirm_area,
-                       0, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 2, 2);
+       gtk_box_pack_start(GTK_BOX(prefswindow->vbox), prefswindow->confirm_area, FALSE, FALSE, 0);
 
+#ifndef MAEMO
        g_signal_connect(G_OBJECT(prefswindow->ok_btn), "clicked", 
                         G_CALLBACK(ok_button_clicked), prefswindow);
        g_signal_connect(G_OBJECT(prefswindow->cancel_btn), "clicked", 
                         G_CALLBACK(cancel_button_clicked), prefswindow);
        g_signal_connect(G_OBJECT(prefswindow->apply_btn), "clicked", 
                         G_CALLBACK(apply_button_clicked), prefswindow);
+#else
+       g_signal_connect(G_OBJECT(prefswindow->ok_btn), "clicked", 
+                        G_CALLBACK(ok_button_clicked), prefswindow);
+       g_signal_connect(G_OBJECT(prefswindow->apply_btn), "clicked", 
+                        G_CALLBACK(apply_button_clicked), prefswindow);
+#endif
+
        g_signal_connect(G_OBJECT(prefswindow->window), "delete_event", 
                         G_CALLBACK(window_closed), prefswindow);
 
@@ -502,6 +575,9 @@ void prefswindow_open_full(const gchar *title, GSList *prefs_pages,
                                            *(prefswindow->save_height));
        }
 
+#ifdef MAEMO
+       prefs_show_sections(prefswindow);
+#endif
        gtk_widget_show(prefswindow->window);
 #ifdef MAEMO
        maemo_window_full_screen_if_needed(GTK_WINDOW(prefswindow->window));
@@ -593,9 +669,10 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
        GtkTreeIter iter;
        GtkAdjustment *adj;
 
+#ifndef MAEMO
        if (currently_selected) 
                return TRUE;
-
+#endif
        if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
                return TRUE;
 
@@ -638,6 +715,9 @@ static gboolean prefswindow_row_selected(GtkTreeSelection *selector,
                        GTK_SCROLLED_WINDOW(prefswindow->scrolledwindow2));
        gtk_adjustment_set_value(adj, 0);
 
+#ifdef MAEMO
+       prefs_show_page(prefswindow);
+#endif
        return TRUE;
 }
 
index 82c782e40e0571899dcb2ee0ee6c05b05ee3c97e..ae8a1b2e4aff38de673f897b32cd5cd094adfbd5 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -63,6 +63,8 @@
 
 #ifdef MAEMO
 #include <hildon-widgets/hildon-banner.h>
+#include <hildon-widgets/hildon-system-sound.h>
+#include <libosso.h>
 
 #ifdef CONIC
 #include <conicconnection.h>
@@ -1375,15 +1377,21 @@ void inc_unlock(void)
 static guint autocheck_timer = 0;
 static gpointer autocheck_data = NULL;
 
+#ifdef MAEMO
+osso_context_t *get_osso_context(void);
+#endif
+
 static void inc_notify_cmd(gint new_msgs, gboolean notify)
 {
 
+#ifndef MAEMO
        gchar *buf, *numpos, *ret_str;
        gssize by_read = 0, by_written = 0;
 
        if (!(new_msgs && notify && prefs_common.newmail_notify_cmd &&
            *prefs_common.newmail_notify_cmd))
                     return;
+
        buf = g_strdup(prefs_common.newmail_notify_cmd);
        if ((numpos = strstr(buf, "%d")) != NULL) {
                gchar *buf2;
@@ -1404,6 +1412,20 @@ static void inc_notify_cmd(gint new_msgs, gboolean notify)
        execute_command_line(buf, TRUE);
 
        g_free(buf);
+
+#else
+       if (new_msgs) {
+               if (prefs_common.maemo_play_sound)
+                       hildon_play_system_sound("/usr/share/sounds/ui-new_email.wav");
+               if (prefs_common.maemo_show_banner) {
+                       gchar *info = g_strdup_printf(ngettext("Claws Mail: %d new message",
+                                                  "Claws Mail: %d new messages",
+                                                  new_msgs), new_msgs);
+                       osso_system_note_infoprint(get_osso_context(), info, NULL);
+                       g_free(info);
+               }
+       }
+#endif
 }
 
 #if (defined(MAEMO) && defined(CONIC))
index 32b79bf0c226c181db58660a079581a3ad60f7e7..52c060ea1f081ddd6c0e8d156b24223aaea6e2d6 100644 (file)
@@ -187,10 +187,10 @@ static void toggle_message_cb      (MainWindow    *mainwin,
 static void toggle_toolbar_cb   (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
+#ifndef MAEMO
 static void toggle_statusbar_cb         (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
-#ifndef MAEMO
 static void set_layout_cb       (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
@@ -558,8 +558,10 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, toggle_toolbar_cb, TOOLBAR_TEXT, "/View/Show or hide/Toolbar/Text below icons"},
        {N_("/_View/Show or hi_de/_Toolbar/_Hide"),
                                                NULL, toggle_toolbar_cb, TOOLBAR_NONE, "/View/Show or hide/Toolbar/Text below icons"},
+#ifndef MAEMO
        {N_("/_View/Show or hi_de/Status _bar"),
                                                NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
+#endif
        {N_("/_View/Set displayed _columns"),   NULL, NULL, 0, "<Branch>"},
        {N_("/_View/Set displayed _columns/in _Folder list..."),        NULL, set_folder_display_item_cb, 0, NULL},
        {N_("/_View/Set displayed _columns/in _Message list..."),NULL, set_summary_display_item_cb, 0, NULL},
@@ -1312,6 +1314,7 @@ MainWindow *main_window_create()
        GtkWidget *menubar;
        GtkWidget *handlebox;
        GtkWidget *vbox_body;
+#ifndef MAEMO
        GtkWidget *hbox_stat;
        GtkWidget *statusbar;
        GtkWidget *progressbar;
@@ -1320,12 +1323,12 @@ MainWindow *main_window_create()
        GtkWidget *ac_label;
        GtkWidget *online_pixmap;
        GtkWidget *offline_pixmap;
-       GtkWidget *online_switch;
-       GtkWidget *offline_switch;
        GtkTooltips *tips;
        GtkWidget *warning_icon;
        GtkWidget *warning_btn;
-
+#endif
+       GtkWidget *online_switch;
+       GtkWidget *offline_switch;
        FolderView *folderview;
        SummaryView *summaryview;
        MessageView *messageview;
@@ -1344,7 +1347,7 @@ MainWindow *main_window_create()
        mainwin = g_new0(MainWindow, 1);
 
        /* main window */
-       window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "mainwindow");
+       window = GTK_WIDGET(gtkut_window_new(GTK_WINDOW_TOPLEVEL, "mainwindow"));
        gtk_window_set_title(GTK_WINDOW(window), PROG_VERSION);
        gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
 #ifdef MAEMO
@@ -1429,6 +1432,7 @@ MainWindow *main_window_create()
        gtk_container_set_border_width(GTK_CONTAINER(vbox_body), BORDER_WIDTH);
        gtk_box_pack_start(GTK_BOX(vbox), vbox_body, TRUE, TRUE, 0);
 
+#ifndef MAEMO
        hbox_stat = gtk_hbox_new(FALSE, 2);
        gtk_box_pack_end(GTK_BOX(vbox_body), hbox_stat, FALSE, FALSE, 0);
 
@@ -1462,11 +1466,10 @@ MainWindow *main_window_create()
        statusbar = statusbar_create();
        gtk_box_pack_start(GTK_BOX(hbox_stat), statusbar, TRUE, TRUE, 0);
 
-#ifndef MAEMO
        progressbar = gtk_progress_bar_new();
        gtk_widget_set_size_request(progressbar, 120, 1);
        gtk_box_pack_start(GTK_BOX(hbox_stat), progressbar, FALSE, FALSE, 0);
-#endif
+
        online_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_ONLINE);
        offline_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_OFFLINE);
        online_switch = gtk_button_new ();
@@ -1504,7 +1507,12 @@ MainWindow *main_window_create()
 
        gtk_widget_hide(offline_switch);
        gtk_widget_hide(warning_btn);
-
+#else
+       online_switch = gtk_button_new ();
+       offline_switch = gtk_button_new ();
+       g_signal_connect (G_OBJECT(online_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
+       g_signal_connect (G_OBJECT(offline_switch), "clicked", G_CALLBACK(online_switch_clicked), mainwin);
+#endif
        /* create views */
        mainwin->folderview  = folderview  = folderview_create();
        mainwin->summaryview = summaryview = summary_create();
@@ -1546,25 +1554,23 @@ MainWindow *main_window_create()
        summaryview->messageview = messageview;
        summaryview->window      = window;
 
-       messageview->statusbar   = statusbar;
        mainwin->vbox           = vbox;
        mainwin->menubar        = menubar;
        mainwin->menu_factory   = ifactory;
        mainwin->handlebox      = handlebox;
        mainwin->vbox_body      = vbox_body;
-       mainwin->hbox_stat      = hbox_stat;
-       mainwin->statusbar      = statusbar;
+       mainwin->online_switch  = online_switch;
+       mainwin->offline_switch    = offline_switch;
 #ifndef MAEMO
+       messageview->statusbar  = statusbar;
+       mainwin->statusbar      = statusbar;
+       mainwin->hbox_stat      = hbox_stat;
        mainwin->progressbar    = progressbar;
-#endif
        mainwin->statuslabel    = statuslabel;
-       mainwin->online_switch  = online_switch;
        mainwin->online_pixmap  = online_pixmap;
        mainwin->offline_pixmap = offline_pixmap;
        mainwin->ac_button      = ac_button;
        mainwin->ac_label       = ac_label;
-       mainwin->offline_switch    = offline_switch;
-       
        /* set context IDs for status bar */
        mainwin->mainwin_cid = gtk_statusbar_get_context_id
                (GTK_STATUSBAR(statusbar), "Main Window");
@@ -1574,9 +1580,20 @@ MainWindow *main_window_create()
                (GTK_STATUSBAR(statusbar), "Summary View");
        mainwin->messageview_cid = gtk_statusbar_get_context_id
                (GTK_STATUSBAR(statusbar), "Message View");
-
        messageview->statusbar_cid = mainwin->messageview_cid;
 
+#else
+       messageview->statusbar  = NULL;
+       mainwin->statusbar      = NULL;
+       mainwin->hbox_stat      = NULL;
+       /* mainwin->progressbar is set in toolbar.c */
+       mainwin->statuslabel    = NULL;
+       mainwin->online_pixmap  = NULL;
+       mainwin->offline_pixmap = NULL;
+       mainwin->ac_button      = NULL;
+       mainwin->ac_label       = NULL;
+#endif
+       
        /* allocate colors for summary view and folder view */
        summaryview->color_marked.red = summaryview->color_marked.green = 0;
        summaryview->color_marked.blue = (guint16)65535;
@@ -1645,12 +1662,13 @@ MainWindow *main_window_create()
        }
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
 
+#ifndef MAEMO
        gtk_widget_hide(mainwin->hbox_stat);
        menuitem = gtk_item_factory_get_item
                (ifactory, "/View/Show or hide/Status bar");
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
                                       prefs_common.show_statusbar);
-       
+#endif 
        /* set account selection menu */
        ac_menu = gtk_item_factory_get_widget
                (ifactory, "/Configuration/Change current account");
@@ -1769,7 +1787,7 @@ void main_window_cursor_normal(MainWindow *mainwin)
 /* lock / unlock the user-interface */
 void main_window_lock(MainWindow *mainwin)
 {
-       if (mainwin->lock_count == 0)
+       if (mainwin->lock_count == 0 && mainwin->ac_button)
                gtk_widget_set_sensitive(mainwin->ac_button, FALSE);
 
        mainwin->lock_count++;
@@ -1786,7 +1804,7 @@ void main_window_unlock(MainWindow *mainwin)
        main_window_set_menu_sensitive(mainwin);
        toolbar_main_set_sensitive(mainwin);
 
-       if (mainwin->lock_count == 0)
+       if (mainwin->lock_count == 0 && mainwin->ac_button)
                gtk_widget_set_sensitive(mainwin->ac_button, TRUE);
 }
 
@@ -1829,7 +1847,7 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
                        compose_reflect_prefs_pixmap_theme();
                        folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
                        summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
-
+#ifndef MAEMO
                        pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_ONLINE);
                        gtk_container_remove(GTK_CONTAINER(mainwin->online_switch), 
                                             mainwin->online_pixmap);
@@ -1842,6 +1860,7 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
                        gtk_container_add (GTK_CONTAINER(mainwin->offline_switch), pixmap);
                        gtk_widget_show(pixmap);
                        mainwin->offline_pixmap = pixmap;
+#endif
                }
                
                headerview_set_font(mainwin->messageview->headerview);
@@ -1850,7 +1869,16 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
                textview_reflect_prefs(mainwin->messageview->mimeview->textview);
                folderview_reflect_prefs();
                summary_reflect_prefs();
+#ifndef MAEMO
                summary_redisplay_msg(mainwin->summaryview);
+#endif
+               if (prefs_common.layout_mode == SMALL_LAYOUT) {
+                       if (mainwin->in_folder) {
+                               mainwindow_enter_folder(mainwin);
+                       } else {
+                               mainwindow_exit_folder(mainwin);
+                       }
+               }
        }
        prefs_tag = 0;
        return FALSE;
@@ -2106,7 +2134,8 @@ static void main_window_show_cur_account(MainWindow *mainwin)
        g_free(buf);
 
        gtk_label_set_text(GTK_LABEL(mainwin->ac_label), ac_name);
-       gtk_widget_queue_resize(mainwin->ac_button);
+       if (mainwin->ac_button)
+               gtk_widget_queue_resize(mainwin->ac_button);
 
        g_free(ac_name);
 }
@@ -2964,9 +2993,10 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                                    prefs_common.msgview_height);
        }
 
+#ifndef MAEMO
        mainwin->messageview->statusbar = mainwin->statusbar;
        mainwin->messageview->statusbar_cid = mainwin->messageview_cid;
-
+#endif
        /* clean top-most container */
        if (mainwin->hpaned) {
                if (mainwin->hpaned->parent == mainwin->vpaned)
@@ -3379,6 +3409,7 @@ static void main_window_reply_cb(MainWindow *mainwin, guint action,
 }
 
 
+#ifndef MAEMO
 static void toggle_statusbar_cb(MainWindow *mainwin, guint action,
                                GtkWidget *widget)
 {
@@ -3391,7 +3422,6 @@ static void toggle_statusbar_cb(MainWindow *mainwin, guint action,
        }
 }
 
-#ifndef MAEMO
 static void set_layout_cb(MainWindow *mainwin, guint action,
                               GtkWidget *widget)
 {
@@ -3488,8 +3518,10 @@ static void online_switch_clicked (GtkButton *btn, gpointer data)
        g_return_if_fail(menuitem != NULL);
        
        if (btn == GTK_BUTTON(mainwin->online_switch)) {
+#ifndef MAEMO
                gtk_widget_hide (mainwin->online_switch);
                gtk_widget_show (mainwin->offline_switch);
+#endif
                menuitem->active = TRUE;
                inc_autocheck_timer_remove();
                        
@@ -3504,8 +3536,10 @@ static void online_switch_clicked (GtkButton *btn, gpointer data)
                /*go online */
                if (!prefs_common.work_offline)
                        return;
+#ifndef MAEMO
                gtk_widget_hide (mainwin->offline_switch);
                gtk_widget_show (mainwin->online_switch);
+#endif
                menuitem->active = FALSE;
                prefs_common.work_offline = FALSE;
                inc_autocheck_timer_set();
index dee8f3bbc13af7828da9b8f290fdeacf73d27d15..b9b951d3757a0c349a17873f4a09c96aadc5436b 100644 (file)
@@ -165,6 +165,12 @@ static PrefParam param[] = {
        P_BOOL, NULL, NULL, NULL},
        {"newmail_notify_cmd", "", &SPECIFIC_PREFS.newmail_notify_cmd, P_STRING,
         NULL, NULL, NULL},
+#ifdef MAEMO
+       {"maemo_play_sound", "FALSE", &prefs_common.maemo_play_sound, P_BOOL,
+        NULL, NULL, NULL},
+       {"maemo_show_banner", "FALSE", &prefs_common.maemo_show_banner, P_BOOL,
+        NULL, NULL, NULL},
+#endif
        {"receive_dialog_mode", "2", &prefs_common.recv_dialog_mode, P_ENUM,
         NULL, NULL, NULL},
        {"receivewin_width", "460", &prefs_common.receivewin_width, P_INT,
index dd2e99606d1bb9e8bde552928a420f172d98d82e..637c735325b7984b4349077127d6116fd7bcaf79 100644 (file)
@@ -108,6 +108,10 @@ struct _PrefsCommon
        gboolean newmail_notify_auto;
        gboolean newmail_notify_manu;
        gchar   *newmail_notify_cmd;
+#ifdef MAEMO
+       gboolean maemo_play_sound;
+       gboolean maemo_show_banner;
+#endif
        RecvDialogMode recv_dialog_mode;
        gint receivewin_width;
        gint receivewin_height;
index 914fc096f4e7a8699b9d90e619c4552a2d2a003a..b3a27426b7d29658dd6ac97540dece1df09767f7 100644 (file)
@@ -54,17 +54,23 @@ typedef struct _ReceivePage
        GtkWidget *checkbtn_chkonstartup;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_scan_after_inc;
+#ifndef MAEMO
        GtkWidget *checkbtn_newmail_auto;
        GtkWidget *checkbtn_newmail_manu;
        GtkWidget *entry_newmail_notify_cmd;
+       GtkWidget *hbox_newmail_notify;
+#else
+       GtkWidget *checkbtn_maemo_play_sound;
+       GtkWidget *checkbtn_maemo_show_banner;
+#endif
        GtkWidget *optmenu_recvdialog;
        GtkWidget *checkbtn_no_recv_err_panel;
        GtkWidget *checkbtn_close_recv_dialog;
-       GtkWidget *hbox_newmail_notify;
 } ReceivePage;
 
 ReceivePage *prefs_receive;
 
+#ifndef MAEMO
 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
 {
        gboolean toggled;
@@ -75,6 +81,7 @@ static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpoi
                        (GTK_TOGGLE_BUTTON(prefs_receive->checkbtn_newmail_auto));
        gtk_widget_set_sensitive(prefs_receive->hbox_newmail_notify, toggled);
 }
+#endif
 
 
 static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window, 
@@ -84,7 +91,6 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
        
        GtkWidget *vbox1;
        GtkWidget *vbox2;
-       GtkWidget *vbox3;
        GtkWidget *checkbtn_incext;
        GtkWidget *hbox;
        GtkWidget *label_incext;
@@ -100,11 +106,17 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *checkbtn_scan_after_inc;
 
        GtkWidget *frame;
+#ifndef MAEMO
+       GtkWidget *vbox3;
        GtkWidget *hbox_newmail_notify;
        GtkWidget *checkbtn_newmail_auto;
        GtkWidget *checkbtn_newmail_manu;
        GtkWidget *entry_newmail_notify_cmd;
        GtkWidget *label_newmail_notify_cmd;
+#else
+       GtkWidget *checkbtn_maemo_play_sound;
+       GtkWidget *checkbtn_maemo_show_banner;
+#endif
        
        GtkWidget *label_recvdialog;
        GtkWidget *menu;
@@ -200,7 +212,8 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
        PACK_CHECK_BUTTON (vbox2, checkbtn_openinbox, _("Go to inbox"));
        PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
                           _("Update all local folders"));
+
+#ifndef MAEMO 
        vbox3 = gtkut_get_options_frame(vbox2, &frame, _("Run command"));
        
        hbox = gtk_hbox_new (TRUE, 8);
@@ -234,6 +247,25 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
                                 prefs_common.newmail_notify_auto || 
                                 prefs_common.newmail_notify_manu);
 
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_auto),
+               prefs_common.newmail_notify_auto);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_manu),
+               prefs_common.newmail_notify_manu);
+       gtk_entry_set_text(GTK_ENTRY(entry_newmail_notify_cmd), 
+               prefs_common.newmail_notify_cmd);
+#else
+       PACK_CHECK_BUTTON (vbox2, checkbtn_maemo_play_sound, _("Play sound"));
+       PACK_CHECK_BUTTON (vbox2, checkbtn_maemo_show_banner,
+                          _("Show info banner"));
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_maemo_play_sound),
+               prefs_common.maemo_play_sound);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_maemo_show_banner),
+               prefs_common.maemo_show_banner);
+
+#endif
+
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_autochk),
+               prefs_common.autochk_newmail);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_incext),
                prefs_common.use_extinc);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_no_recv_err_panel),
@@ -246,17 +278,9 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
                prefs_common.open_inbox_on_inc);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_scan_after_inc),
                prefs_common.scan_all_after_inc);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_auto),
-               prefs_common.newmail_notify_auto);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmail_manu),
-               prefs_common.newmail_notify_manu);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_autochk),
-               prefs_common.autochk_newmail);
 
        gtk_entry_set_text(GTK_ENTRY(entry_incext), 
                prefs_common.extinc_cmd);
-       gtk_entry_set_text(GTK_ENTRY(entry_newmail_notify_cmd), 
-               prefs_common.newmail_notify_cmd);
        gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinbtn_autochk), 
                prefs_common.autochk_itv);
        gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_recvdialog),
@@ -270,22 +294,30 @@ static void prefs_receive_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_receive->checkbtn_chkonstartup = checkbtn_chkonstartup;
        prefs_receive->checkbtn_openinbox = checkbtn_openinbox;
        prefs_receive->checkbtn_scan_after_inc = checkbtn_scan_after_inc;
+
+#ifndef MAEMO 
        prefs_receive->checkbtn_newmail_auto = checkbtn_newmail_auto;
        prefs_receive->checkbtn_newmail_manu = checkbtn_newmail_manu;
        prefs_receive->entry_newmail_notify_cmd = entry_newmail_notify_cmd;
+       prefs_receive->hbox_newmail_notify = hbox_newmail_notify;
+#else
+       prefs_receive->checkbtn_maemo_play_sound = checkbtn_maemo_play_sound;
+       prefs_receive->checkbtn_maemo_show_banner = checkbtn_maemo_show_banner;
+#endif
+
        prefs_receive->optmenu_recvdialog = optmenu_recvdialog;
        prefs_receive->checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
        prefs_receive->checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
-       prefs_receive->hbox_newmail_notify = hbox_newmail_notify;
        prefs_receive->page.widget = vbox1;
 
+#ifndef MAEMO 
        g_signal_connect(G_OBJECT(checkbtn_newmail_auto), "toggled",
                         G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
                         NULL);
        g_signal_connect(G_OBJECT(checkbtn_newmail_manu), "toggled",
                         G_CALLBACK(prefs_common_recv_dialog_newmail_notify_toggle_cb),
                         NULL);
-
+#endif
 }
 
 static void prefs_receive_save(PrefsPage *_page)
@@ -307,10 +339,18 @@ static void prefs_receive_save(PrefsPage *_page)
                GTK_TOGGLE_BUTTON(page->checkbtn_openinbox));
        prefs_common.scan_all_after_inc = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_scan_after_inc));
+
+#ifndef MAEMO
        prefs_common.newmail_notify_auto = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_newmail_auto));
        prefs_common.newmail_notify_manu = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_newmail_manu));
+#else
+       prefs_common.maemo_play_sound = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_maemo_play_sound));
+       prefs_common.maemo_show_banner = gtk_toggle_button_get_active(
+               GTK_TOGGLE_BUTTON(page->checkbtn_maemo_show_banner));
+#endif
        prefs_common.autochk_newmail = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_autochk));
        prefs_common.autochk_itv = gtk_spin_button_get_value_as_int(
@@ -320,9 +360,11 @@ static void prefs_receive_save(PrefsPage *_page)
        g_free(prefs_common.extinc_cmd);
        prefs_common.extinc_cmd = tmp;
        
+#ifndef MAEMO
        tmp = gtk_editable_get_chars(GTK_EDITABLE(page->entry_newmail_notify_cmd), 0, -1);
        g_free(prefs_common.newmail_notify_cmd);
        prefs_common.newmail_notify_cmd = tmp;
+#endif
        
        menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_recvdialog));
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
index 0476051069e365951a435fabdba51cd54e13be69..ceec3f4df2c999e39ce39ca7888c33f0d9e35574 100644 (file)
@@ -39,14 +39,17 @@ void statusbar_verbosity_set        (gboolean        verbose);
 void statusbar_progress_all    (gint done, gint total, gint step);
 #define STATUSBAR_PUSH(mainwin, str) \
 { \
-       gtk_statusbar_push(GTK_STATUSBAR(mainwin->statusbar), \
+       if (mainwin->statusbar) \
+               gtk_statusbar_push(GTK_STATUSBAR(mainwin->statusbar), \
                           mainwin->folderview_cid, str); \
-       gtkut_widget_draw_now(mainwin->hbox_stat); \
+       if (mainwin->hbox_stat) \
+               gtkut_widget_draw_now(mainwin->hbox_stat); \
 }
 
 #define STATUSBAR_POP(mainwin) \
 { \
-       gtk_statusbar_pop(GTK_STATUSBAR(mainwin->statusbar), \
+       if (mainwin->statusbar) \
+               gtk_statusbar_pop(GTK_STATUSBAR(mainwin->statusbar), \
                          mainwin->folderview_cid); \
 }
 
index a0d4bba23e1a63b40526c29083fb3df63ff44ced..df10f9ad0f2b99c3adec6a4d71fa03737cad571e 100644 (file)
@@ -826,6 +826,10 @@ void summary_relayout(SummaryView *summaryview)
        gtk_widget_unref(summaryview->hbox_l);
        gtk_widget_unref(summaryview->statlabel_msgs);
        quicksearch_relayout(summaryview->quicksearch);
+       if (prefs_common.show_searchbar)
+               quicksearch_show(summaryview->quicksearch);
+       else
+               quicksearch_hide(summaryview->quicksearch);
 }
 
 static void summary_set_fonts(SummaryView *summaryview)
@@ -2616,7 +2620,10 @@ void summary_reflect_prefs(void)
        }
 
        summary_set_column_titles(summaryview);
-       summary_show(summaryview, summaryview->folder_item);
+       summary_relayout(summaryview);
+       
+       if (summaryview->folder_item)
+               summary_show(summaryview, summaryview->folder_item);
 }
 
 void summary_sort(SummaryView *summaryview,
index 8079c46f1cf284df0d215e435c00e4407340bd42..ac667394e7d3398713ccae71d3c974622f909a6b 100644 (file)
@@ -1971,6 +1971,7 @@ void toolbar_update(ToolbarType type, gpointer data)
        Compose    *compose = (Compose*)data;
        MessageView *msgview = (MessageView*)data;
 
+#ifndef MAEMO
        switch(type) {
        case TOOLBAR_MAIN:
                toolbar_data = mainwin->toolbar;
@@ -1993,6 +1994,30 @@ void toolbar_update(ToolbarType type, gpointer data)
 
        toolbar_init(toolbar_data);
        toolbar_data = toolbar_create(type, handlebox, data);
+#else
+       switch(type) {
+       case TOOLBAR_MAIN:
+               toolbar_data = mainwin->toolbar;
+               handlebox    = mainwin->window;
+               break;
+       case TOOLBAR_COMPOSE:
+               toolbar_data = compose->toolbar;
+               handlebox    = compose->window;
+               break;
+       case TOOLBAR_MSGVIEW:
+               toolbar_data = msgview->toolbar;
+               handlebox    = msgview->window;
+               break;
+       default:
+               return;
+       }
+
+       hildon_window_remove_toolbar(HILDON_WINDOW(handlebox), GTK_WIDGET(toolbar_data->toolbar));
+
+       toolbar_init(toolbar_data);
+       toolbar_data = toolbar_create(type, handlebox, data);
+#endif
+
        switch(type) {
        case TOOLBAR_MAIN:
                mainwin->toolbar = toolbar_data;