2007-07-23 [colin] 2.10.0cvs58

* src/mimeview.c
	* src/textview.c
		Maemo: Automatically choose the correct application
		to open parts
	* src/gtk/quicksearch.c
		Make search run on GDK_KP_Enter too
This commit is contained in:
Colin Leroy 2007-07-23 16:34:59 +00:00
parent fd1e56fa26
commit 1cd4c57cbe
6 changed files with 50 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2007-07-23 [colin] 2.10.0cvs58
* src/mimeview.c
* src/textview.c
Maemo: Automatically choose the correct application
to open parts
* src/gtk/quicksearch.c
Make search run on GDK_KP_Enter too
2007-07-23 [wwp] 2.10.0cvs57
* src/quote_fmt_lex.l

View file

@ -2711,3 +2711,4 @@
( cvs diff -u -r 1.27.2.37 -r 1.27.2.38 src/addr_compl.c; ) > 2.10.0cvs55.patchset
( cvs diff -u -r 1.8.2.13 -r 1.8.2.14 src/quote_fmt_lex.l; ) > 2.10.0cvs56.patchset
( cvs diff -u -r 1.8.2.14 -r 1.8.2.15 src/quote_fmt_lex.l; ) > 2.10.0cvs57.patchset
( cvs diff -u -r 1.83.2.112 -r 1.83.2.113 src/mimeview.c; cvs diff -u -r 1.96.2.175 -r 1.96.2.176 src/textview.c; cvs diff -u -r 1.1.2.74 -r 1.1.2.75 src/gtk/quicksearch.c; ) > 2.10.0cvs58.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=10
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=57
EXTRA_VERSION=58
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -264,7 +264,7 @@ static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
return TRUE;
}
if (event != NULL && event->keyval == GDK_Return) {
if (event != NULL && (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter)) {
if (quicksearch->press_timeout_id != -1) {
g_source_remove(quicksearch->press_timeout_id);
quicksearch->press_timeout_id = -1;

View file

@ -66,6 +66,13 @@
#include "gtk/logwindow.h"
#include "timing.h"
#ifdef MAEMO
//#include <hildon-widgets/hildon-program.h>
//#include <gtk/gtkmain.h>
#include <libosso.h>
#include <osso-mime.h>
#endif
typedef enum
{
COL_MIMETYPE = 0,
@ -164,7 +171,9 @@ static void mimeview_launch_cb(MimeView *mimeview)
static GtkItemFactoryEntry mimeview_popup_entries[] =
{
{N_("/_Open (l)"), NULL, mimeview_launch_cb, 0, NULL},
#ifndef MAEMO
{N_("/Open _with (o)..."), NULL, mimeview_open_with, 0, NULL},
#endif
{N_("/_Display as text (t)"), NULL, mimeview_display_as_text, 0, NULL},
{N_("/_Save as (y)..."), NULL, mimeview_save_as, 0, NULL},
{N_("/Save _all..."), NULL, mimeview_save_all, 0, NULL},
@ -1765,6 +1774,9 @@ static void mimeview_open_with(MimeView *mimeview)
mimeview_open_part_with(mimeview, partinfo, FALSE);
}
#ifdef MAEMO
osso_context_t *get_osso_context(void);
#endif
static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboolean automatic)
{
gchar *filename;
@ -1772,6 +1784,11 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
gchar *mime_command = NULL;
gchar *content_type = NULL;
gint err;
#ifdef MAEMO
DBusConnection *dbusconn;
gchar *uri;
int r = 0;
#endif
g_return_if_fail(partinfo != NULL);
filename = procmime_get_tmp_file_name(partinfo);
@ -1783,7 +1800,7 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
g_free(filename);
return;
}
if (!prefs_common.mime_open_cmd_history)
prefs_common.mime_open_cmd_history =
add_history(NULL, prefs_common.mime_open_cmd);
@ -1798,6 +1815,19 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
partinfo->subtype);
}
#ifdef MAEMO
if (content_type != NULL) {
uri = g_strconcat ("file://", filename, NULL);
dbusconn = osso_get_dbus_connection (get_osso_context());
r = osso_mime_open_file_with_mime_type (dbusconn, uri, content_type);
g_free(uri);
}
if (r != 1) {
alertpanel_error(_("No registered viewer for this file type."));
}
goto out;
#endif
if ((partinfo->type == MIMETYPE_TEXT && !strcmp(partinfo->subtype, "html"))
&& prefs_common.uri_cmd && prefs_common.uri_cmd[0]) {
mime_command = g_strdup(prefs_common.uri_cmd);
@ -1853,6 +1883,7 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
prefs_common.mime_open_cmd_history =
add_history(prefs_common.mime_open_cmd_history, cmd);
}
out:
g_free(content_type);
g_free(filename);
}

View file

@ -860,18 +860,24 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
TEXTVIEW_INSERT(_(" - To save, select "));
TEXTVIEW_INSERT_LINK(_("'Save as...'"), "sc://save_as", NULL);
#ifndef MAEMO
TEXTVIEW_INSERT(_(" (Shortcut key: 'y')\n"));
#endif
TEXTVIEW_INSERT(_(" - To display as text, select "));
TEXTVIEW_INSERT_LINK(_("'Display as text'"), "sc://display_as_text", NULL);
#ifndef MAEMO
TEXTVIEW_INSERT(_(" (Shortcut key: 't')\n"));
#endif
TEXTVIEW_INSERT(_(" - To open with an external program, select "));
TEXTVIEW_INSERT_LINK(_("'Open'"), "sc://open", NULL);
#ifndef MAEMO
TEXTVIEW_INSERT(_(" (Shortcut key: 'l')\n"));
TEXTVIEW_INSERT(_(" (alternately double-click, or click the middle "));
TEXTVIEW_INSERT(_("mouse button)\n"));
TEXTVIEW_INSERT(_(" - Or use "));
TEXTVIEW_INSERT_LINK(_("'Open with...'"), "sc://open_with", NULL);
TEXTVIEW_INSERT(_(" (Shortcut key: 'o')\n"));
#endif
textview_show_icon(textview, GTK_STOCK_DIALOG_INFO);
}