From 7f4de4415b3dd4add8a426ff0593c06e94d59ae9 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Fri, 11 May 2007 06:21:30 +0000 Subject: [PATCH] 2007-05-11 [colin] 2.9.2cvs6 * src/gtk/filesel.c Use Hildon's file chooser on Maemo. Patch by Jean-Luc Biord; fixes part 2 of bug 1201, 'File attachment "manipulation" bugs...' --- ChangeLog | 7 +++++++ PATCHSETS | 1 + configure.ac | 6 +++--- src/gtk/filesel.c | 23 +++++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index db4fcd914..0a51d52b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-11 [colin] 2.9.2cvs6 + + * src/gtk/filesel.c + Use Hildon's file chooser on Maemo. Patch + by Jean-Luc Biord; fixes part 2 of bug 1201, + 'File attachment "manipulation" bugs...' + 2007-05-10 [wwp] 2.9.2cvs5 * src/prefs_common.c diff --git a/PATCHSETS b/PATCHSETS index a72db1027..02d623ad3 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2581,3 +2581,4 @@ ( cvs diff -u -r 1.23.2.22 -r 1.23.2.23 src/crash.c; cvs diff -u -r 1.5.2.18 -r 1.5.2.19 src/exporthtml.c; cvs diff -u -r 1.28.2.34 -r 1.28.2.35 src/mbox.c; cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/prefs_summaries.c; cvs diff -u -r 1.47.2.39 -r 1.47.2.40 src/procheader.c; cvs diff -u -r 1.6.2.10 -r 1.6.2.11 src/common/log.c; cvs diff -u -r 1.36.2.101 -r 1.36.2.102 src/common/utils.c; cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/gtk/gtksourceprintjob.c; cvs diff -u -r 1.9.2.16 -r 1.9.2.17 src/gtk/sslcertwindow.c; ) > 2.9.2cvs3.patchset ( cvs diff -u -r 1.179.2.172 -r 1.179.2.173 src/imap.c; ) > 2.9.2cvs4.patchset ( cvs diff -u -r 1.204.2.133 -r 1.204.2.134 src/prefs_common.c; cvs diff -u -r 1.103.2.81 -r 1.103.2.82 src/prefs_common.h; cvs diff -u -r 1.1.2.70 -r 1.1.2.71 src/gtk/quicksearch.c; ) > 2.9.2cvs5.patchset +( cvs diff -u -r 1.2.2.33 -r 1.2.2.34 src/gtk/filesel.c; ) > 2.9.2cvs6.patchset diff --git a/configure.ac b/configure.ac index df9eb36c8..f998ee252 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=2 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=5 +EXTRA_VERSION=6 EXTRA_RELEASE= EXTRA_GTK2_VERSION= @@ -438,12 +438,12 @@ 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 - PKG_CHECK_MODULES(MAEMO, libosso hildon-libs, ac_cv_enable_maemo=yes, + PKG_CHECK_MODULES(MAEMO, libosso hildon-libs hildon-fm, ac_cv_enable_maemo=yes, ac_cv_enable_maemo=no) AC_SUBST(MAEMO_CFLAGS) AC_SUBST(MAEMO_LIBS) if test $ac_cv_enable_maemo = no; then - AC_MSG_ERROR(libosso or hildon-libs not found) + AC_MSG_ERROR(libosso, hildon-libs or hildon-fm not found) else AC_DEFINE(MAEMO, 1, Build for maemo) fi diff --git a/src/gtk/filesel.c b/src/gtk/filesel.c index ab133494f..fc2a318de 100644 --- a/src/gtk/filesel.c +++ b/src/gtk/filesel.c @@ -34,6 +34,10 @@ #include #include +#ifdef MAEMO +#include +#endif + #include "claws.h" #include "filesel.h" #include "manage_window.h" @@ -90,11 +94,25 @@ static GList *filesel_create(const gchar *title, const gchar *path, GTK_FILE_CHOOSER_ACTION_SAVE); gchar * action_btn = (open == TRUE) ? GTK_STOCK_OPEN:GTK_STOCK_SAVE; +#ifdef MAEMO + GtkWidget *chooser; + if( path && strcmp(path, get_plugin_dir()) == 0 ) { + chooser = gtk_file_chooser_dialog_new_with_backend + (title, NULL, action, "gtk+", + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + action_btn, GTK_RESPONSE_ACCEPT, + NULL); + } + else { + chooser = hildon_file_chooser_dialog_new (NULL, action); + } +#else GtkWidget *chooser = gtk_file_chooser_dialog_new_with_backend (title, NULL, action, "gtk+", GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, action_btn, GTK_RESPONSE_ACCEPT, NULL); +#endif if (filter != NULL) { GtkFileFilter *file_filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(file_filter, filter); @@ -163,7 +181,12 @@ static GList *filesel_create(const gchar *title, const gchar *path, g_free(tmp); } +#ifdef MAEMO + if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_OK + || gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT) +#else if (gtk_dialog_run (GTK_DIALOG (chooser)) == GTK_RESPONSE_ACCEPT) +#endif slist = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (chooser)); manage_window_focus_out(chooser, NULL, NULL); -- 2.25.1