From 19db1dd05caf52db5d8d5c5187f1406fd99a9627 Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Tue, 28 Apr 2009 08:12:16 +0100 Subject: Added 'exit' command (bound to 'k' by default). --- examples/configs/sampleconfig | 1 + examples/configs/sampleconfig-dev | 1 + uzbl.c | 12 +++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index b92acc2..94cbbb8 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -32,6 +32,7 @@ follow_link_new_window = w zoom_in = + zoom_out = - toggle_status = t +exit = k [bindings_external] /bin/bash /usr/share/uzbl/examples/scripts/insert_bookmark.sh = B diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index f7f3bb7..4281ab8 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -32,6 +32,7 @@ follow_link_new_window = w zoom_in = + zoom_out = - toggle_status = t +exit = k [bindings_external] /bin/bash ./examples/scripts/insert_bookmark.sh = B diff --git a/uzbl.c b/uzbl.c index 438dae3..422607f 100644 --- a/uzbl.c +++ b/uzbl.c @@ -110,6 +110,9 @@ update_title (GtkWindow* window); static void load_uri ( WebKitWebView * web_view, const gchar * uri); +static void +close_uzbl ( WebKitWebView * web_view); + static gboolean run_command(const char *command, const char *args); @@ -245,7 +248,8 @@ static Command commands[] = { "zoom_in", &webkit_web_view_zoom_in, NULL }, //Can crash (when max zoom reached?). { "zoom_out", &webkit_web_view_zoom_out, NULL }, { "uri", (void *) NULL, &load_uri }, - { "toggle_status", &toggle_status_cb, NULL } + { "toggle_status", &toggle_status_cb, NULL }, + { "exit" , &close_uzbl, NULL }, //{ "get uri", &webkit_web_view_get_uri}, }; @@ -273,6 +277,12 @@ load_uri (WebKitWebView * web_view, const gchar * uri) { } +static void +close_uzbl (WebKitWebView * web_view) { + (void) web_view; + gtk_main_quit (); +} + // make sure to put '' around args, so that if there is whitespace we can still keep arguments together. static gboolean run_command(const char *command, const char *args) { -- cgit v1.2.3