about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarco Peereboom <marco@conformal.com>2012-04-30 16:16:39 -0500
committerMarco Peereboom <marco@conformal.com>2012-04-30 16:19:17 -0500
commit2c942c203267f84febbf3e32ee7cad4e6b0b9aca (patch)
tree2614b4cc30c25bc905c261827090eb9b13e8dce2
parent3e06437a42bd5fa15f994f1670ad1801da5c112c (diff)
downloadxombrero-2c942c203267f84febbf3e32ee7cad4e6b0b9aca.tar.gz
add ctrl-enter for the windows heads
-rw-r--r--settings.c1
-rw-r--r--xxxterm.c23
2 files changed, 23 insertions, 1 deletions
diff --git a/settings.c b/settings.c
index 2a847de..fc2d124 100644
--- a/settings.c
+++ b/settings.c
@@ -766,6 +766,7 @@ struct key_binding	keys[] = {
 	{ "proxy toggle",	0,	1,	GDK_F2		},
 	{ "editelement",	CTRL,	1,	GDK_i		},
 	{ "passthrough",	CTRL,	1,	GDK_z		},
+	{ "modurl",		CTRL,	1,	GDK_Return	},
 
 	/* search */
 	{ "searchnext",		0,	0,	GDK_n		},
diff --git a/xxxterm.c b/xxxterm.c
index ac2d335..dd9d2a1 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -265,6 +265,7 @@ int			next_download_id = 1;
 
 void			xxx_dir(char *);
 int			icon_size_map(int);
+void			activate_uri_entry_cb(GtkWidget*, struct tab *);
 
 void
 history_delete(struct command_list *l, int *counter)
@@ -1052,6 +1053,25 @@ passthrough(struct tab *t, struct karg *args)
 }
 
 int
+modurl(struct tab *t, struct karg *args)
+{
+	const gchar		*uri = NULL;
+	char			*u = NULL;
+
+	/* XXX kind of a bad hack, but oh well */
+	if (GTK_WIDGET_HAS_FOCUS(t->uri_entry)) {
+		if ((uri = gtk_entry_get_text(GTK_ENTRY(t->uri_entry))) &&
+		    (strlen(uri))) {
+			u = g_strdup_printf("www.%s.com", uri);
+			gtk_entry_set_text(GTK_ENTRY(t->uri_entry), u);
+			g_free(u);
+			activate_uri_entry_cb(t->uri_entry, t);
+		}
+	}
+	return (0);
+}
+
+int
 hint(struct tab *t, struct karg *args)
 {
 
@@ -3000,7 +3020,8 @@ struct cmd {
 	{ "togglesrc",		0,	toggle_src,		0,			0 },
 	{ "editsrc",		0,	edit_src,		0,			0 },
 	{ "editelement",	0,	edit_element,		0,			0 },
-	{ "passthrough",	0,	passthrough,		0,	0 },
+	{ "passthrough",	0,	passthrough,		0,			0 },
+	{ "modurl",		0,	modurl,			0,			0 },
 
 	/* yanking and pasting */
 	{ "yankuri",		0,	yank_uri,		0,			0 },