[Xfce4-commits] Unconditionally propagae modified user-agent property value
Updating branch refs/heads/master to c056a21d1ab66f7647e9d2a3b38f03c3568caea6 (commit) from 34bc4fa737756e003a53ffc65b436ee157c26000 (commit) commit c056a21d1ab66f7647e9d2a3b38f03c3568caea6 Author: Christian Dywan Date: Mon Feb 1 23:42:35 2010 +0100 Unconditionally propagae modified user-agent property value midori/midori-websettings.c |9 - 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index c53802e..0a75752 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -1518,12 +1518,11 @@ midori_web_settings_set_property (GObject* object, break; case PROP_USER_AGENT: if (web_settings->identify_as == MIDORI_IDENT_CUSTOM) -{ katze_assign (web_settings->ident_string, g_value_dup_string (value)); -#if WEBKIT_CHECK_VERSION (1, 1, 11) -g_object_set (web_settings, "WebKitWebSettings::user-agent", web_settings->ident_string, NULL); -#endif -} +#if WEBKIT_CHECK_VERSION (1, 1, 11) +g_object_set (web_settings, "WebKitWebSettings::user-agent", +web_settings->ident_string, NULL); +#endif break; case PROP_PREFERRED_LANGUAGES: katze_assign (web_settings->http_accept_language, g_value_dup_string (value)); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Always enable developer extras regardless of the saved value
Updating branch refs/heads/master to c9c9351ffb30ba94bd6a792f5df76b7dd51195ec (commit) from c056a21d1ab66f7647e9d2a3b38f03c3568caea6 (commit) commit c9c9351ffb30ba94bd6a792f5df76b7dd51195ec Author: Christian Dywan Date: Mon Feb 1 23:54:15 2010 +0100 Always enable developer extras regardless of the saved value midori/main.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/midori/main.c b/midori/main.c index fdfa641..139d5d5 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1823,6 +1823,7 @@ main (intargc, config_file = build_config_filename ("config"); error = NULL; settings = settings_new_from_file (config_file, &extensions); +g_object_set (settings, "enable-developer-extras", TRUE, NULL); katze_assign (config_file, build_config_filename ("accels")); if (g_access (config_file, F_OK) != 0) katze_assign (config_file, sokoke_find_config_filename (NULL, "accels")); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Do not populate the history array from sqlite at startup
Updating branch refs/heads/master to 57ce6cbe21f23e7bc7bf5b82b0847745836979dd (commit) from b94b73713069d30a0f66cb3771c78f6619947dc2 (commit) commit 57ce6cbe21f23e7bc7bf5b82b0847745836979dd Author: Alexander Butenko Date: Tue Feb 2 21:02:45 2010 +0100 Do not populate the history array from sqlite at startup midori/main.c | 204 - 1 files changed, 0 insertions(+), 204 deletions(-) diff --git a/midori/main.c b/midori/main.c index 139d5d5..353ace3 100644 --- a/midori/main.c +++ b/midori/main.c @@ -352,154 +352,13 @@ search_engines_save_to_file (KatzeArray* search_engines, } #if HAVE_SQLITE -/* sqlite method for retrieving the date/ time */ -static int -gettimestr (void* data, -intargc, -char** argv, -char** colname) -{ -KatzeItem* item = KATZE_ITEM (data); -(void) colname; - -g_return_val_if_fail (argc == 1, 1); - -katze_item_set_added (item, g_ascii_strtoull (argv[0], NULL, 10)); -return 0; -} - -static void -midori_history_remove_item_cb (KatzeArray* history, - KatzeItem* item, - sqlite3*db) -{ -gchar* sqlcmd; -char* errmsg = NULL; - -g_return_if_fail (KATZE_IS_ITEM (item)); - -sqlcmd = sqlite3_mprintf ( -"DELETE FROM history WHERE uri = '%q' AND" -" title = '%q' AND date = %llu", -katze_item_get_uri (item), -katze_item_get_name (item), -katze_item_get_added (item)); -if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) -{ -g_printerr (_("Failed to remove history item: %s\n"), errmsg); -sqlite3_free (errmsg); -} -sqlite3_free (sqlcmd); -} - -static void -midori_history_clear_before_cb (KatzeArray* item, -sqlite3*db) -{ -g_signal_handlers_block_by_func (item, midori_history_remove_item_cb, db); -} - -static void -midori_history_clear_cb (KatzeArray* history, - sqlite3*db) -{ -char* errmsg = NULL; - -g_return_if_fail (KATZE_IS_ARRAY (history)); - -if (sqlite3_exec (db, "DELETE FROM history", NULL, NULL, &errmsg) != SQLITE_OK) -{ -g_printerr (_("Failed to clear history: %s\n"), errmsg); -sqlite3_free (errmsg); -} -} - -static void -midori_history_notify_item_cb (KatzeItem* item, - GParamSpec* pspec, - sqlite3*db) -{ -gchar* sqlcmd; -char* errmsg = NULL; - -sqlcmd = sqlite3_mprintf ("UPDATE history SET title='%q' WHERE " - "uri='%q' AND date=%llu", - katze_item_get_name (item), - katze_item_get_uri (item), - katze_item_get_added (item)); -if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) -{ -g_printerr (_("Failed to update history item: %s\n"), errmsg); -sqlite3_free (errmsg); -} -sqlite3_free (sqlcmd); -} - -static void -midori_history_add_item_cb (KatzeArray* array, -KatzeItem* item, -sqlite3*db) -{ -gchar* sqlcmd; -int success; -char* errmsg = NULL; - -g_return_if_fail (KATZE_IS_ITEM (item)); - -if (KATZE_IS_ARRAY (item)) -{ -g_signal_connect_after (item, "add-item", -G_CALLBACK (midori_history_add_item_cb), db); -g_signal_connect (item, "remove-item", -G_CALLBACK (midori_history_remove_item_cb), db); -g_signal_connect (item, "clear", -G_CALLBACK (midori_history_clear_before_cb), db); -return; -} - -/* New item, set added to the current date/ time */ -if (!katze_item_get_added (item)) -{ -if (sqlite3_exec (db, "SELECT date('now')", - gettimestr, item, &errmsg) != SQLITE_OK) -{ -g_printerr (_("Failed to get current time: %s\n"), errmsg); -sqlite3_free (errmsg); -return; -} -} -sqlcmd = sqlite3_mprintf ("INSERT INTO history VALUES" - "('%q', '%q', %llu," - " %llu)", - katze_item_get_uri (item), - katze_item_get_name (item), - katze_item_get_added (item), - katze_item_get_added (KATZE_ITEM (array))); -success = sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg); -sqlite3_free (sqlcmd); -if (success != SQLITE_OK) -{ -g_printerr (_("Failed to add history item: %s\n"), errmsg); -sqlite3_free (errmsg); -return ; -} - -/* The title is set after the item is added */ -g_signal_connect_after (item, "notify::name", -G_CALLBACK (midori_history_notify_item_cb), db
[Xfce4-commits] Re-implement history panel based on sqlite queries
Updating branch refs/heads/master to 3848becaa6e3617bde2c8f0387a40c414d422b91 (commit) from 57ce6cbe21f23e7bc7bf5b82b0847745836979dd (commit) commit 3848becaa6e3617bde2c8f0387a40c414d422b91 Author: Alexander Butenko Date: Tue Feb 2 21:10:03 2010 +0100 Re-implement history panel based on sqlite queries panels/midori-history.c | 466 --- 1 files changed, 202 insertions(+), 264 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index b198e7a..ba63067 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -31,6 +31,12 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, gboolean new_bookmark, gboolean is_folder); +#include "config.h" + +#if HAVE_SQLITE +#include +#endif + struct _MidoriHistory { GtkVBox parent_instance; @@ -114,6 +120,144 @@ midori_history_get_stock_id (MidoriViewable* viewable) return STOCK_HISTORY; } +#if HAVE_SQLITE +static void +midori_history_clear_db (MidoriHistory* history) +{ +gchar* sqlcmd; +sqlite3* db; +char* errmsg = NULL; + +db = g_object_get_data (G_OBJECT (history->array), "db"); +sqlcmd = sqlite3_mprintf ("DELETE FROM history"); + +if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +{ +g_printerr (_("Failed to remove history item: %s\n"), errmsg); +sqlite3_free (errmsg); +} + +sqlite3_free (sqlcmd); +} + +static void +midori_history_remove_item_from_db (MidoriHistory* history, +KatzeItem* item, +intage) +{ +gchar* sqlcmd; +sqlite3* db; +char* errmsg = NULL; + +db = g_object_get_data (G_OBJECT (history->array), "db"); + +if (katze_item_get_uri (item)) +sqlcmd = sqlite3_mprintf ( +"DELETE FROM history WHERE uri = '%q' AND" +" title = '%q' AND date = %llu", +katze_item_get_uri (item), +katze_item_get_name (item), +katze_item_get_added (item)); +else + sqlcmd = sqlite3_mprintf ( +"DELETE FROM history WHERE day = %d", katze_item_get_added (item)); + +if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +{ +g_printerr (_("Failed to remove history item: %s\n"), errmsg); +sqlite3_free (errmsg); +} + +sqlite3_free (sqlcmd); +} + +static gboolean +midori_history_read_from_db (MidoriHistory* history, + GtkTreeModel* model, + GtkTreeIter* parent, + intreq_day) +{ +sqlite3* db; +sqlite3_stmt* statement; +gint result; +gchar* sqlcmd; + +GtkTreeIter iter; +GtkTreeIter root_iter; + +db = g_object_get_data (G_OBJECT (history->array), "db"); + +if (req_day == 0) +sqlcmd = g_strdup ("SELECT day, date, " + "(strftime ('%s','now') - date) / 86400 as age " + " FROM history GROUP BY day ORDER BY day ASC"); +else +sqlcmd = g_strdup_printf ("SELECT uri, title, date, day " + " FROM history WHERE day = '%d' " + " GROUP BY uri ORDER BY date ASC", req_day); + +if (sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL) != SQLITE_OK) +{ +g_free (sqlcmd); +return FALSE; +} +g_free (sqlcmd); + +while ((result = sqlite3_step (statement)) == SQLITE_ROW) +{ +KatzeItem* item; +const unsigned char* uri; +const unsigned char* title; +sqlite3_int64 date; +sqlite3_int64 day; +sqlite3_int64 age; +gchar token[50]; + +if (req_day == 0) +{ +day = sqlite3_column_int64 (statement, 0); +date = sqlite3_column_int64 (statement, 1); +age = sqlite3_column_int64 (statement, 2); + +item = katze_item_new (); +katze_item_set_added (item, day); +strftime (token, sizeof (token), "%x", localtime ((time_t *)&date)); +katze_item_set_name (item, token); +gtk_tree_store_insert_with_values (GTK_TREE_STORE (model), &root_iter, NULL, + 0, 0, item, 1, age, -1); +/* FIXME: Always show expanders even if no child nodes? */ +gtk_tree_store_insert_with_values (GTK_TREE_STORE (model), &iter, &root_iter, + 0, 0, item, 1, -1, -1); +} +else +{ +uri = sqlite3_column_text (statement, 0); +title = sqlite3_column_text (statement, 1); +date = sqlite3_column_int64 (statement, 2); +day = sqlite3_column_int64 (statement, 3); +if (!uri) +
[Xfce4-commits] Rebuild adblock js after download a new filter file
Updating branch refs/heads/master to 62dac745d69a4dec938bc8e16502c0bc37d668cf (commit) from 3848becaa6e3617bde2c8f0387a40c414d422b91 (commit) commit 62dac745d69a4dec938bc8e16502c0bc37d668cf Author: Alexander Butenko Date: Tue Feb 2 21:26:05 2010 +0100 Rebuild adblock js after download a new filter file extensions/adblock.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index c7af950..cdfc5ad 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -92,6 +92,7 @@ adblock_download_notify_status_cb (WebKitDownload* download, return; adblock_parse_file (path); +katze_assign (blockscript, adblock_build_js (blockcss, blockcssprivate)); g_free (path); /* g_object_unref (download); */ } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Rebuild formhistory script on reload and do not leak the script
Updating branch refs/heads/master to ce43fb3c03b72547eca6104362b90c60ab1d4cfb (commit) from 62dac745d69a4dec938bc8e16502c0bc37d668cf (commit) commit ce43fb3c03b72547eca6104362b90c60ab1d4cfb Author: Alexander Butenko Date: Tue Feb 2 21:31:15 2010 +0100 Rebuild formhistory script on reload and do not leak the script 1. Don't leak the script in formhistory_window_object_cleared_cb () 2. Disconnect add-tab signal in the right place 3. Rebuild the base javascript code on extension reload extensions/formhistory.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 8404ea1..6c1548e 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -291,7 +291,10 @@ formhistory_window_object_cleared_cb (WebKitWebView* web_view, JSContextRefjs_context, JSObjectRef js_window) { -sokoke_js_script_eval (js_context, formhistory_build_js (), NULL); +gchar* script; +script = formhistory_build_js (); +sokoke_js_script_eval (js_context, script, NULL); +g_free (script); } static void @@ -343,8 +346,6 @@ formhistory_deactivate_tabs (MidoriView* view, { GtkWidget* web_view = gtk_bin_get_child (GTK_BIN (view)); g_signal_handlers_disconnect_by_func ( - browser, formhistory_add_tab_cb, extension); -g_signal_handlers_disconnect_by_func ( web_view, formhistory_window_object_cleared_cb, NULL); #if WEBKIT_CHECK_VERSION (1, 1, 4) g_signal_handlers_disconnect_by_func ( @@ -365,13 +366,15 @@ formhistory_deactivate_cb (MidoriExtension* extension, #endif g_signal_handlers_disconnect_by_func ( + browser, formhistory_add_tab_cb, extension); +g_signal_handlers_disconnect_by_func ( extension, formhistory_deactivate_cb, browser); g_signal_handlers_disconnect_by_func ( app, formhistory_app_add_browser_cb, extension); midori_browser_foreach (browser, (GtkCallback)formhistory_deactivate_tabs, extension); -jsforms = ""; +katze_assign (jsforms, NULL); if (global_keys) g_hash_table_destroy (global_keys); @@ -428,6 +431,8 @@ formhistory_activate_cb (MidoriExtension* extension, global_keys = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, (GDestroyNotify)g_free); +if(!jsforms) +formhistory_prepare_js (); #if HAVE_SQLITE config_dir = midori_extension_get_config_dir (extension); katze_mkdir_with_parents (config_dir, 0700); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Load about:blank in private window if URI is empty
Updating branch refs/heads/master to b4a414f3717faca39be65343035bf944b83ec9fe (commit) from ce43fb3c03b72547eca6104362b90c60ab1d4cfb (commit) commit b4a414f3717faca39be65343035bf944b83ec9fe Author: Christian Dywan Date: Tue Feb 2 22:29:31 2010 +0100 Load about:blank in private window if URI is empty midori/midori-browser.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 779ab4c..0bca342 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2176,8 +2176,13 @@ _action_private_browsing_activate (GtkAction* action, { const gchar* uri = midori_browser_get_current_uri (browser); if (uri != NULL) +{ /* FIXME: Use the same binary that is running right now */ -sokoke_spawn_program ("midori -a", uri, FALSE); +if (*uri != '\0') +sokoke_spawn_program ("midori -a", uri, FALSE); +else +sokoke_spawn_program ("midori -a", "about:blank", FALSE); +} } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Render history dates directly without age column or render callback
Updating branch refs/heads/master to bee4615d1007f5d8295afc364c9f0df8108ab1ee (commit) from b4a414f3717faca39be65343035bf944b83ec9fe (commit) commit bee4615d1007f5d8295afc364c9f0df8108ab1ee Author: Christian Dywan Date: Tue Feb 2 23:51:49 2010 +0100 Render history dates directly without age column or render callback Resurrect sokoke_days_between for calculating age in days. midori/sokoke.c | 31 ++ midori/sokoke.h |4 + panels/midori-history.c | 151 ++ 3 files changed, 94 insertions(+), 92 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 504dedf..f307fe7 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -1146,6 +1146,37 @@ sokoke_time_t_to_julian (const time_t* timestamp) } /** + * sokoke_days_between: + * @day1: a time_t timestamp value + * @day2: a time_t timestamp value + * + * Calculates the number of days between two timestamps. + * + * Return value: an integer. + **/ +gint +sokoke_days_between (const time_t* day1, + const time_t* day2) +{ +GDate* date1; +GDate* date2; +gint age; + +date1 = g_date_new (); +date2 = g_date_new (); + +g_date_set_time_t (date1, *day1); +g_date_set_time_t (date2, *day2); + +age = g_date_days_between (date1, date2); + +g_date_free (date1); +g_date_free (date2); + +return age; +} + +/** * sokoke_register_stock_items: * * Registers several custom stock items used throughout Midori. diff --git a/midori/sokoke.h b/midori/sokoke.h index 0896ce7..e8a6d7f 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -182,6 +182,10 @@ sokoke_action_create_popup_menu_item(GtkAction* action); gint64 sokoke_time_t_to_julian (const time_t* timestamp); +gint +sokoke_days_between (const time_t* day1, + const time_t* day2); + void sokoke_register_stock_items (void); diff --git a/panels/midori-history.c b/panels/midori-history.c index ba63067..87d2153 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -142,8 +142,7 @@ midori_history_clear_db (MidoriHistory* history) static void midori_history_remove_item_from_db (MidoriHistory* history, -KatzeItem* item, -intage) +KatzeItem* item) { gchar* sqlcmd; sqlite3* db; @@ -173,7 +172,7 @@ midori_history_remove_item_from_db (MidoriHistory* history, static gboolean midori_history_read_from_db (MidoriHistory* history, - GtkTreeModel* model, + GtkTreeStore* model, GtkTreeIter* parent, intreq_day) { @@ -188,9 +187,8 @@ midori_history_read_from_db (MidoriHistory* history, db = g_object_get_data (G_OBJECT (history->array), "db"); if (req_day == 0) -sqlcmd = g_strdup ("SELECT day, date, " - "(strftime ('%s','now') - date) / 86400 as age " - " FROM history GROUP BY day ORDER BY day ASC"); +sqlcmd = g_strdup ("SELECT day, date " + "FROM history GROUP BY day ORDER BY day ASC"); else sqlcmd = g_strdup_printf ("SELECT uri, title, date, day " " FROM history WHERE day = '%d' " @@ -210,24 +208,59 @@ midori_history_read_from_db (MidoriHistory* history, const unsigned char* title; sqlite3_int64 date; sqlite3_int64 day; -sqlite3_int64 age; -gchar token[50]; if (req_day == 0) { +time_t current_time; +gint age; +gchar token[50]; +gchar* sdate; + day = sqlite3_column_int64 (statement, 0); date = sqlite3_column_int64 (statement, 1); -age = sqlite3_column_int64 (statement, 2); item = katze_item_new (); katze_item_set_added (item, day); -strftime (token, sizeof (token), "%x", localtime ((time_t *)&date)); -katze_item_set_name (item, token); -gtk_tree_store_insert_with_values (GTK_TREE_STORE (model), &root_iter, NULL, - 0, 0, item, 1, age, -1); +current_time = time (NULL); +age = sokoke_days_between ((time_t*)&date, ¤t_time); + +/* A negative age is a date in the future, the clock is probably off */ +if (age < -1) +{ +static gboolean clock_warning = FALSE; +if (!clock_warning) +{ +midori_app_send_n
[Xfce4-commits] Don't cache local adblock filters, and remove disabled filter files
Updating branch refs/heads/master to de7818b7aa5c7ba02f0208fa095f1843d0dd44b2 (commit) from bee4615d1007f5d8295afc364c9f0df8108ab1ee (commit) commit de7818b7aa5c7ba02f0208fa095f1843d0dd44b2 Author: Alexander Butenko Date: Wed Feb 3 18:26:44 2010 +0100 Don't cache local adblock filters, and remove disabled filter files extensions/adblock.c | 65 ++--- 1 files changed, 50 insertions(+), 15 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index cdfc5ad..c04a8ce 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -97,12 +97,37 @@ adblock_download_notify_status_cb (WebKitDownload* download, /* g_object_unref (download); */ } +static gchar* +adblock_get_filename_for_uri (const gchar* uri) +{ +gchar* filename; +gchar* folder; +gchar* path; + +if (strchr (uri + 4,'-')) +return NULL; + +if (!strncmp (uri, "file", 4)) +return g_strndup (uri + 7, strlen (uri) - 7); + +folder = g_build_filename (g_get_user_cache_dir (), PACKAGE_NAME, + "adblock", NULL); +katze_mkdir_with_parents (folder, 0700); + +filename = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); +path = g_build_filename (folder, filename, NULL); + +g_free (filename); +g_free (folder); +return path; +} + static void adblock_reload_rules (MidoriExtension* extension, gboolean custom_only) { +gchar* path; gchar* custom_list; -gchar* folder; gchar** filters; guint i = 0; @@ -116,21 +141,22 @@ adblock_reload_rules (MidoriExtension* extension, filters = midori_extension_get_string_list (extension, "filters", NULL); if (!custom_only && filters && *filters) { -folder = g_build_filename (g_get_user_cache_dir (), PACKAGE_NAME, - "adblock", NULL); -katze_mkdir_with_parents (folder, 0700); -while (filters[i++] != NULL) +while (filters[i] != NULL) { -gchar* filename = g_compute_checksum_for_string (G_CHECKSUM_MD5, - filters[i - 1], -1); -gchar* path = g_build_filename (folder, filename, NULL); +path = adblock_get_filename_for_uri (filters[i]); +if (!path) +{ +i++; +continue; +} + if (!adblock_parse_file (path)) { WebKitNetworkRequest* request; WebKitDownload* download; gchar* destination = g_filename_to_uri (path, NULL, NULL); -request = webkit_network_request_new (filters[i -1]); +request = webkit_network_request_new (filters[i]); download = webkit_download_new (request); g_object_unref (request); webkit_download_set_destination_uri (download, destination); @@ -141,9 +167,8 @@ adblock_reload_rules (MidoriExtension* extension, } else g_free (path); -g_free (filename); +i++; } -g_free (folder); } g_strfreev (filters); @@ -186,9 +211,9 @@ adblock_preferences_renderer_text_edited_cb (GtkCellRenderer* renderer, } static void -adblock_preferences_renderer_toggle_toggled_cb (GtkTreeViewColumn* column, -const gchar* path, -GtkTreeModel* model) +adblock_preferences_renderer_toggle_toggled_cb (GtkCellRendererToggle* renderer, +const gchar* path, +GtkTreeModel* model) { GtkTreeIter iter; @@ -200,7 +225,17 @@ adblock_preferences_renderer_toggle_toggled_cb (GtkTreeViewColumn* column, if (ADBLOCK_FILTER_VALID (filter)) { -filter[4] = filter[4] != '-' ? '-' : ':'; +filter[4] = ':'; +if (gtk_cell_renderer_toggle_get_active (renderer)) +{ +if (!strncmp (filter, "http", 4)) +{ +gchar* filename = adblock_get_filename_for_uri (filter); +g_unlink (filename); +g_free (filename); +} +filter[4] = '-'; +} gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, filter, -1); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only connect liststore after populating the model with filters
Updating branch refs/heads/master to 27653d6670444ac6dac25ab0d62e51151fc78505 (commit) from de7818b7aa5c7ba02f0208fa095f1843d0dd44b2 (commit) commit 27653d6670444ac6dac25ab0d62e51151fc78505 Author: Alexander Butenko Date: Wed Feb 3 18:30:48 2010 +0100 Only connect liststore after populating the model with filters We don't want to reload the rules for each row. extensions/adblock.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index c04a8ce..5035e33 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -446,14 +446,6 @@ adblock_get_preferences_dialog (MidoriExtension* extension) entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 4); liststore = gtk_list_store_new (1, G_TYPE_STRING); -g_object_connect (liststore, -"signal::row-inserted", -adblock_preferences_model_row_changed_cb, extension, -"signal::row-changed", -adblock_preferences_model_row_changed_cb, extension, -"signal::row-deleted", -adblock_preferences_model_row_deleted_cb, extension, -NULL); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (liststore)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); column = gtk_tree_view_column_new (); @@ -492,6 +484,14 @@ adblock_get_preferences_dialog (MidoriExtension* extension) NULL, i - 1, 0, filters[i -1], -1); } g_strfreev (filters); +g_object_connect (liststore, +"signal::row-inserted", +adblock_preferences_model_row_changed_cb, extension, +"signal::row-changed", +adblock_preferences_model_row_changed_cb, extension, +"signal::row-deleted", +adblock_preferences_model_row_deleted_cb, extension, +NULL); g_object_unref (liststore); vbox = gtk_vbox_new (FALSE, 4); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only query the current time once when populating the history
Updating branch refs/heads/master to ae1ea1214bb056dbc294c32e84e769dae84c907f (commit) from 297d38e7d0496ad1b42f7e93e0bcaae73de25c02 (commit) commit ae1ea1214bb056dbc294c32e84e769dae84c907f Author: Christian Dywan Date: Wed Feb 3 18:42:58 2010 +0100 Only query the current time once when populating the history panels/midori-history.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 87d2153..3f56ddb 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -180,6 +180,7 @@ midori_history_read_from_db (MidoriHistory* history, sqlite3_stmt* statement; gint result; gchar* sqlcmd; +time_t current_time; GtkTreeIter iter; GtkTreeIter root_iter; @@ -201,6 +202,8 @@ midori_history_read_from_db (MidoriHistory* history, } g_free (sqlcmd); +current_time = time (NULL); + while ((result = sqlite3_step (statement)) == SQLITE_ROW) { KatzeItem* item; @@ -211,7 +214,6 @@ midori_history_read_from_db (MidoriHistory* history, if (req_day == 0) { -time_t current_time; gint age; gchar token[50]; gchar* sdate; @@ -221,7 +223,6 @@ midori_history_read_from_db (MidoriHistory* history, item = katze_item_new (); katze_item_set_added (item, day); -current_time = time (NULL); age = sokoke_days_between ((time_t*)&date, ¤t_time); /* A negative age is a date in the future, the clock is probably off */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use the correct theme detail for < GTK+ 2.18 entry progress
Updating branch refs/heads/master to 297d38e7d0496ad1b42f7e93e0bcaae73de25c02 (commit) from 27653d6670444ac6dac25ab0d62e51151fc78505 (commit) commit 297d38e7d0496ad1b42f7e93e0bcaae73de25c02 Author: Christian Dywan Date: Wed Feb 3 18:41:54 2010 +0100 Use the correct theme detail for < GTK+ 2.18 entry progress midori/gtkiconentry.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/midori/gtkiconentry.c b/midori/gtkiconentry.c index d8e0d69..cfdacf9 100644 --- a/midori/gtkiconentry.c +++ b/midori/gtkiconentry.c @@ -610,7 +610,7 @@ entry_expose_event (GtkWidget* entry, { gtk_paint_box (entry->style, text_area, GTK_STATE_SELECTED, GTK_SHADOW_OUT, - &event->area, entry, "bar", + &event->area, entry, "entry-progress", 0, 0, priv->fraction * width, height); gtk_entry_draw_text (GTK_ENTRY (entry)); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Implement an 'Edit rule' dialogue when blocking images
Updating branch refs/heads/master to c550d366499f1ab8db19721dd2faab825231f9e1 (commit) from ae1ea1214bb056dbc294c32e84e769dae84c907f (commit) commit c550d366499f1ab8db19721dd2faab825231f9e1 Author: Alexander Butenko Date: Wed Feb 3 18:58:07 2010 +0100 Implement an 'Edit rule' dialogue when blocking images extensions/adblock.c | 47 --- 1 files changed, 44 insertions(+), 3 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 5035e33..73b2146 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -803,7 +803,48 @@ adblock_custom_block_image_cb (GtkWidget* widget, { gchar* custom_list; FILE* list; -gchar* uri; +MidoriApp* app; +GtkWidget* browser; +GtkWidget* dialog; +GtkSizeGroup* sizegroup; +GtkWidget* hbox; +GtkWidget* label; +GtkWidget* entry; +gchar* title; + +app = midori_extension_get_app (extension); +browser = katze_object_get_object (app, "browser"); + +title = _("Edit rule"); +dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser), +GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, +GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, +GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, +NULL); +gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_ADD); +gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); +gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5); +sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + +hbox = gtk_hbox_new (FALSE, 8); +gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); +label = gtk_label_new_with_mnemonic (_("_Rule:")); +gtk_size_group_add_widget (sizegroup, label); +gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); +entry = gtk_entry_new (); +gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); +gtk_entry_set_text (GTK_ENTRY (entry), +g_object_get_data (G_OBJECT (widget), "uri")); +gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); +gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_widget_show_all (hbox); + +gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); +if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT) +{ +gtk_widget_destroy (dialog); +return; +} custom_list = g_build_filename (midori_extension_get_config_dir (extension), CUSTOM_LIST_NAME, NULL); @@ -812,13 +853,13 @@ adblock_custom_block_image_cb (GtkWidget* widget, g_free (custom_list); return; } -uri = g_object_get_data (G_OBJECT (widget), "uri"); -g_fprintf (list, "%s\n", uri); +g_fprintf (list, "%s\n", gtk_entry_get_text (GTK_ENTRY (entry))); fclose (list); adblock_reload_rules (extension, TRUE); g_free (custom_list); +gtk_widget_destroy (dialog); } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Clear the history folders on collapse, repopulate on expand
Updating branch refs/heads/master to 1a236a380098971bf3fedb68ac46ca7ae48d98a2 (commit) from 42a29682e6081afcf2aee07df19099278c4ebd65 (commit) commit 1a236a380098971bf3fedb68ac46ca7ae48d98a2 Author: Alexander Butenko Date: Wed Feb 3 22:13:00 2010 +0100 Clear the history folders on collapse, repopulate on expand panels/midori-history.c | 18 -- 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 3f56ddb..1c6f748 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -808,20 +808,26 @@ midori_history_row_expanded_cb (GtkTreeView* treeview, model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); gtk_tree_model_get (model, iter, 0, &item, -1); -/* FIXME: We need always repopulate parent. Now ignoring dupes */ -if (gtk_tree_model_iter_n_children (model, iter) < 2) -midori_history_read_from_db (history, GTK_TREE_STORE (model), - iter, katze_item_get_added (item)); +midori_history_read_from_db (history, GTK_TREE_STORE (model), + iter, katze_item_get_added (item)); g_object_unref (item); } static void midori_history_row_collapsed_cb (GtkTreeView *treeview, - GtkTreeIter *iter, + GtkTreeIter *parent, GtkTreePath *path, gpointer user_data) { -/* FIXME: Free parent childs on close and repopulate them again on open */ +GtkTreeModel* model; +GtkTreeIter child; + +model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); +while (gtk_tree_model_iter_n_children (model, parent) > 1) +{ +if (gtk_tree_model_iter_children (model, &child, parent)) +gtk_tree_store_remove (GTK_TREE_STORE (model), &child); +} } #endif ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Make the Delete key delete history entries again
Updating branch refs/heads/master to a90dc507ff19b7ec605752e83799ad9fcb7ca830 (commit) from 1a236a380098971bf3fedb68ac46ca7ae48d98a2 (commit) commit a90dc507ff19b7ec605752e83799ad9fcb7ca830 Author: Alexander Butenko Date: Wed Feb 3 22:15:49 2010 +0100 Make the Delete key delete history entries again panels/midori-history.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 1c6f748..a50b7d8 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -768,13 +768,10 @@ midori_history_key_release_event_cb (GtkWidget* widget, if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (widget), &model, &iter)) { KatzeItem* item; -KatzeArray* parent; gtk_tree_model_get (model, &iter, 0, &item, -1); - -parent = katze_item_get_parent (item); -katze_array_remove_item (parent, item); - +midori_history_remove_item_from_db (history, item); +gtk_tree_store_remove (GTK_TREE_STORE (model), &iter); g_object_unref (item); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Do allow internal icons for views with an unreachable URI
Updating branch refs/heads/master to 4d05be6a5eb96113c1224a56bdae07d11ec3fcb3 (commit) from a90dc507ff19b7ec605752e83799ad9fcb7ca830 (commit) commit 4d05be6a5eb96113c1224a56bdae07d11ec3fcb3 Author: Christian Dywan Date: Wed Feb 3 22:18:51 2010 +0100 Do allow internal icons for views with an unreachable URI midori/midori-view.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 09b9e6b..752e0a3 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -865,8 +865,11 @@ midori_view_web_view_resource_request_cb (WebKitWebView* web_view, const gchar* uri = webkit_network_request_get_uri (request); /* Only apply custom URIs to special pages for security purposes */ -if (view->uri && *view->uri && strncmp (view->uri, "about:", 6)) +if (view->uri && *view->uri && strncmp (view->uri, "about:", 6) +&& !webkit_web_data_source_get_unreachable_uri ( +webkit_web_frame_get_data_source (web_frame))) return; + if (g_str_has_prefix (uri, "res://")) { gchar* filename = g_build_filename ("midori/res", &uri[5], NULL); @@ -964,8 +967,13 @@ webkit_web_view_load_error_cb (WebKitWebView* web_view, g_free (message); g_free (title); +#if WEBKIT_CHECK_VERSION (1, 1, 14) +webkit_web_frame_load_alternate_string (web_frame, +result, "about:blank", uri); +#else webkit_web_frame_load_alternate_string (web_frame, result, res_root, uri); +#endif g_free (res_root); g_free (stock_root); g_free (result); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Store visited pages in the history again
Updating branch refs/heads/master to 42a29682e6081afcf2aee07df19099278c4ebd65 (commit) from c550d366499f1ab8db19721dd2faab825231f9e1 (commit) commit 42a29682e6081afcf2aee07df19099278c4ebd65 Author: Alexander Butenko Date: Wed Feb 3 22:12:19 2010 +0100 Store visited pages in the history again midori/midori-browser.c | 76 +++ 1 files changed, 50 insertions(+), 26 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 0bca342..864bc13 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -50,6 +50,10 @@ #include #endif +#if HAVE_SQLITE +#include +#endif + struct _MidoriBrowser { #if HAVE_HILDON @@ -456,6 +460,31 @@ _midori_browser_update_progress (MidoriBrowser* browser, } static void +midori_browser_update_history_title (MidoriBrowser* browser, + KatzeItem* item) +{ +#if HAVE_SQLITE +sqlite3* db; +gchar* sqlcmd; +char* errmsg = NULL; + +db = g_object_get_data (G_OBJECT (browser->history), "db"); +sqlcmd = sqlite3_mprintf ("UPDATE history SET title='%q' WHERE" + " uri = '%q' and date=%d", + katze_item_get_name (item), + katze_item_get_uri (item), + katze_item_get_added (item)); + +if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +{ +g_printerr (_("Failed to insert new history item: %s\n"), errmsg); +sqlite3_free (errmsg); +} +sqlite3_free (sqlcmd); +#endif +} + +static void _midori_browser_activate_action (MidoriBrowser* browser, const gchar* name) { @@ -582,7 +611,10 @@ midori_view_notify_title_cb (GtkWidget* widget, item = g_object_get_data (G_OBJECT (view), "history-item-added"); proxy = midori_view_get_proxy_item (view); if (item && katze_item_get_added (item) == katze_item_get_added (proxy)) +{ katze_item_set_name (item, katze_item_get_name (proxy)); +midori_browser_update_history_title (browser, item); +} else { katze_object_assign (item, katze_item_copy (proxy)); @@ -5561,42 +5593,34 @@ static void midori_browser_new_history_item (MidoriBrowser* browser, KatzeItem**item) { -KatzeArray* parent; -gint i; -gboolean found; time_t now; gint64 day; -gchar token[50]; +#if HAVE_SQLITE +sqlite3* db; +gchar* sqlcmd; +char* errmsg = NULL; +#endif now = time (NULL); katze_item_set_added (*item, now); day = sokoke_time_t_to_julian (&now); -found = FALSE; -i = 0; -while ((parent = katze_array_get_nth_item (browser->history, i++))) -{ -gint64 pday = katze_item_get_added (KATZE_ITEM (parent)); -if (day - pday == 0) -{ -KatzeItem* _item; +#if HAVE_SQLITE +db = g_object_get_data (G_OBJECT (browser->history), "db"); +sqlcmd = sqlite3_mprintf ("INSERT INTO history (uri, title, date, day) VALUES " + "('%q', '%q', %d, %d)", + katze_item_get_uri (*item), + katze_item_get_name (*item), + katze_item_get_added (*item), + day); -found = TRUE; -if ((_item = katze_array_find_uri (parent, katze_item_get_uri (*item -*item = g_object_ref (_item); -else -katze_array_add_item (parent, *item); -} -} -if (!found) +if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) { -strftime (token, sizeof (token), "%x", localtime (&now)); -parent = katze_array_new (KATZE_TYPE_ARRAY); -katze_item_set_added (KATZE_ITEM (parent), day); -katze_item_set_name (KATZE_ITEM (parent), token); -katze_array_add_item (browser->history, parent); -katze_array_add_item (parent, *item); +g_printerr (_("Failed to insert new history item: %s\n"), errmsg); +sqlite3_free (errmsg); } +sqlite3_free (sqlcmd); +#endif } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Render dummy history items as separators
Updating branch refs/heads/master to 94aebbf1fe31a318391cee8c6d2e4e5ef8f9fd29 (commit) from 4d05be6a5eb96113c1224a56bdae07d11ec3fcb3 (commit) commit 94aebbf1fe31a318391cee8c6d2e4e5ef8f9fd29 Author: Christian Dywan Date: Wed Feb 3 23:48:07 2010 +0100 Render dummy history items as separators Until we find a better way this should reduce confusion about 'empty' folders appearing. panels/midori-history.c | 46 ++ 1 files changed, 38 insertions(+), 8 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index a50b7d8..bfd9ba6 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -256,9 +256,10 @@ midori_history_read_from_db (MidoriHistory* history, gtk_tree_store_insert_with_values (model, &root_iter, NULL, 0, 0, item, 1, sdate, -1); -/* FIXME: Always show expanders even if no child nodes? */ +/* That's an invisible dummy, so we always have an expander */ +/* FIXME: Hide this row */ gtk_tree_store_insert_with_values (model, &iter, &root_iter, -0, 0, item, 1, katze_item_get_name (item), -1); +0, 0, NULL, 1, NULL, -1); if (age > 1 && age < 7) g_free (sdate); @@ -354,11 +355,12 @@ midori_history_cursor_or_row_changed_cb (GtkTreeView* treeview, gtk_tree_model_get (model, &iter, 0, &item, -1); -is_page = !KATZE_IS_ARRAY (item) && katze_item_get_uri (item); +is_page = item && katze_item_get_uri (item); gtk_widget_set_sensitive (history->bookmark, is_page); gtk_widget_set_sensitive (history->delete, TRUE); -g_object_unref (item); +if (item) +g_object_unref (item); } else { @@ -503,11 +505,13 @@ midori_history_treeview_render_icon_cb (GtkTreeViewColumn* column, GtkWidget* treeview) { KatzeItem* item; -GdkPixbuf* pixbuf = NULL; +GdkPixbuf* pixbuf; gtk_tree_model_get (model, iter, 0, &item, -1); -if (katze_item_get_uri (item)) +if (!item) +pixbuf = NULL; +else if (katze_item_get_uri (item)) pixbuf = katze_load_cached_icon (katze_item_get_uri (item), treeview); else pixbuf = gtk_widget_render_icon (treeview, GTK_STOCK_DIRECTORY, @@ -516,9 +520,10 @@ midori_history_treeview_render_icon_cb (GtkTreeViewColumn* column, g_object_set (renderer, "pixbuf", pixbuf, NULL); if (pixbuf) +{ g_object_unref (pixbuf); - -g_object_unref (item); +g_object_unref (item); +} } #if HAVE_SQLITE @@ -538,6 +543,10 @@ midori_history_row_activated_cb (GtkTreeView* treeview, if (gtk_tree_model_get_iter (model, &iter, path)) { gtk_tree_model_get (model, &iter, 0, &item, -1); + +if (!item) +return; + uri = katze_item_get_uri (item); if (uri && *uri) { @@ -731,6 +740,9 @@ midori_history_button_release_event_cb (GtkWidget* widget, gtk_tree_model_get (model, &iter, 0, &item, -1); +if (!item) +return FALSE; + if (event->button == 2) { const gchar* uri = katze_item_get_uri (item); @@ -828,6 +840,22 @@ midori_history_row_collapsed_cb (GtkTreeView *treeview, } #endif +static gboolean +midori_history_row_sep_func (GtkTreeModel* model, + GtkTreeIter* iter, + MidoriHistory* history) +{ +KatzeItem* item; + +gtk_tree_model_get (model, iter, 0, &item, -1); + +if (item == NULL) +return TRUE; + +g_object_unref (item); +return FALSE; +} + static void midori_history_init (MidoriHistory* history) { @@ -844,6 +872,8 @@ midori_history_init (MidoriHistory* history) model = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_STRING); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); +gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (treeview), +(GtkTreeViewRowSeparatorFunc)midori_history_row_sep_func, history, NULL); column = gtk_tree_view_column_new (); renderer_pixbuf = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] NULL check the key before rendering suggestions
Updating branch refs/heads/master to c273d6c73aa2b048351813abefe6a2ff8d21e54e (commit) from 94aebbf1fe31a318391cee8c6d2e4e5ef8f9fd29 (commit) commit c273d6c73aa2b048351813abefe6a2ff8d21e54e Author: Alexander Butenko Date: Thu Feb 4 02:40:59 2010 +0100 NULL check the key before rendering suggestions midori/midori-locationaction.c | 22 ++ 1 files changed, 10 insertions(+), 12 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 77ecb60..596e3f7 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -997,6 +997,7 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, gchar* desc_uri; gchar* desc_title; GtkWidget* entry; +const gchar* str; gchar* key; gchar* start; gchar* skey; @@ -1009,26 +1010,27 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, -1); desc = desc_uri = desc_title = key = NULL; -key = g_utf8_strdown (gtk_entry_get_text (GTK_ENTRY (entry)), -1); -len = 0; +str = gtk_entry_get_text (GTK_ENTRY (entry)); +if (!str) +return; + +key = g_utf8_strdown (str, -1); +len = strlen (key); if (G_LIKELY (uri)) { temp = g_utf8_strdown (uri, -1); if ((start = strstr (temp, key)) && (start - temp)) { -len = strlen (key); skey = g_strndup (uri + (start - temp), len); parts = g_strsplit (uri, skey, 2); if (parts[0] && parts[1]) desc_uri = g_markup_printf_escaped ("%s%s%s", parts[0], skey, parts[1]); -else -desc_uri = g_markup_escape_text (uri, -1); g_strfreev (parts); g_free (skey); } -else +if (!desc_uri) desc_uri = g_markup_escape_text (uri, -1); g_free (temp); } @@ -1038,19 +1040,15 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, temp = g_utf8_strdown (title, -1); if ((start = strstr (temp, key)) && (start - temp)) { -if (!len) -len = strlen (key); skey = g_strndup (title + (start - temp), len); parts = g_strsplit (title, skey, 2); -if (parts && parts[0] && parts[1]) +if (parts[0] && parts[1]) desc_title = g_markup_printf_escaped ("%s%s%s", parts[0], skey, parts[1]); -else -desc_title = g_markup_escape_text (title, -1); g_strfreev (parts); g_free (skey); } -else +if (!desc_title) desc_title = g_markup_escape_text (title, -1); g_free (temp); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Show the combo arrow if the history table contains any rows
Updating branch refs/heads/master to 5887067e73da8fb63e2279d79ea55f20d9d837ea (commit) from af94855fee73cf0cad6aeace4300c23086f83f89 (commit) commit 5887067e73da8fb63e2279d79ea55f20d9d837ea Author: Alexander Butenko Date: Thu Feb 4 03:30:09 2010 +0100 Show the combo arrow if the history table contains any rows midori/midori-locationaction.c | 31 +++ 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 37e78c5..5df50ef 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -614,14 +614,29 @@ midori_location_action_finalize (GObject* object) static void midori_location_action_toggle_arrow_cb (GtkWidget*widget, MidoriLocationAction* location_action) -{ -if (GTK_IS_BUTTON (widget)) -{ -gboolean show = location_action->history -&& katze_array_get_nth_item (location_action->history, 0); -sokoke_widget_set_visible (widget, show); -gtk_widget_set_size_request (widget, show ? -1 : 1, show ? -1 : 1); -} +{gboolean show = FALSE; + +#if HAVE_SQLITE +sqlite3* db; +const gchar* sqlcmd; +sqlite3_stmt* statement; +gint result; +#endif + +if (!GTK_IS_BUTTON (widget)) +return; + +#if HAVE_SQLITE +db = g_object_get_data (G_OBJECT (location_action->history), "db"); +sqlcmd = "SELECT uri FROM history LIMIT 1"; +sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); +result = sqlite3_step (statement); +if (result == SQLITE_ROW) +show = TRUE; +sqlite3_finalize (statement); +#endif +sokoke_widget_set_visible (widget, show); +gtk_widget_set_size_request (widget, show ? -1 : 1, show ? -1 : 1); } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Render search actions as one line without address
Updating branch refs/heads/master to af94855fee73cf0cad6aeace4300c23086f83f89 (commit) from c273d6c73aa2b048351813abefe6a2ff8d21e54e (commit) commit af94855fee73cf0cad6aeace4300c23086f83f89 Author: Christian Dywan Date: Thu Feb 4 03:11:52 2010 +0100 Render search actions as one line without address midori/midori-locationaction.c | 26 +++--- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 596e3f7..37e78c5 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -342,7 +342,7 @@ midori_location_action_popup_timeout_cb (gpointer data) gchar* query; gint result; sqlite3_stmt* statement; -gint matches, height, screen_height; +gint matches, searches, height, screen_height, sep; if (!gtk_widget_has_focus (action->entry) || !action->history) return FALSE; @@ -422,8 +422,6 @@ midori_location_action_popup_timeout_cb (gpointer data) renderer = gtk_cell_renderer_text_new (); g_object_set_data (G_OBJECT (renderer), "location-action", action); gtk_cell_renderer_set_fixed_size (renderer, 1, -1); -gtk_cell_renderer_text_set_fixed_height_from_font ( -GTK_CELL_RENDERER_TEXT (renderer), 2); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (column), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (column), renderer, "cell-background-gdk", BACKGROUND_COL, @@ -441,7 +439,7 @@ midori_location_action_popup_timeout_cb (gpointer data) store = GTK_LIST_STORE (model); gtk_list_store_clear (store); -matches = 0; +matches = searches = 0; while (result == SQLITE_ROW) { const unsigned char* uri = sqlite3_column_text (statement, 0); @@ -477,7 +475,7 @@ midori_location_action_popup_timeout_cb (gpointer data) g_free (title); i++; } -matches += i; +searches += i; } if (!GTK_WIDGET_VISIBLE (action->popup)) @@ -492,7 +490,10 @@ midori_location_action_popup_timeout_cb (gpointer data) column = gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0); gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, &height); screen_height = gdk_screen_get_height (gtk_widget_get_screen (action->popup)); -height = MIN (matches * height, screen_height / 1.5); +gtk_widget_style_get (action->treeview, "vertical-separator", &sep, NULL); +/* FIXME: Instead of 1.5 we should relate to the height of one line */ +height = MIN (matches * height + (matches + searches) * sep + + searches * height / 1.5, screen_height / 1.5); gtk_widget_set_size_request (action->treeview, -1, height); midori_location_action_popup_position (action->popup, action->entry); gtk_widget_show_all (action->popup); @@ -993,6 +994,7 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, { gchar* uri; gchar* title; +GdkColor* background; gchar* desc; gchar* desc_uri; gchar* desc_title; @@ -1007,13 +1009,23 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, entry = data; -gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, -1); +gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, +BACKGROUND_COL, &background, -1); desc = desc_uri = desc_title = key = NULL; str = gtk_entry_get_text (GTK_ENTRY (entry)); if (!str) return; +if (background != NULL) /* A search engine action */ +{ +g_object_set (renderer, "text", title, +"ellipsize-set", TRUE, "ellipsize", PANGO_ELLIPSIZE_END, NULL); +g_free (uri); +g_free (title); +return; +} + key = g_utf8_strdown (str, -1); len = strlen (key); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Switch to prepared statements when adding/ updating history
Updating branch refs/heads/master to db334e2921678ebe078c70401cd1b6161cbc4fdc (commit) from c2e828269673b10a105c5cad2020f4b67cd201e9 (commit) commit db334e2921678ebe078c70401cd1b6161cbc4fdc Author: Alexander Butenko Date: Thu Feb 4 19:13:16 2010 +0100 Switch to prepared statements when adding/ updating history midori/midori-browser.c | 55 +- 1 files changed, 30 insertions(+), 25 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 864bc13..7a9d5c9 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -465,22 +465,24 @@ midori_browser_update_history_title (MidoriBrowser* browser, { #if HAVE_SQLITE sqlite3* db; -gchar* sqlcmd; -char* errmsg = NULL; +static sqlite3_stmt* stmt = NULL; db = g_object_get_data (G_OBJECT (browser->history), "db"); -sqlcmd = sqlite3_mprintf ("UPDATE history SET title='%q' WHERE" - " uri = '%q' and date=%d", - katze_item_get_name (item), - katze_item_get_uri (item), - katze_item_get_added (item)); - -if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +if (!stmt) { -g_printerr (_("Failed to insert new history item: %s\n"), errmsg); -sqlite3_free (errmsg); +const gchar* sqlcmd; + +sqlcmd = "UPDATE history SET title=? WHERE uri = ? and date=?"; +sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); } -sqlite3_free (sqlcmd); +sqlite3_bind_text (stmt, 1, katze_item_get_name (item), -1, 0); +sqlite3_bind_text (stmt, 2, katze_item_get_uri (item), -1, 0); +sqlite3_bind_int64 (stmt, 3, katze_item_get_added (item)); + +if (sqlite3_step (stmt) != SQLITE_DONE) +g_printerr (_("Failed to update title: %s\n"), sqlite3_errmsg (db)); +sqlite3_reset (stmt); +sqlite3_clear_bindings (stmt); #endif } @@ -5597,8 +5599,7 @@ midori_browser_new_history_item (MidoriBrowser* browser, gint64 day; #if HAVE_SQLITE sqlite3* db; -gchar* sqlcmd; -char* errmsg = NULL; +static sqlite3_stmt* stmt = NULL; #endif now = time (NULL); @@ -5607,19 +5608,23 @@ midori_browser_new_history_item (MidoriBrowser* browser, #if HAVE_SQLITE db = g_object_get_data (G_OBJECT (browser->history), "db"); -sqlcmd = sqlite3_mprintf ("INSERT INTO history (uri, title, date, day) VALUES " - "('%q', '%q', %d, %d)", - katze_item_get_uri (*item), - katze_item_get_name (*item), - katze_item_get_added (*item), - day); - -if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +if (!stmt) { -g_printerr (_("Failed to insert new history item: %s\n"), errmsg); -sqlite3_free (errmsg); +const gchar* sqlcmd; + +sqlcmd = "INSERT INTO history (uri, title, date, day) VALUES (?,?,?,?)"; +sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); } -sqlite3_free (sqlcmd); +sqlite3_bind_text (stmt, 1, katze_item_get_uri (*item), -1, 0); +sqlite3_bind_text (stmt, 2, katze_item_get_name (*item), -1, 0); +sqlite3_bind_int64 (stmt, 3, katze_item_get_added (*item)); +sqlite3_bind_int64 (stmt, 4, day); + +if (sqlite3_step (stmt) != SQLITE_DONE) +g_printerr (_("Failed to insert new history item: %s\n"), +sqlite3_errmsg (db)); +sqlite3_reset (stmt); +sqlite3_clear_bindings (stmt); #endif } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Refactor location completion queries to use prepared statements
Updating branch refs/heads/master to 4461a16a79a202a9d3ef0796b108d46589ca915c (commit) from db334e2921678ebe078c70401cd1b6161cbc4fdc (commit) commit 4461a16a79a202a9d3ef0796b108d46589ca915c Author: Alexander Butenko Date: Thu Feb 4 19:22:35 2010 +0100 Refactor location completion queries to use prepared statements midori/midori-locationaction.c | 74 +++- 1 files changed, 35 insertions(+), 39 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 5df50ef..354d645 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -339,9 +339,9 @@ midori_location_action_popup_timeout_cb (gpointer data) GtkTreeViewColumn* column; GtkListStore* store; sqlite3* db; -gchar* query; gint result; -sqlite3_stmt* statement; +static sqlite3_stmt* stmt; +const gchar* sqlcmd; gint matches, searches, height, screen_height, sep; if (!gtk_widget_has_focus (action->entry) || !action->history) @@ -360,27 +360,22 @@ midori_location_action_popup_timeout_cb (gpointer data) } db = g_object_get_data (G_OBJECT (action->history), "db"); -/* FIXME: Consider keeping the prepared statement with '...LIKE ?...' -and prepending/ appending % to the key. */ -query = sqlite3_mprintf ("SELECT uri, title FROM history WHERE " - "uri LIKE '%%%q%%' OR title LIKE '%%%q%%'" - "GROUP BY uri ORDER BY count() DESC LIMIT %d", - action->key, action->key, MAX_ITEMS); -result = sqlite3_prepare_v2 (db, query, -1, &statement, NULL); -sqlite3_free (query); - -if (result != SQLITE_OK) +if (!stmt) { -g_print (_("Failed to execute database statement: %s\n"), - sqlite3_errmsg (db)); -midori_location_action_popdown_completion (action); -return FALSE; +sqlcmd = "SELECT uri, title FROM history WHERE uri LIKE ? OR title LIKE ?" + " GROUP BY uri ORDER BY count() DESC LIMIT ?"; +sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); } +sqlite3_bind_text (stmt, 1, g_strdup_printf ("%%%s%%", action->key), -1, g_free); +sqlite3_bind_text (stmt, 2, g_strdup_printf ("%%%s%%", action->key), -1, g_free); +sqlite3_bind_int64 (stmt, 3, MAX_ITEMS); -result = sqlite3_step (statement); +result = sqlite3_step (stmt); if (result != SQLITE_ROW && !action->search_engines) { -sqlite3_finalize (statement); +g_print (_("Failed to select from history: %s\n"), sqlite3_errmsg (db)); +sqlite3_reset (stmt); +sqlite3_clear_bindings (stmt); midori_location_action_popdown_completion (action); return FALSE; } @@ -442,8 +437,8 @@ midori_location_action_popup_timeout_cb (gpointer data) matches = searches = 0; while (result == SQLITE_ROW) { -const unsigned char* uri = sqlite3_column_text (statement, 0); -const unsigned char* title = sqlite3_column_text (statement, 1); +const unsigned char* uri = sqlite3_column_text (stmt, 0); +const unsigned char* title = sqlite3_column_text (stmt, 1); GdkPixbuf* icon = katze_load_cached_icon ((gchar*)uri, NULL); if (!icon) icon = action->default_icon; @@ -451,8 +446,10 @@ midori_location_action_popup_timeout_cb (gpointer data) URI_COL, uri, TITLE_COL, title, YALIGN_COL, 0.25, FAVICON_COL, icon, -1); matches++; -result = sqlite3_step (statement); +result = sqlite3_step (stmt); } +sqlite3_reset (stmt); +sqlite3_clear_bindings (stmt); if (action->search_engines) { @@ -1142,41 +1139,38 @@ midori_location_action_entry_popup_cb (GtkComboBox* combo_box, #if HAVE_SQLITE GtkListStore* store; sqlite3* db; -gchar* query; gint result; -sqlite3_stmt* statement; +const gchar* sqlcmd; +static sqlite3_stmt* stmt; gint matches; store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_box)); gtk_list_store_clear (store); db = g_object_get_data (G_OBJECT (location_action->history), "db"); -/* FIXME: Consider keeping the prepared statement with '...LIKE ?...' -and prepending/ appending % to the key. */ -query = sqlite3_mprintf ("SELECT uri, title FROM history GROUP BY uri " - "ORDER BY count() DESC LIMIT %d", MAX_ITEMS); -result = sqlite3_prepare_v2 (db, query, -1, &statement, NULL); -sqlite3_free (query); - -if (result != SQLITE_OK) +if (!stmt) { -g_print (_("Failed to execute database statement: %s\n"), - sqlite3_errmsg (db)); -return; +sqlcmd = "SELECT uri, title FROM history" + " GROUP BY uri ORDER BY count() DESC LIMIT ?"; +sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL);
[Xfce4-commits] Fix check whether we have the latest database structure
Updating branch refs/heads/master to d7f42c5d72f599e41862ed1e1349bda29fe6d749 (commit) from 4461a16a79a202a9d3ef0796b108d46589ca915c (commit) commit d7f42c5d72f599e41862ed1e1349bda29fe6d749 Author: Alexander Butenko Date: Thu Feb 4 22:16:01 2010 +0100 Fix check whether we have the latest database structure midori/main.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/midori/main.c b/midori/main.c index 353ace3..d0539d7 100644 --- a/midori/main.c +++ b/midori/main.c @@ -359,6 +359,8 @@ midori_history_initialize (KatzeArray* array, { sqlite3* db; gboolean has_day; +sqlite3_stmt* stmt; +gint result; has_day = FALSE; @@ -377,11 +379,14 @@ midori_history_initialize (KatzeArray* array, NULL, NULL, errmsg) != SQLITE_OK) return NULL; -if (sqlite3_exec (db, "SELECT day FROM history LIMIT 1", NULL, NULL, - errmsg) != SQLITE_OK) -return NULL; +sqlite3_prepare_v2 (db, "SELECT day FROM history LIMIT 1", -1, &stmt, NULL); +result = sqlite3_step (stmt); +if (result == SQLITE_ROW) +has_day = TRUE; +sqlite3_finalize (stmt); -if (!has_day && sqlite3_exec (db, +if (!has_day) +sqlite3_exec (db, "BEGIN TRANSACTION;" "CREATE TEMPORARY TABLE backup (uri text, title text, date integer);" "INSERT INTO backup SELECT uri,title,date FROM history;" @@ -393,9 +398,7 @@ midori_history_initialize (KatzeArray* array, "FROM backup;" "DROP TABLE backup;" "COMMIT;", - NULL, NULL, errmsg) != SQLITE_OK) -return NULL; - + NULL, NULL, errmsg); return db; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Localize 'Block image' and 'Block link' menuitems in adblock
Updating branch refs/heads/master to 458252d053c07752ca2b51d11a421c6cac258a2c (commit) from 2d159c8f953465c2434ddb092e85a655071f91f5 (commit) commit 458252d053c07752ca2b51d11a421c6cac258a2c Author: Christian Dywan Date: Sat Feb 6 17:28:37 2010 +0100 Localize 'Block image' and 'Block link' menuitems in adblock extensions/adblock.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 73b2146..5d9847e 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -882,12 +882,12 @@ adblock_populate_popup_cb (WebKitWebView* web_view, if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE) { uri = katze_object_get_string (hit_test, "image-uri"); -menuitem = gtk_menu_item_new_with_mnemonic ("Bl_ock image"); +menuitem = gtk_menu_item_new_with_mnemonic (_("Bl_ock image")); } else if (context & WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK) { uri = katze_object_get_string (hit_test, "link-uri"); -menuitem = gtk_menu_item_new_with_mnemonic ("Bl_ock link"); +menuitem = gtk_menu_item_new_with_mnemonic (_("Bl_ock link")); } else return; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Add notes about variable ordering and prefixes to HACKING file
Updating branch refs/heads/master to 9b468c5654d0029af7680179496c24ec83a9fad6 (commit) from 458252d053c07752ca2b51d11a421c6cac258a2c (commit) commit 9b468c5654d0029af7680179496c24ec83a9fad6 Author: Christian Dywan Date: Sat Feb 6 17:31:03 2010 +0100 Add notes about variable ordering and prefixes to HACKING file HACKING |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/HACKING b/HACKING index 482ca09..944dfa8 100644 --- a/HACKING +++ b/HACKING @@ -8,13 +8,16 @@ avoid automated line-breaks. Trailing whitespace is not desirable. Declarations go to the beginning of a block, not inline. Variables of one plain type may be grouped in one declaration, pointer types may not be grouped. The asterisk goes next to the type. +Variables should be ordered in the order they are used. Comments explain functionality, they should not state facts. The appropriate style is always C style /* */, not C++ style. Variable and function names should be animal, animal_shelter or animalsc in case it would otherwise be very long. Loop counters may be single letters. -Type names should be Animal, AnimalShelter or AnimalSC. +Type names should be Animal, AnimalShelter or AnimalSC. No prefixes from third +party projects should be used, such as GTK or WebKit, while underlines may be +used but do not have a particular meaning. There is a space between functions or keywords and round brackets, and curly brackets always go on separate lines, at the indentation level of the ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove conditionals to disable Toolbar Editor on Hildon
Updating branch refs/heads/master to 8414836c7693e82ac16f3dd40381c1ac7063ec74 (commit) from 9b468c5654d0029af7680179496c24ec83a9fad6 (commit) commit 8414836c7693e82ac16f3dd40381c1ac7063ec74 Author: Christian Dywan Date: Sat Feb 6 17:37:15 2010 +0100 Remove conditionals to disable Toolbar Editor on Hildon extensions/toolbar-editor.c | 10 -- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/extensions/toolbar-editor.c b/extensions/toolbar-editor.c index 13c51b8..b8b0e00 100644 --- a/extensions/toolbar-editor.c +++ b/extensions/toolbar-editor.c @@ -13,8 +13,6 @@ #include "config.h" -#if !HAVE_HILDON - typedef struct { GtkWidget *dialog; @@ -604,24 +602,16 @@ static void tb_editor_activate_cb(MidoriExtension *extension, MidoriApp *app) g_object_unref(browsers); } -#endif - MidoriExtension *extension_init(void) { MidoriExtension* extension = g_object_new(MIDORI_TYPE_EXTENSION, "name", _("Toolbar Editor"), - #if !HAVE_HILDON "description", _("Easily edit the toolbar layout"), "version", "0.1", - #else - "description", _("Not available on this platform"), - #endif "authors", "Enrico Tröger ", NULL); - #if !HAVE_HILDON g_signal_connect(extension, "activate", G_CALLBACK(tb_editor_activate_cb), NULL); - #endif return extension; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Do startup timing if MIDORI_STARTTIME environment variable is set
Updating branch refs/heads/master to 14f0a091f63d558ff1ac99bc199f35b217a95184 (commit) from 40c6f9ec72dddfa7ead6b43b8e6dcb12a029fee5 (commit) commit 14f0a091f63d558ff1ac99bc199f35b217a95184 Author: Christian Dywan Date: Sun Feb 7 16:36:54 2010 +0100 Do startup timing if MIDORI_STARTTIME environment variable is set midori/main.c | 57 +++-- 1 files changed, 55 insertions(+), 2 deletions(-) diff --git a/midori/main.c b/midori/main.c index d0539d7..db008aa 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1065,6 +1065,12 @@ midori_load_extensions (gpointer data) MidoriApp* app = MIDORI_APP (data); gchar** active_extensions = g_object_get_data (G_OBJECT (app), "extensions"); KatzeArray* extensions; +#ifdef G_ENABLE_DEBUG +gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL; +GTimer* timer; +if (startup_timer) +timer = g_timer_new (); +#endif /* Load extensions */ extensions = katze_array_new (MIDORI_TYPE_EXTENSION); @@ -1139,6 +1145,11 @@ midori_load_extensions (gpointer data) g_idle_add (midori_load_netscape_plugins, app); +#ifdef G_ENABLE_DEBUG +if (startup_timer) +g_debug ("Extensions:\t%f", g_test_timer_elapsed ()); +#endif + return FALSE; } @@ -1180,6 +1191,12 @@ midori_load_session (gpointer data) guint i; gint64 current; gchar** command = g_object_get_data (G_OBJECT (app), "execute-command"); +#ifdef G_ENABLE_DEBUG +gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL; +GTimer* timer; +if (startup_timer) +timer = g_timer_new (); +#endif browser = midori_app_create_browser (app); config_file = build_config_filename ("session.old.xbel"); @@ -1246,6 +1263,11 @@ midori_load_session (gpointer data) if (command) midori_app_send_command (app, command); +#ifdef G_ENABLE_DEBUG +if (startup_timer) +g_debug ("Session setup:\t%f", g_test_timer_elapsed ()); +#endif + return FALSE; } @@ -1409,6 +1431,13 @@ main (intargc, gint max_history_age; #endif gint clear_prefs = MIDORI_CLEAR_NONE; +#ifdef G_ENABLE_DEBUG +gboolean startup_timer = g_getenv ("MIDORI_STARTTIME") != NULL; +#define midori_startup_timer(tmrmsg) if (startup_timer) \ +g_debug (tmrmsg, (g_test_timer_last () - g_test_timer_elapsed ()) * -1) +#else +#define midori_startup_timer(tmrmsg) +#endif #if ENABLE_NLS setlocale (LC_ALL, ""); @@ -1469,6 +1498,11 @@ main (intargc, sokoke_register_stock_items (); g_set_application_name (_("Midori")); +#ifdef G_ENABLE_DEBUG +if (startup_timer) +g_test_timer_start (); +#endif + if (version) { g_print ( @@ -1523,6 +1557,7 @@ main (intargc, if (webapp) { MidoriBrowser* browser = midori_browser_new (); +midori_startup_timer ("Browser: \t%f"); settings = katze_object_get_object (browser, "settings"); g_object_set (settings, "show-menubar", FALSE, @@ -1533,6 +1568,7 @@ main (intargc, "enable-developer-extras", FALSE, NULL); g_object_set (browser, "settings", settings, NULL); +midori_startup_timer ("Setup config: \t%f"); g_object_unref (settings); sokoke_set_config_dir ("/"); g_signal_connect (browser, "notify::load-status", @@ -1554,6 +1590,7 @@ main (intargc, i++; } } +midori_startup_timer ("App created: \t%f"); gtk_main (); return 0; } @@ -1581,6 +1618,7 @@ main (intargc, else app = midori_app_new (); g_free (config); +midori_startup_timer ("App created: \t%f"); /* FIXME: The app might be 'running' but actually showing a dialog after a crash, so running a new window isn't a good idea. */ @@ -1621,16 +1659,22 @@ main (intargc, katze_mkdir_with_parents (sokoke_set_config_dir (NULL), 0700); -/* Load configuration files */ +/* Load configuration file */ error_messages = g_string_new (NULL); config_file = build_config_filename ("config"); error = NULL; settings = settings_new_from_file (config_file, &extensions); g_object_set (settings, "enable-developer-extras", TRUE, NULL); +midori_startup_timer ("Config read: \t%f"); + +/* Load accelerators */ katze_assign (config_file, build_config_filename ("accels")); if (g_access (config_file, F_OK) != 0) katze_assign (config_file, sokoke_find_con
[Xfce4-commits] Only update location combo arrow if there is a history at all
Updating branch refs/heads/master to 0bf27662c5c5d0f90e46ac33dab5136740d8c4ae (commit) from 14f0a091f63d558ff1ac99bc199f35b217a95184 (commit) commit 0bf27662c5c5d0f90e46ac33dab5136740d8c4ae Author: Christian Dywan Date: Sun Feb 7 16:38:10 2010 +0100 Only update location combo arrow if there is a history at all midori/midori-locationaction.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 354d645..6193443 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -639,7 +639,12 @@ midori_location_action_toggle_arrow_cb (GtkWidget* widget, static void midori_location_action_toggle_arrow (MidoriLocationAction* location_action) { -GSList* proxies = gtk_action_get_proxies (GTK_ACTION (location_action)); +GSList* proxies; + +if (!location_action->history) +return; + +proxies = gtk_action_get_proxies (GTK_ACTION (location_action)); for (; proxies != NULL; proxies = g_slist_next (proxies)) if (GTK_IS_TOOL_ITEM (proxies->data)) { @@ -1268,8 +1273,9 @@ midori_location_action_connect_proxy (GtkAction* action, renderer, midori_location_entry_render_text_cb, child, NULL); gtk_combo_box_set_active (GTK_COMBO_BOX (entry), -1); -gtk_container_forall (GTK_CONTAINER (entry), -(GtkCallback)midori_location_action_toggle_arrow_cb, action); +if (location_action->history) +gtk_container_forall (GTK_CONTAINER (entry), +(GtkCallback)midori_location_action_toggle_arrow_cb, action); g_signal_connect (entry, "changed", G_CALLBACK (midori_location_action_entry_changed_cb), action); g_signal_connect (entry, "popup", ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only set config properties which are present in the config file
Updating branch refs/heads/master to 2e5c5026bcf4d8d8977bd717aa87dd2b8f788c32 (commit) from 0bf27662c5c5d0f90e46ac33dab5136740d8c4ae (commit) commit 2e5c5026bcf4d8d8977bd717aa87dd2b8f788c32 Author: Christian Dywan Date: Sun Feb 7 17:00:08 2010 +0100 Only set config properties which are present in the config file midori/main.c | 30 -- 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/midori/main.c b/midori/main.c index db008aa..b8480b6 100644 --- a/midori/main.c +++ b/midori/main.c @@ -104,46 +104,40 @@ settings_new_from_file (const gchar* filename, pspec = pspecs[i]; if (!(pspec->flags & G_PARAM_WRITABLE)) continue; + type = G_PARAM_SPEC_TYPE (pspec); property = g_param_spec_get_name (pspec); +if (!g_key_file_has_key (key_file, "settings", property, NULL)) +continue; + if (type == G_TYPE_PARAM_STRING) { -str = sokoke_key_file_get_string_default (key_file, -"settings", property, -G_PARAM_SPEC_STRING (pspec)->default_value, NULL); +str = g_key_file_get_string (key_file, "settings", property, NULL); g_object_set (settings, property, str, NULL); g_free (str); } else if (type == G_TYPE_PARAM_INT) { -integer = sokoke_key_file_get_integer_default (key_file, -"settings", property, -G_PARAM_SPEC_INT (pspec)->default_value, NULL); +integer = g_key_file_get_integer (key_file, "settings", property, NULL); g_object_set (settings, property, integer, NULL); } else if (type == G_TYPE_PARAM_FLOAT) { -number = sokoke_key_file_get_double_default (key_file, -"settings", property, -G_PARAM_SPEC_FLOAT (pspec)->default_value, NULL); +number = g_key_file_get_double (key_file, "settings", property, NULL); g_object_set (settings, property, number, NULL); } else if (type == G_TYPE_PARAM_BOOLEAN) { -boolean = sokoke_key_file_get_boolean_default (key_file, -"settings", property, -G_PARAM_SPEC_BOOLEAN (pspec)->default_value, NULL); +boolean = g_key_file_get_boolean (key_file, "settings", property, NULL); g_object_set (settings, property, boolean, NULL); } else if (type == G_TYPE_PARAM_ENUM) { GEnumClass* enum_class = G_ENUM_CLASS ( -g_type_class_ref (pspec->value_type)); -GEnumValue* enum_value = g_enum_get_value (enum_class, -G_PARAM_SPEC_ENUM (pspec)->default_value); -str = sokoke_key_file_get_string_default (key_file, -"settings", property, -enum_value->value_name, NULL); +g_type_class_peek (pspec->value_type)); +GEnumValue* enum_value; + +str = g_key_file_get_string (key_file, "settings", property, NULL); enum_value = g_enum_get_value_by_name (enum_class, str); if (enum_value) g_object_set (settings, property, enum_value->value, NULL); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Connect config change notifications after creating the first browser
Updating branch refs/heads/master to 13b1c9462b78447ce9b228a476f555bf8f1c3164 (commit) from 582026fd1b1b898e0e375afacc04be645bdfc5ac (commit) commit 13b1c9462b78447ce9b228a476f555bf8f1c3164 Author: Christian Dywan Date: Sun Feb 7 23:41:45 2010 +0100 Connect config change notifications after creating the first browser midori/main.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/midori/main.c b/midori/main.c index b8480b6..8d49d72 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1193,6 +1193,9 @@ midori_load_session (gpointer data) #endif browser = midori_app_create_browser (app); +g_signal_connect_after (katze_object_get_object (app, "settings"), "notify", +G_CALLBACK (settings_notify_cb), app); + config_file = build_config_filename ("session.old.xbel"); if (g_access (config_file, F_OK) == 0) { @@ -1856,10 +1859,6 @@ main (intargc, } } -katze_assign (config_file, build_config_filename ("config")); -g_signal_connect_after (settings, "notify", -G_CALLBACK (settings_notify_cb), app); - katze_assign (config_file, build_config_filename ("search")); if (1) { ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Don't update the saved window size if it didn't actually change
Updating branch refs/heads/master to e15fe776edb1e7139f938c6a43b0e4957e85c5d4 (commit) from 13b1c9462b78447ce9b228a476f555bf8f1c3164 (commit) commit e15fe776edb1e7139f938c6a43b0e4957e85c5d4 Author: Christian Dywan Date: Sun Feb 7 23:42:39 2010 +0100 Don't update the saved window size if it didn't actually change midori/midori-browser.c | 39 ++- 1 files changed, 22 insertions(+), 17 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 7a9d5c9..09d56ef 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -90,6 +90,7 @@ struct _MidoriBrowser GtkWidget* progressbar; gchar* statusbar_text; +gint last_window_width, last_window_height; guint alloc_timeout; guint panel_timeout; @@ -5386,9 +5387,20 @@ midori_browser_alloc_timeout (MidoriBrowser* browser) if (!(state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN))) -g_object_set (browser->settings, -"last-window-width", widget->allocation.width, -"last-window-height", widget->allocation.height, NULL); +{ +if (widget->allocation.width != browser->last_window_width) +{ +browser->last_window_width = widget->allocation.width; +g_object_set (browser->settings, +"last-window-width", browser->last_window_width, NULL); +} +if (widget->allocation.height != browser->last_window_height) +{ +browser->last_window_height = widget->allocation.height; +g_object_set (browser->settings, +"last-window-height", widget->allocation.height, NULL); +} +} browser->alloc_timeout = 0; return FALSE; @@ -5400,10 +5412,9 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser, { GtkWidget* widget = GTK_WIDGET (browser); -if (GTK_WIDGET_REALIZED (widget)) +if (GTK_WIDGET_REALIZED (widget) && !browser->alloc_timeout) { gpointer last_page; -GdkWindowState state = gdk_window_get_state (widget->window); if ((last_page = g_object_get_data (G_OBJECT (browser), "last-page"))) { @@ -5412,13 +5423,8 @@ midori_browser_size_allocate_cb (MidoriBrowser* browser, g_object_set_data (G_OBJECT (browser), "last-page", NULL); } -if (!(state & -(GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) -&& !browser->alloc_timeout) -{ -browser->alloc_timeout = g_timeout_add_full (G_PRIORITY_LOW, 5000, -(GSourceFunc)midori_browser_alloc_timeout, browser, NULL); -} +browser->alloc_timeout = g_timeout_add_full (G_PRIORITY_LOW, 5000, +(GSourceFunc)midori_browser_alloc_timeout, browser, NULL); } } @@ -6496,7 +6502,6 @@ static void _midori_browser_update_settings (MidoriBrowser* browser) { gboolean remember_last_window_size; -gint last_window_width, last_window_height; MidoriWindowState last_window_state; gboolean compact_sidepanel, show_panel_controls; gboolean right_align_sidepanel, open_panels_in_windows; @@ -6516,8 +6521,8 @@ _midori_browser_update_settings (MidoriBrowser* browser) g_object_get (browser->settings, "remember-last-window-size", &remember_last_window_size, - "last-window-width", &last_window_width, - "last-window-height", &last_window_height, + "last-window-width", &browser->last_window_width, + "last-window-height", &browser->last_window_height, "last-window-state", &last_window_state, "compact-sidepanel", &compact_sidepanel, "show-panel-controls", &show_panel_controls, @@ -6549,9 +6554,9 @@ _midori_browser_update_settings (MidoriBrowser* browser) if (remember_last_window_size) { -if (last_window_width && last_window_height) +if (browser->last_window_width && browser->last_window_height) gtk_window_set_default_size (GTK_WINDOW (browser), - last_window_width, last_window_height); +browser->last_window_width, browser->last_window_height); else gtk_window_set_default_size (GTK_WINDOW (browser), default_width, default_height); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove invisible dummy row when expanding, and add it when collapsing
Updating branch refs/heads/master to 24b0916d628498685fa28c9a526be4932f065ca1 (commit) from e15fe776edb1e7139f938c6a43b0e4957e85c5d4 (commit) commit 24b0916d628498685fa28c9a526be4932f065ca1 Author: Christian Dywan Date: Mon Feb 8 00:12:15 2010 +0100 Remove invisible dummy row when expanding, and add it when collapsing panels/midori-history.c | 43 ++- 1 files changed, 18 insertions(+), 25 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index bfd9ba6..87aac38 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -202,7 +202,8 @@ midori_history_read_from_db (MidoriHistory* history, } g_free (sqlcmd); -current_time = time (NULL); +if (req_day == 0) +current_time = time (NULL); while ((result = sqlite3_step (statement)) == SQLITE_ROW) { @@ -257,7 +258,6 @@ midori_history_read_from_db (MidoriHistory* history, gtk_tree_store_insert_with_values (model, &root_iter, NULL, 0, 0, item, 1, sdate, -1); /* That's an invisible dummy, so we always have an expander */ -/* FIXME: Hide this row */ gtk_tree_store_insert_with_values (model, &iter, &root_iter, 0, 0, NULL, 1, NULL, -1); @@ -282,6 +282,15 @@ midori_history_read_from_db (MidoriHistory* history, } } +if (req_day != 0) +{ +/* Remove invisible dummy row */ +GtkTreeIter child; +gint last = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (model), parent); +gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (model), &child, parent, last - 1); +gtk_tree_store_remove (model, &child); +} + if (result != SQLITE_DONE) g_print (_("Failed to execute database statement: %s\n"), sqlite3_errmsg (db)); @@ -829,33 +838,19 @@ midori_history_row_collapsed_cb (GtkTreeView *treeview, gpointer user_data) { GtkTreeModel* model; +GtkTreeStore* treestore; GtkTreeIter child; model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); -while (gtk_tree_model_iter_n_children (model, parent) > 1) -{ -if (gtk_tree_model_iter_children (model, &child, parent)) -gtk_tree_store_remove (GTK_TREE_STORE (model), &child); -} +treestore = GTK_TREE_STORE (model); +while (gtk_tree_model_iter_nth_child (model, &child, parent, 0)) +gtk_tree_store_remove (treestore, &child); +/* That's an invisible dummy, so we always have an expander */ +gtk_tree_store_insert_with_values (treestore, &child, parent, +0, 0, NULL, 1, NULL, -1); } #endif -static gboolean -midori_history_row_sep_func (GtkTreeModel* model, - GtkTreeIter* iter, - MidoriHistory* history) -{ -KatzeItem* item; - -gtk_tree_model_get (model, iter, 0, &item, -1); - -if (item == NULL) -return TRUE; - -g_object_unref (item); -return FALSE; -} - static void midori_history_init (MidoriHistory* history) { @@ -872,8 +867,6 @@ midori_history_init (MidoriHistory* history) model = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_STRING); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); -gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (treeview), -(GtkTreeViewRowSeparatorFunc)midori_history_row_sep_func, history, NULL); column = gtk_tree_view_column_new (); renderer_pixbuf = gtk_cell_renderer_pixbuf_new (); gtk_tree_view_column_pack_start (column, renderer_pixbuf, FALSE); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove unused KatzeNet instance from History panel
Updating branch refs/heads/master to eb5b244647e0066d3ca3438dd8e4df960f6d4e85 (commit) from 24b0916d628498685fa28c9a526be4932f065ca1 (commit) commit eb5b244647e0066d3ca3438dd8e4df960f6d4e85 Author: Christian Dywan Date: Mon Feb 8 00:14:49 2010 +0100 Remove unused KatzeNet instance from History panel panels/midori-history.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 87aac38..61091d1 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -48,7 +48,6 @@ struct _MidoriHistory GtkWidget* treeview; MidoriApp* app; KatzeArray* array; -KatzeNet* net; }; struct _MidoriHistoryClass @@ -860,9 +859,6 @@ midori_history_init (MidoriHistory* history) GtkCellRenderer* renderer_pixbuf; GtkCellRenderer* renderer_text; -history->net = katze_net_new (); -/* FIXME: Dereference the net on finalization */ - /* Create the treeview */ model = gtk_tree_store_new (2, KATZE_TYPE_ITEM, G_TYPE_STRING); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove unused KatzeNet instance from KatzeArrayAction
Updating branch refs/heads/master to 2e6b4debe188cb51abf4eb402d87984f3b5309b2 (commit) from cee10ca6d89fe5f4bdc1b3864d2901ba449385a2 (commit) commit 2e6b4debe188cb51abf4eb402d87984f3b5309b2 Author: Christian Dywan Date: Mon Feb 8 00:17:46 2010 +0100 Remove unused KatzeNet instance from KatzeArrayAction katze/katze-arrayaction.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/katze/katze-arrayaction.c b/katze/katze-arrayaction.c index bff1c5f..e23e11f 100644 --- a/katze/katze-arrayaction.c +++ b/katze/katze-arrayaction.c @@ -12,7 +12,6 @@ #include "katze-arrayaction.h" -#include "katze-net.h" #include "katze-utils.h" #include "marshal.h" @@ -29,7 +28,6 @@ struct _KatzeArrayAction GtkAction parent_instance; KatzeArray* array; -KatzeNet* net; gboolean reversed; }; @@ -182,7 +180,6 @@ static void katze_array_action_init (KatzeArrayAction* array_action) { array_action->array = NULL; -array_action->net = katze_net_new (); array_action->reversed = FALSE; } @@ -192,7 +189,6 @@ katze_array_action_finalize (GObject* object) KatzeArrayAction* array_action = KATZE_ARRAY_ACTION (object); katze_object_assign (array_action->array, NULL); -katze_object_assign (array_action->net, NULL); G_OBJECT_CLASS (katze_array_action_parent_class)->finalize (object); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove unused KatzeNet instance from Bookmarks panel
Updating branch refs/heads/master to cee10ca6d89fe5f4bdc1b3864d2901ba449385a2 (commit) from eb5b244647e0066d3ca3438dd8e4df960f6d4e85 (commit) commit cee10ca6d89fe5f4bdc1b3864d2901ba449385a2 Author: Christian Dywan Date: Mon Feb 8 00:15:29 2010 +0100 Remove unused KatzeNet instance from Bookmarks panel panels/midori-bookmarks.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index 01e9112..87cc242 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -46,7 +46,6 @@ struct _MidoriBookmarks GtkWidget* treeview; MidoriApp* app; KatzeArray* array; -KatzeNet* net; }; struct _MidoriBookmarksClass @@ -906,8 +905,6 @@ midori_bookmarks_init (MidoriBookmarks* bookmarks) GtkCellRenderer* renderer_pixbuf; GtkCellRenderer* renderer_text; -bookmarks->net = katze_net_new (); - /* Create the treeview */ model = midori_bookmark_store_new (1, KATZE_TYPE_ITEM); treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); @@ -952,7 +949,6 @@ midori_bookmarks_finalize (GObject* object) midori_bookmarks_disconnect_folder (bookmarks, bookmarks->array); if (bookmarks->app) g_object_unref (bookmarks->app); -g_object_unref (bookmarks->net); } /** ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove unused KatzeNet instance from MidoriSearchAction
Updating branch refs/heads/master to ccaf69625639b202ae24ef05a431a44c637916e6 (commit) from 2e6b4debe188cb51abf4eb402d87984f3b5309b2 (commit) commit ccaf69625639b202ae24ef05a431a44c637916e6 Author: Christian Dywan Date: Mon Feb 8 00:19:04 2010 +0100 Remove unused KatzeNet instance from MidoriSearchAction midori/midori-searchaction.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index 2608517..c46dafe 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -28,8 +28,6 @@ struct _MidoriSearchAction KatzeItem* default_item; gchar* text; -KatzeNet* net; - GtkWidget* last_proxy; GtkWidget* dialog; @@ -193,8 +191,6 @@ midori_search_action_init (MidoriSearchAction* search_action) search_action->default_item = NULL; search_action->text = NULL; -search_action->net = katze_net_new (); - search_action->last_proxy = NULL; search_action->dialog = NULL; @@ -211,8 +207,6 @@ midori_search_action_finalize (GObject* object) katze_assign (search_action->text, NULL); -katze_object_assign (search_action->net, NULL); - G_OBJECT_CLASS (midori_search_action_parent_class)->finalize (object); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Implement a filter entry in History panel, similar to Cookie Manager
Updating branch refs/heads/master to ee51a8c87fbf0be066264bf8b022b2fe293e174f (commit) from ccaf69625639b202ae24ef05a431a44c637916e6 (commit) commit ee51a8c87fbf0be066264bf8b022b2fe293e174f Author: Christian Dywan Date: Mon Feb 8 00:57:45 2010 +0100 Implement a filter entry in History panel, similar to Cookie Manager panels/midori-history.c | 127 +-- 1 files changed, 111 insertions(+), 16 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 61091d1..96cfe70 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -18,6 +18,7 @@ #include "midori-viewable.h" #include "sokoke.h" +#include "gtkiconentry.h" #include #include @@ -37,6 +38,8 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, #include #endif +#define COMPLETION_DELAY 150 + struct _MidoriHistory { GtkVBox parent_instance; @@ -48,6 +51,9 @@ struct _MidoriHistory GtkWidget* treeview; MidoriApp* app; KatzeArray* array; + +gint filter_timeout; +gchar* filter; }; struct _MidoriHistoryClass @@ -169,16 +175,30 @@ midori_history_remove_item_from_db (MidoriHistory* history, sqlite3_free (sqlcmd); } +/** + * midori_history_read_from_db: + * @history: a #MidoriHistory + * @model: a #GtkTreeStore + * @parent: a #GtkTreeIter, or %NULL + * @req_day: the timestamp of one day, or 0 + * @filter: a filter string to search for + * + * Populates the model according to parameters: + * 1. If @req_day is 0, all dates are added as folders. + * 2. If @req_day is given, all pages for that day are added. + * 3. If @filter is given, all pages matching the filter are added. + **/ static gboolean midori_history_read_from_db (MidoriHistory* history, GtkTreeStore* model, GtkTreeIter* parent, - intreq_day) + intreq_day, + const gchar* filter) { sqlite3* db; sqlite3_stmt* statement; gint result; -gchar* sqlcmd; +const gchar* sqlcmd; time_t current_time; GtkTreeIter iter; @@ -186,20 +206,35 @@ midori_history_read_from_db (MidoriHistory* history, db = g_object_get_data (G_OBJECT (history->array), "db"); -if (req_day == 0) -sqlcmd = g_strdup ("SELECT day, date " - "FROM history GROUP BY day ORDER BY day ASC"); +if (filter && *filter) +{ +gchar* filterstr; + +sqlcmd = "SELECT uri, title, date " + "FROM history WHERE uri LIKE ? or title LIKE ? " + "GROUP BY uri ORDER BY date ASC"; +result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); +filterstr = g_strdup_printf ("%%%s%%", filter); +sqlite3_bind_text (statement, 1, filterstr, -1, g_free); +sqlite3_bind_text (statement, 2, g_strdup (filterstr), -1, g_free); +req_day = -1; +} +else if (req_day == 0) +{ +sqlcmd = "SELECT day, date FROM history GROUP BY day ORDER BY day ASC"; +result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); +} else -sqlcmd = g_strdup_printf ("SELECT uri, title, date, day " - " FROM history WHERE day = '%d' " - " GROUP BY uri ORDER BY date ASC", req_day); - -if (sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL) != SQLITE_OK) { -g_free (sqlcmd); -return FALSE; +sqlcmd = "SELECT uri, title, date, day " + "FROM history WHERE day = ? " + "GROUP BY uri ORDER BY date ASC"; +result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); +sqlite3_bind_int64 (statement, 1, req_day); } -g_free (sqlcmd); + +if (result != SQLITE_OK) +return FALSE; if (req_day == 0) current_time = time (NULL); @@ -281,7 +316,7 @@ midori_history_read_from_db (MidoriHistory* history, } } -if (req_day != 0) +if (req_day != 0 && !(filter && *filter)) { /* Remove invisible dummy row */ GtkTreeIter child; @@ -463,7 +498,7 @@ midori_history_set_app (MidoriHistory* history, history->array = katze_object_get_object (app, "history"); model = gtk_tree_view_get_model (GTK_TREE_VIEW (history->treeview)); #if HAVE_SQLITE -midori_history_read_from_db (history, GTK_TREE_STORE (model), NULL, 0); +midori_history_read_from_db (history, GTK_TREE_STORE (model), NULL, 0, NULL); #endif } @@ -826,7 +861,7 @@ midori_history_row_expanded_cb (GtkTreeVi
[Xfce4-commits] Use strncmp instead of g_str_has_prefix to optimize sokoke_magic_uri
Updating branch refs/heads/master to 060c0b69407dc99caa996dd155d9b91a463fdccc (commit) from ee51a8c87fbf0be066264bf8b022b2fe293e174f (commit) commit 060c0b69407dc99caa996dd155d9b91a463fdccc Author: Christian Dywan Date: Mon Feb 8 22:56:09 2010 +0100 Use strncmp instead of g_str_has_prefix to optimize sokoke_magic_uri midori/sokoke.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index f307fe7..62a7a1a 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -598,12 +598,12 @@ sokoke_magic_uri (const gchar* uri, katze_array_is_a (search_engines, KATZE_TYPE_ITEM), NULL); /* Just return if it's a javascript: or mailto: uri */ -if (g_str_has_prefix (uri, "javascript:") - || g_str_has_prefix (uri, "mailto:";) - || g_str_has_prefix (uri, "tel:") - || g_str_has_prefix (uri, "callto:") - || g_str_has_prefix (uri, "data:") - || g_str_has_prefix (uri, "about:")) +if (!strncmp (uri, "javascript:", 11) + || !strncmp (uri, "mailto:";, 7) + || !strncmp (uri, "tel:", 4) + || !strncmp (uri, "callto:", 7) + || !strncmp (uri, "data:", 5) + || !strncmp (uri, "about:", 6)) return g_strdup (uri); /* Add file:// if we have a local path */ if (g_path_is_absolute (uri)) @@ -620,7 +620,7 @@ sokoke_magic_uri (const gchar* uri, ((search = strchr (uri, ':')) || (search = strchr (uri, '@'))) && search[0] && !g_ascii_isalpha (search[1])) return sokoke_idn_to_punycode (g_strconcat ("http://";, uri, NULL)); -if (!strcmp (uri, "localhost") || g_str_has_prefix (uri, "localhost/")) +if (!strncmp (uri, "localhost", 9) && (uri[9] == '\0' || uri[9] == '/')) return g_strconcat ("http://";, uri, NULL); parts = g_strsplit (uri, ".", 0); if (!search && parts[0] && parts[1]) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only read history into History panel if an array is given
Updating branch refs/heads/master to 6d722f6294d1d1274712f51d7c52b908330852ed (commit) from 0243e26bed5d937ab95f81a8783a52b0896dfc49 (commit) commit 6d722f6294d1d1274712f51d7c52b908330852ed Author: Christian Dywan Date: Mon Feb 8 23:13:35 2010 +0100 Only read history into History panel if an array is given panels/midori-history.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/panels/midori-history.c b/panels/midori-history.c index 96cfe70..0d6c186 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -498,7 +498,8 @@ midori_history_set_app (MidoriHistory* history, history->array = katze_object_get_object (app, "history"); model = gtk_tree_view_get_model (GTK_TREE_VIEW (history->treeview)); #if HAVE_SQLITE -midori_history_read_from_db (history, GTK_TREE_STORE (model), NULL, 0, NULL); +if (history->array) +midori_history_read_from_db (history, GTK_TREE_STORE (model), NULL, 0, NULL); #endif } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only split URI if no domain pattern is found in the string
Updating branch refs/heads/master to 0243e26bed5d937ab95f81a8783a52b0896dfc49 (commit) from 060c0b69407dc99caa996dd155d9b91a463fdccc (commit) commit 0243e26bed5d937ab95f81a8783a52b0896dfc49 Author: Christian Dywan Date: Mon Feb 8 23:02:54 2010 +0100 Only split URI if no domain pattern is found in the string midori/sokoke.c | 23 +-- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 62a7a1a..c497b23 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -622,18 +622,21 @@ sokoke_magic_uri (const gchar* uri, return sokoke_idn_to_punycode (g_strconcat ("http://";, uri, NULL)); if (!strncmp (uri, "localhost", 9) && (uri[9] == '\0' || uri[9] == '/')) return g_strconcat ("http://";, uri, NULL); -parts = g_strsplit (uri, ".", 0); -if (!search && parts[0] && parts[1]) +if (!search) { -if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0]))) -if (!strchr (parts[0], ' ') && !strchr (parts[1], ' ')) -{ -search = g_strconcat ("http://";, uri, NULL); -g_strfreev (parts); -return sokoke_idn_to_punycode (search); -} +parts = g_strsplit (uri, ".", 0); +if (parts[0] && parts[1]) +{ +if (!(parts[1][1] == '\0' && !g_ascii_isalpha (parts[1][0]))) +if (!strchr (parts[0], ' ') && !strchr (parts[1], ' ')) +{ +search = g_strconcat ("http://";, uri, NULL); +g_strfreev (parts); + return sokoke_idn_to_punycode (search); +} +} +g_strfreev (parts); } -g_strfreev (parts); /* We don't want to search? So return early. */ if (!search_engines) return g_strdup (uri); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Look for the history treeview at the second child position
Updating branch refs/heads/master to 4bf4e5cd63600f5c20fbf8645343ce37ae0f5ba9 (commit) from 6d722f6294d1d1274712f51d7c52b908330852ed (commit) commit 4bf4e5cd63600f5c20fbf8645343ce37ae0f5ba9 Author: Christian Dywan Date: Mon Feb 8 23:16:14 2010 +0100 Look for the history treeview at the second child position tests/history.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tests/history.c b/tests/history.c index edf4b25..dfc8348 100644 --- a/tests/history.c +++ b/tests/history.c @@ -82,7 +82,7 @@ history_panel_fill (void) g_assert (value == array); history = g_object_new (MIDORI_TYPE_HISTORY, "app", app, NULL); children = gtk_container_get_children (GTK_CONTAINER (history)); -treeview = g_list_nth_data (children, 0); +treeview = g_list_nth_data (children, 1); g_list_free (children); g_assert (GTK_IS_TREE_VIEW (treeview)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Handle search engines in MidoriBrowser and simplify sokoke_magic_uri
Updating branch refs/heads/master to 713091134f078f4317b7b80a7b37b8016450d3dc (commit) from 4bf4e5cd63600f5c20fbf8645343ce37ae0f5ba9 (commit) commit 713091134f078f4317b7b80a7b37b8016450d3dc Author: Christian Dywan Date: Tue Feb 9 18:13:47 2010 +0100 Handle search engines in MidoriBrowser and simplify sokoke_magic_uri midori/main.c |6 - midori/midori-app.c |4 ++- midori/midori-browser.c | 52 +++--- midori/midori-view.c|8 +++--- midori/sokoke.c | 33 +++-- midori/sokoke.h |4 +-- 6 files changed, 47 insertions(+), 60 deletions(-) diff --git a/midori/main.c b/midori/main.c index 8d49d72..87f877e 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1848,7 +1848,11 @@ main (intargc, g_free (current_dir); } else -uri_ready = sokoke_magic_uri (uri, NULL, NULL); +{ +uri_ready = sokoke_magic_uri (uri); +if (!uri_ready) +uri_ready = g_strdup (uri_ready); +} katze_item_set_uri (item, uri_ready); g_free (uri_ready); katze_array_add_item (_session, item); diff --git a/midori/midori-app.c b/midori/midori-app.c index 297e25b..0bf21b1 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -464,7 +464,9 @@ midori_app_command_received (MidoriApp* app, first = (open_external_pages_in == MIDORI_NEW_PAGE_CURRENT); while (*uris) { -gchar* fixed_uri = sokoke_magic_uri (*uris, NULL, NULL); +gchar* fixed_uri = sokoke_magic_uri (*uris); +if (!fixed_uri) +fixed_uri = g_strdup (*uris); if (first) { midori_browser_set_current_uri (browser, fixed_uri); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 09d56ef..74530c7 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2954,7 +2954,9 @@ midori_browser_open_bookmark (MidoriBrowser* browser, return; /* Imported bookmarks may lack a protocol */ -uri_fixed = sokoke_magic_uri (uri, NULL, NULL); +uri_fixed = sokoke_magic_uri (uri); +if (!uri_fixed) +uri_fixed = g_strdup (uri); /* FIXME: Use the same binary that is running right now */ if (katze_item_get_meta_integer (item, "app") != -1) @@ -3770,37 +3772,43 @@ _action_location_submit_uri (GtkAction* action, { gchar* stripped_uri; gchar* new_uri; -KatzeItem* item; gint n; stripped_uri = g_strdup (uri); g_strstrip (stripped_uri); -item = NULL; -new_uri = sokoke_magic_uri (stripped_uri, browser->search_engines, &item); +new_uri = sokoke_magic_uri (stripped_uri); if (!new_uri) -new_uri = sokoke_search_uri (browser->location_entry_search, stripped_uri); -g_free (stripped_uri); - -if (item) { -gchar* title; -GdkPixbuf* icon; -const gchar* icon_name; +gchar** parts; +gchar* keywords = NULL; +const gchar* search_uri = NULL; -title = g_strdup_printf (_("Search with %s"), katze_item_get_name (item)); -icon = midori_search_action_get_icon (item, GTK_WIDGET (browser), &icon_name); -if (!icon) +/* Do we have a keyword and a string? */ +parts = g_strsplit (stripped_uri, " ", 2); +if (parts[0]) { -GdkScreen* screen = gtk_widget_get_screen (GTK_WIDGET (browser)); -GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen); -icon = gtk_icon_theme_load_icon (icon_theme, icon_name, 16, 0, NULL); +KatzeItem* item; +if ((item = katze_array_find_token (browser->search_engines, parts[0]))) +{ +keywords = g_strdup (parts[1] ? parts[1] : ""); +search_uri = katze_item_get_uri (item); +} } -midori_location_action_add_item (MIDORI_LOCATION_ACTION (action), - uri, icon, title); -if (icon) -g_object_unref (icon); -g_free (title); +g_strfreev (parts); + +if (keywords) +g_free (stripped_uri); +else +{ +keywords = stripped_uri; +search_uri = browser->location_entry_search; +} +new_uri = sokoke_search_uri (search_uri, keywords); + +g_free (keywords); } +else +g_free (stripped_uri); if (new_tab) { diff --git a/midori/midori-view.c b/midori/midori-view.c index 752e0a3..190b008 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1307,9 +1307,7 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view,
[Xfce4-commits] Set consistent flags on all properties of MidoriWebSettings
Updating branch refs/heads/master to 532e84ea4f4dda8a6113d963d531c8802440559d (commit) from 713091134f078f4317b7b80a7b37b8016450d3dc (commit) commit 532e84ea4f4dda8a6113d963d531c8802440559d Author: Christian Dywan Date: Wed Feb 10 23:37:33 2010 +0100 Set consistent flags on all properties of MidoriWebSettings midori/midori-websettings.c | 32 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 0a75752..77cb5f4 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -653,7 +653,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("The folder downloaded files are saved to"), midori_get_download_dir (), #if WEBKIT_CHECK_VERSION (1, 1, 3) - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); #else G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); #endif @@ -675,7 +675,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Whether to ask for the destination folder when downloading a file"), FALSE, #if WEBKIT_CHECK_VERSION (1, 1, 15) - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); #else G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); #endif @@ -695,7 +695,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Whether to show a notification when a transfer has been completed"), TRUE, #if WEBKIT_CHECK_VERSION (1, 1, 3) - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); #else G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); #endif @@ -780,7 +780,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Where to open new pages"), MIDORI_TYPE_NEW_PAGE, MIDORI_NEW_PAGE_TAB, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); g_object_class_install_property (gobject_class, PROP_OPEN_EXTERNAL_PAGES_IN, @@ -790,7 +790,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Where to open externally opened pages"), MIDORI_TYPE_NEW_PAGE, MIDORI_NEW_PAGE_TAB, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); g_object_class_install_property (gobject_class, PROP_MIDDLE_CLICK_OPENS_SELECTION, @@ -826,7 +826,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Open popups in tabs"), _("Whether to open popup windows in tabs"), TRUE, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + flags)); /* Override properties to localize them for preference proxies */ @@ -912,7 +912,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Zoom Text and Images"), _("Whether to zoom text and images"), FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); /** * MidoriWebSettings:find-while-typing: @@ -954,7 +954,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("What type of cookies to accept"), MIDORI_TYPE_ACCEPT_COOKIES, MIDORI_ACCEPT_COOKIES_ALL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + flags)); /** * MidoriWebSettings:original-cookies-only: @@ -970,7 +970,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class) _("Original cookies only"), _("Accept cookies from the original website only"),
[Xfce4-commits] Handle external, magic URIs from command line consistently
Updating branch refs/heads/master to f494ec090be051617a1532b998f773fc0e72e81c (commit) from 532e84ea4f4dda8a6113d963d531c8802440559d (commit) commit f494ec090be051617a1532b998f773fc0e72e81c Author: Christian Dywan Date: Wed Feb 10 23:59:03 2010 +0100 Handle external, magic URIs from command line consistently midori/main.c | 45 +++-- 1 files changed, 27 insertions(+), 18 deletions(-) diff --git a/midori/main.c b/midori/main.c index 87f877e..9c6848d 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1358,6 +1358,29 @@ midori_remove_config_file (gint clear_prefs, } } +static gchar* +midori_prepare_uri (const gchar *uri) +{ +gchar* uri_ready; + +if (g_path_is_absolute (uri)) +return g_filename_to_uri (uri, NULL, NULL); +else if (g_file_test (uri, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) +{ +gchar* current_dir = g_get_current_dir (); +uri_ready = g_strconcat ("file://", current_dir, + G_DIR_SEPARATOR_S, uri, NULL); +g_free (current_dir); +return uri_ready; +} + +uri_ready = sokoke_magic_uri (uri); +if (uri_ready) +return sokoke_uri_to_ascii (uri_ready); + +return sokoke_uri_to_ascii (uri); +} + #ifdef HAVE_SIGNAL_H static void signal_handler (int signal_id) @@ -1554,6 +1577,8 @@ main (intargc, if (webapp) { MidoriBrowser* browser = midori_browser_new (); +gchar* tmp_uri = midori_prepare_uri (webapp); +katze_assign (webapp, tmp_uri); midori_startup_timer ("Browser: \t%f"); settings = katze_object_get_object (browser, "settings"); g_object_set (settings, @@ -1628,12 +1653,11 @@ main (intargc, else if (uris) { /* TODO: Open a tab per URI, seperated by pipes */ -/* FIXME: Handle relative files or magic URI here */ /* Encode any IDN addresses because libUnique doesn't like them */ i = 0; while (uris[i] != NULL) { -gchar* new_uri = sokoke_uri_to_ascii (uris[i]); +gchar* new_uri = midori_prepare_uri (uris[i]); katze_assign (uris[i], new_uri); i++; } @@ -1837,22 +1861,7 @@ main (intargc, while (uri != NULL) { item = katze_item_new (); -/* Construct an absolute path if the file is relative */ -if (g_path_is_absolute (uri)) -uri_ready = g_strconcat ("file://", uri, NULL); -else if (g_file_test (uri, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) -{ -gchar* current_dir = g_get_current_dir (); -uri_ready = g_strconcat ("file://", current_dir, - G_DIR_SEPARATOR_S, uri, NULL); -g_free (current_dir); -} -else -{ -uri_ready = sokoke_magic_uri (uri); -if (!uri_ready) -uri_ready = g_strdup (uri_ready); -} +uri_ready = midori_prepare_uri (uri); katze_item_set_uri (item, uri_ready); g_free (uri_ready); katze_array_add_item (_session, item); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Revise completion key handling to directly pass or compute the key
Updating branch refs/heads/master to de12aa0078228c7242c1c8c576835c688ac59f33 (commit) from f494ec090be051617a1532b998f773fc0e72e81c (commit) commit de12aa0078228c7242c1c8c576835c688ac59f33 Author: Christian Dywan Date: Thu Feb 11 00:38:17 2010 +0100 Revise completion key handling to directly pass or compute the key midori/midori-locationaction.c | 52 +-- 1 files changed, 28 insertions(+), 24 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 6193443..73f99e1 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -347,13 +347,7 @@ midori_location_action_popup_timeout_cb (gpointer data) if (!gtk_widget_has_focus (action->entry) || !action->history) return FALSE; -if (!*action->key) -{ -const gchar* uri = gtk_entry_get_text (GTK_ENTRY (action->entry)); -katze_assign (action->key, g_strdup (uri)); -} - -if (!*action->key) +if (!(action->key && *action->key)) { midori_location_action_popdown_completion (action); return FALSE; @@ -502,11 +496,11 @@ midori_location_action_popup_timeout_cb (gpointer data) static void midori_location_action_popup_completion (MidoriLocationAction* action, GtkWidget*entry, - const gchar* key) + gchar*key) { if (action->completion_timeout) g_source_remove (action->completion_timeout); -katze_assign (action->key, g_strdup (key)); +katze_assign (action->key, key); action->entry = entry; g_signal_connect (entry, "destroy", G_CALLBACK (gtk_widget_destroyed), &action->entry); @@ -797,7 +791,8 @@ static void midori_location_action_backspace_cb (GtkWidget*entry, MidoriLocationAction* action) { -midori_location_action_popup_completion (action, entry, ""); +gchar* key = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); +midori_location_action_popup_completion (action, entry, key); action->completion_index = -1; } @@ -805,7 +800,8 @@ static void midori_location_action_paste_clipboard_cb (GtkWidget*entry, MidoriLocationAction* action) { -midori_location_action_popup_completion (action, entry, ""); +gchar* key = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); +midori_location_action_popup_completion (action, entry, key); action->completion_index = -1; } @@ -943,29 +939,37 @@ midori_location_action_key_press_event_cb (GtkEntry* entry, return TRUE; } default: +{ +gunichar character; +gchar buffer[7]; +gint length; +gchar* key; + +character = gdk_keyval_to_unicode (event->keyval); /* Don't trigger completion on control characters */ -if (gdk_unicode_to_keyval (event->keyval) == (event->keyval | 0x0100)) +if (!character || event->is_modifier) return FALSE; -if ((text = gtk_entry_get_text (entry)) && *text) -{ -midori_location_action_popup_completion (location_action, widget, ""); -location_action->completion_index = -1; -return FALSE; -} +length = g_unichar_to_utf8 (character, buffer); +buffer[length] = '\0'; +key = g_strconcat (gtk_entry_get_text (entry), buffer, NULL); +midori_location_action_popup_completion (location_action, widget, key); +location_action->completion_index = -1; +return FALSE; +} } return FALSE; } #if GTK_CHECK_VERSION (2, 19, 3) static void -midori_location_action_preedit_changed_cb (GtkWidget* widget, +midori_location_action_preedit_changed_cb (GtkWidget* entry, const gchar* preedit, GtkAction* action) { MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action); -midori_location_action_popup_completion (location_action, - GTK_WIDGET (widget), preedit); +gchar* key = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); +midori_location_action_popup_completion (location_action, entry, key); } #endif @@ -1286,16 +1290,16 @@ midori_location_action_connect_proxy (GtkAction* action, midori_location_action_changed_cb, action, "signal::move-cursor", midori_location_action_move_cursor_cb, action, - "signal::backspace", + "signal-after::backspa
[Xfce4-commits] Clear history via sqlite if selected in 'Clear private data' dialog
Updating branch refs/heads/master to f733f453d237066511e772ddbbd1dbb90f070b9a (commit) from f759a02feab1e4019ef4b706c5526417f14cbc75 (commit) commit f733f453d237066511e772ddbbd1dbb90f070b9a Author: Alexander Butenko Date: Thu Feb 11 23:22:58 2010 +0100 Clear history via sqlite if selected in 'Clear private data' dialog midori/midori-browser.c | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 74530c7..6dd0d7b 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4542,12 +4542,25 @@ midori_browser_clear_private_data_response_cb (GtkWidget* dialog, g_object_get (browser->settings, "clear-private-data", &saved_prefs, NULL); +#if HAVE_SQLITE button = g_object_get_data (G_OBJECT (dialog), "history"); if (gtk_toggle_button_get_active (button)) { -katze_array_clear (browser->history); +const gchar* sqlcmd; +sqlite3* db; +char* errmsg = NULL; + +db = g_object_get_data (G_OBJECT (browser->history), "db"); +sqlcmd = "DELETE FROM history"; + +if (sqlite3_exec (db, sqlcmd, NULL, NULL, &errmsg) != SQLITE_OK) +{ +g_printerr (_("Failed to remove history item: %s\n"), errmsg); +sqlite3_free (errmsg); +} clear_prefs |= MIDORI_CLEAR_HISTORY; } +#endif button = g_object_get_data (G_OBJECT (dialog), "cookies"); if (gtk_toggle_button_get_active (button)) { @@ -4674,11 +4687,13 @@ _action_clear_private_data_activate (GtkAction* action, vbox = gtk_vbox_new (TRUE, 4); alignment = gtk_alignment_new (0, 0, 1, 1); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 6, 12, 0); +#if HAVE_SQLITE button = gtk_check_button_new_with_mnemonic (_("History")); if ((clear_prefs & MIDORI_CLEAR_HISTORY) == MIDORI_CLEAR_HISTORY) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); g_object_set_data (G_OBJECT (dialog), "history", button); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); +#endif button = gtk_check_button_new_with_mnemonic (_("Cookies")); if ((clear_prefs & MIDORI_CLEAR_COOKIES) == MIDORI_CLEAR_COOKIES) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Pass action to cell renderer callback rather than the entry
Updating branch refs/heads/master to f19412bc709a474045021d756542d1c2a1289056 (commit) from f733f453d237066511e772ddbbd1dbb90f070b9a (commit) commit f19412bc709a474045021d756542d1c2a1289056 Author: Christian Dywan Date: Thu Feb 11 23:55:36 2010 +0100 Pass action to cell renderer callback rather than the entry The entry pointer is only meaningful if completion was triggered by typing or editing in an entry. We shouldn't render a key in results if the arrow button opened the completion popup. We need to check the key in the callback to avoid accidentally working with an entry of a different window. midori/midori-locationaction.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 73f99e1..94777b1 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -417,7 +417,7 @@ midori_location_action_popup_timeout_cb (gpointer data) NULL); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (column), renderer, midori_location_entry_render_text_cb, -action->entry, NULL); +action, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column); action->popup = popup; @@ -517,6 +517,7 @@ midori_location_action_popdown_completion (MidoriLocationAction* location_action if (G_LIKELY (location_action->popup)) { gtk_widget_hide (location_action->popup); +katze_assign (location_action->key, NULL); gtk_tree_selection_unselect_all (gtk_tree_view_get_selection ( GTK_TREE_VIEW (location_action->treeview))); } @@ -1013,13 +1014,13 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, GtkTreeIter* iter, gpointer data) { +MidoriLocationAction* action = data; gchar* uri; gchar* title; GdkColor* background; gchar* desc; gchar* desc_uri; gchar* desc_title; -GtkWidget* entry; const gchar* str; gchar* key; gchar* start; @@ -1028,16 +1029,9 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, gchar** parts; size_t len; -entry = data; - gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title, BACKGROUND_COL, &background, -1); -desc = desc_uri = desc_title = key = NULL; -str = gtk_entry_get_text (GTK_ENTRY (entry)); -if (!str) -return; - if (background != NULL) /* A search engine action */ { g_object_set (renderer, "text", title, @@ -1047,6 +1041,12 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, return; } +desc = desc_uri = desc_title = key = NULL; +if (action->key) +str = action->key; +else +str = ""; + key = g_utf8_strdown (str, -1); len = strlen (key); @@ -1274,7 +1274,7 @@ midori_location_action_connect_proxy (GtkAction* action, g_object_set_data (G_OBJECT (renderer), "location-action", action); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (entry), renderer, TRUE); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (entry), -renderer, midori_location_entry_render_text_cb, child, NULL); +renderer, midori_location_entry_render_text_cb, action, NULL); gtk_combo_box_set_active (GTK_COMBO_BOX (entry), -1); if (location_action->history) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Re-implement search engine handling in magic URI test
Updating branch refs/heads/master to ca3e86cbce43636f4c73eb37f3ad463b64cdee77 (commit) from f19412bc709a474045021d756542d1c2a1289056 (commit) commit ca3e86cbce43636f4c73eb37f3ad463b64cdee77 Author: Christian Dywan Date: Fri Feb 12 02:06:53 2010 +0100 Re-implement search engine handling in magic URI test tests/magic-uri.c | 27 ++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/tests/magic-uri.c b/tests/magic-uri.c index 7bbd9fa..74ee243 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -37,6 +37,8 @@ test_input (const gchar* input, const gchar* expected) { static KatzeArray* search_engines = NULL; +gchar* uri; + if (G_UNLIKELY (!search_engines)) { KatzeItem* item; @@ -54,7 +56,30 @@ test_input (const gchar* input, g_object_unref (item); } -gchar* uri = sokoke_magic_uri (input, search_engines, NULL); +uri = sokoke_magic_uri (input); +if (!uri) +{ +gchar** parts; +gchar* keywords = NULL; +const gchar* search_uri = NULL; + +/* Do we have a keyword and a string? */ +parts = g_strsplit (input, " ", 2); +if (parts[0]) +{ +KatzeItem* item; +if ((item = katze_array_find_token (search_engines, parts[0]))) +{ +keywords = g_strdup (parts[1] ? parts[1] : ""); +search_uri = katze_item_get_uri (item); +} +} +g_strfreev (parts); + +uri = keywords ? sokoke_search_uri (search_uri, keywords) : NULL; + +g_free (keywords); +} sokoke_assert_str_equal (input, uri, expected); g_free (uri); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20
Updating branch refs/heads/master to c21807bc4a4453986e1f81c31c68b71e236bacd2 (commit) from 902f8368101cd0ca6397d0b9964dea7760b778fa (commit) commit c21807bc4a4453986e1f81c31c68b71e236bacd2 Author: Christian Dywan Date: Fri Feb 12 02:16:27 2010 +0100 Use g_unlink for G_FILE_CREATE_REPLACE_DESTINATION with Glib < 2.20 extensions/web-cache.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/extensions/web-cache.c b/extensions/web-cache.c index 4e4d07c..33c3429 100644 --- a/extensions/web-cache.c +++ b/extensions/web-cache.c @@ -323,8 +323,14 @@ web_cache_mesage_got_headers_cb (SoupMessage* msg, if (!web_cache_save_headers (msg, filename)) return; +#if GLIB_CHECK_VERSION (2, 20, 0) ostream = (GOutputStream*)g_file_append_to (file, G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, NULL, NULL); +#else +g_unlink (filename); +ostream = (GOutputStream*)g_file_append_to (file, +G_FILE_CREATE_PRIVATE, NULL, NULL); +#endif g_object_unref (file); if (!ostream) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Improve and optimize sokoke_uri_to_ascii to parse about:version
Updating branch refs/heads/master to 902f8368101cd0ca6397d0b9964dea7760b778fa (commit) from ca3e86cbce43636f4c73eb37f3ad463b64cdee77 (commit) commit 902f8368101cd0ca6397d0b9964dea7760b778fa Author: Christian Dywan Date: Fri Feb 12 02:08:05 2010 +0100 Improve and optimize sokoke_uri_to_ascii to parse about:version midori/sokoke.c | 34 +- tests/magic-uri.c |1 + 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 2e5a368..3f50fdc 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -424,9 +424,9 @@ sokoke_spawn_program (const gchar* command, * @uri: an URI string * @path: location of a string pointer * - * Returns the hostname of the specified URI, - * and stores the path in @path. - * @path is at least set to "" + * Returns the hostname of the specified URI. + * + * If there is a path, it is stored in @path. * * Return value: a newly allocated hostname **/ @@ -436,19 +436,17 @@ sokoke_hostname_from_uri (const gchar* uri, { gchar* hostname; -*path = ""; -if ((hostname = g_utf8_strchr (uri, -1, '/'))) +if ((hostname = strchr (uri, '/'))) { if (hostname[1] == '/') hostname += 2; -if ((*path = g_utf8_strchr (hostname, -1, '/'))) -hostname = g_strndup (hostname, *path - hostname); +if ((*path = strchr (hostname, '/'))) +return g_strndup (hostname, *path - hostname); else -hostname = g_strdup (hostname); +return g_strdup (hostname); } -else -hostname = g_strdup (uri); -return hostname; + +return g_strdup (uri); } /** @@ -498,9 +496,12 @@ sokoke_hostname_to_ascii (const gchar* hostname) gchar* sokoke_uri_to_ascii (const gchar* uri) { -gchar* proto; +gchar* proto = NULL; +gchar* path = NULL; +gchar* hostname; +gchar* encoded; -if ((proto = g_utf8_strchr (uri, -1, ':'))) +if (strchr (uri, '/') && (proto = strchr (uri, ':'))) { gulong offset; gchar* buffer; @@ -511,9 +512,8 @@ sokoke_uri_to_ascii (const gchar* uri) proto = buffer; } -gchar* path; -gchar* hostname = sokoke_hostname_from_uri (uri, &path); -gchar* encoded = sokoke_hostname_to_ascii (hostname); +hostname = sokoke_hostname_from_uri (uri, &path); +encoded = sokoke_hostname_to_ascii (hostname); if (encoded) { @@ -648,7 +648,7 @@ sokoke_format_uri_for_display (const gchar* uri) { gchar* unescaped = g_uri_unescape_string (uri, " +"); #ifdef HAVE_LIBSOUP_2_27_90 -gchar* path; +gchar* path = NULL; gchar* hostname; gchar* decoded; diff --git a/tests/magic-uri.c b/tests/magic-uri.c index 74ee243..9886bdb 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -133,6 +133,7 @@ magic_uri_idn (void) #endif { "http://en.wikipedia.org/wiki/Kölsch_language";, NULL }, { "file:///home/mark/frühstück", NULL }, +{ "about:version", NULL }, }; guint i; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Look for the formhistory javascript dynamically
Updating branch refs/heads/master to 6ad713c6d5e3c077833edd1e9425721a600e197c (commit) from b993cdc55379b5cd507af3bd527aeaaf6a97760a (commit) commit 6ad713c6d5e3c077833edd1e9425721a600e197c Author: Peter de Ridder Date: Mon Feb 15 22:52:45 2010 +0100 Look for the formhistory javascript dynamically extensions/formhistory.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 6c1548e..9b33300 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -31,12 +31,16 @@ static gchar* jsforms; static gboolean formhistory_prepare_js () { + gchar* data_name; + gchar* data_path; gchar* autosuggest; gchar* style; guint i; gchar* file; - gchar* data_path = g_build_filename (MDATADIR, PACKAGE_NAME, "res", NULL); + data_name = g_build_filename (PACKAGE_NAME, "res", NULL); + data_path = sokoke_find_data_filename (data_name); + g_free (data_name); file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.js",NULL); if (!g_file_get_contents (file, &autosuggest, NULL, NULL)) return FALSE; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use po directory either in current or parent folder
Updating branch refs/heads/master to f9a6a8e379232fbec672876ca37e556839e8bddc (commit) from 2235a2507c33879ff7d1c0e0521ed64e3efa7efa (commit) commit f9a6a8e379232fbec672876ca37e556839e8bddc Author: Peter de Ridder Date: Mon Feb 15 22:34:28 2010 +0100 Use po directory either in current or parent folder wscript |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index c00c9a2..f0f6881 100644 --- a/wscript +++ b/wscript @@ -371,14 +371,19 @@ def set_options (opt): # Taken from Geany's wscript, modified to support LINGUAS variable def write_linguas_file (self): linguas = '' +# Depending on Waf version, getcwd() is different +if os.path.exists ('./po'): +podir = './po' +else: +podir = '../po' if 'LINGUAS' in Build.bld.env: linguas = Build.bld.env['LINGUAS'] else: -files = os.listdir ('../po') +files = os.listdir (podir) for f in files: if f.endswith ('.po'): linguas += '%s ' % f[:-3] -f = open ('../po/LINGUAS', 'w') +f = open (podir + '/LINGUAS', 'w') f.write ('# This file is autogenerated. Do not edit.\n%s\n' % linguas) f.close () write_linguas_file = feature ('intltool_po')(write_linguas_file) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Implement sokoke_show_uri on top of explorer for win32
Updating branch refs/heads/master to f4b2111b403eaa74dc3fb9727be331f733ac3716 (commit) from 6ad713c6d5e3c077833edd1e9425721a600e197c (commit) commit f4b2111b403eaa74dc3fb9727be331f733ac3716 Author: Peter de Ridder Date: Tue Feb 16 00:39:01 2010 +0100 Implement sokoke_show_uri on top of explorer for win32 midori/sokoke.c | 67 +++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index 3f50fdc..657ba9a 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -276,6 +276,73 @@ sokoke_show_uri (GdkScreen* screen, #if HAVE_HILDON HildonURIAction* action = hildon_uri_get_default_action_by_uri (uri, NULL); return hildon_uri_open (uri, action, error); + +#elif defined (G_OS_WIN32) + +const gchar* fallbacks [] = { "explorer" }; +gsize i; +GAppInfo *app_info; +GFile *file; +gchar *free_uri; + +g_return_val_if_fail (uri != NULL, FALSE); +g_return_val_if_fail (!error || !*error, FALSE); +g_return_val_if_fail (GDK_IS_SCREEN (screen) || !screen, FALSE); + +file = g_file_new_for_uri (uri); +app_info = g_file_query_default_handler (file, NULL, error); + +if (app_info != NULL) +{ +GdkAppLaunchContext *context; +gboolean result; +GList l; + +context = gdk_app_launch_context_new (); +gdk_app_launch_context_set_screen (context, screen); +gdk_app_launch_context_set_timestamp (context, timestamp); + +l.data = (char *)file; +l.next = l.prev = NULL; +result = g_app_info_launch (app_info, &l, (GAppLaunchContext*)context, error); + +g_object_unref (context); +g_object_unref (app_info); +g_object_unref (file); + +if (result) +return TRUE; +} +else +g_object_unref (file); + +free_uri = g_filename_from_uri (uri, NULL, NULL); +if (free_uri) +{ +gchar *quoted = g_shell_quote (free_uri); +uri = quoted; +g_free (free_uri); +free_uri = quoted; +} + +for (i = 0; i < G_N_ELEMENTS (fallbacks); i++) +{ +gchar* command = g_strconcat (fallbacks[i], " ", uri, NULL); +gboolean result = g_spawn_command_line_async (command, error); +g_free (command); +if (result) +{ +g_free (free_uri); +return TRUE; +} +if (error) +*error = NULL; +} + +g_free (free_uri); + +return FALSE; + #else const gchar* fallbacks [] = { "xdg-open", "exo-open", "gnome-open" }; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Look for user documentation dynamically on win32
Updating branch refs/heads/master to 4774e35932f94e6787c1b37dc56e83950d63e876 (commit) from c90344ac4420405bf0476a9ddd26d5ae525f1f60 (commit) commit 4774e35932f94e6787c1b37dc56e83950d63e876 Author: Peter de Ridder Date: Tue Feb 16 00:47:11 2010 +0100 Look for user documentation dynamically on win32 midori/midori-browser.c | 27 ++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 6dd0d7b..1bbd49f 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4857,15 +4857,37 @@ _action_help_link_activate (GtkAction* action, const gchar* action_name; const gchar* uri; gint n; +#if defined (G_OS_WIN32) && defined (DOCDIR) +gchar* free_uri = NULL; +#endif action_name = gtk_action_get_name (action); if (!strncmp ("HelpContents", action_name, 12)) { +#ifdef G_OS_WIN32 +{ +#ifdef DOCDIR +gchar* path = sokoke_find_data_filename ("doc/midori/user/midori.html"); +uri = free_uri = g_filename_to_uri (path, NULL, NULL); +if (g_access (path, F_OK) != 0) +{ +if (g_access (DOCDIR "/midori/user/midori.html", F_OK) == 0) +uri = "file://" DOCDIR "/midori/user/midori.html"; +else +#endif +uri = "error:nodocs share/doc/midori/user/midori.html"; +#ifdef DOCDIR +} +g_free (path); +#endif +} +#else #ifdef DOCDIR uri = "file://" DOCDIR "/midori/user/midori.html"; if (g_access (DOCDIR "/midori/user/midori.html", F_OK) != 0) #endif uri = "error:nodocs " DOCDIR "/midori/user/midori.html"; +#endif } else if (!strncmp ("HelpFAQ", action_name, 7)) uri = "http://wiki.xfce.org/_export/xhtml/midori_faq";; @@ -4878,8 +4900,11 @@ _action_help_link_activate (GtkAction* action, { n = midori_browser_add_uri (browser, uri); midori_browser_set_current_page (browser, n); -} +#if defined (G_OS_WIN32) && defined (DOCDIR) +g_free (free_uri); +#endif +} } static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Add win32 specific linker flags for Midori extensions
Updating branch refs/heads/master to b993cdc55379b5cd507af3bd527aeaaf6a97760a (commit) from f9a6a8e379232fbec672876ca37e556839e8bddc (commit) commit b993cdc55379b5cd507af3bd527aeaaf6a97760a Author: Peter de Ridder Date: Mon Feb 15 22:43:51 2010 +0100 Add win32 specific linker flags for Midori extensions extensions/wscript_build |2 ++ wscript |2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/extensions/wscript_build b/extensions/wscript_build index 49c0247..c09986e 100644 --- a/extensions/wscript_build +++ b/extensions/wscript_build @@ -29,3 +29,5 @@ for extension in extensions: obj.source = source obj.uselib = 'UNIQUE LIBSOUP GIO GTK SQLITE WEBKIT LIBXML HILDON' obj.install_path = '${LIBDIR}/midori' +if bld.env['platform'] == 'win32': +obj.uselib_local = 'midori' diff --git a/wscript b/wscript index f0f6881..461baa0 100644 --- a/wscript +++ b/wscript @@ -118,6 +118,7 @@ def configure (conf): if not conf.find_program ('convert', var='CONVERT'): Utils.pprint ('YELLOW', 'midori.ico won\'t be created') conf.find_program ('windres', var='WINRC') +conf.env['platform'] = 'win32' # This is specific to cross compiling with mingw if is_mingw (conf.env) and Options.platform != 'win32': @@ -261,6 +262,7 @@ def configure (conf): conf.define ('HAVE_OSX', int(sys.platform == 'darwin')) if Options.platform == 'win32': conf.env.append_value ('LINKFLAGS', '-mwindows') +conf.env.append_value ('program_LINKFLAGS', ['-Wl,--out-implib=default/midori/libmidori.a', '-Wl,--export-all-symbols']) else: conf.check (header_name='signal.h') ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Look for MidoriView resource files dynamically
Updating branch refs/heads/master to aef84bfa02c1d596aa690d194a3e0ea7ee3eb2bf (commit) from 4774e35932f94e6787c1b37dc56e83950d63e876 (commit) commit aef84bfa02c1d596aa690d194a3e0ea7ee3eb2bf Author: Peter de Ridder Date: Tue Feb 16 00:56:14 2010 +0100 Look for MidoriView resource files dynamically midori/midori-view.c | 45 ++--- 1 files changed, 34 insertions(+), 11 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 190b008..a2487ca 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -993,25 +993,32 @@ webkit_web_frame_load_done_cb (WebKitWebFrame* web_frame, { gchar* title; gchar* data; +gchar* logo_path; +gchar* logo_uri; if (!success) { /* i18n: The title of the 404 - Not found error page */ title = g_strdup_printf (_("Not found - %s"), view->uri); katze_assign (view->title, title); +logo_path = sokoke_find_data_filename ("midori/logo-shade.png"); +logo_uri = g_filename_to_uri (logo_path); +g_free (logo_path); data = g_strdup_printf ( "%s" "%s" -"" "The page you were opening doesn't exist." "Try to load the page again, " "or move on to another page." "", -title, title, view->uri); +title, title, logo_uri, view->uri); webkit_web_view_load_html_string ( WEBKIT_WEB_VIEW (view->web_view), data, view->uri); +g_free (title); g_free (data); +g_free (logo_uri); } midori_view_update_load_status (view, MIDORI_LOAD_FINISHED); @@ -3125,11 +3132,13 @@ midori_view_set_uri (MidoriView* view, gchar* speed_dial_body; gchar* body_fname; gchar* stock_root; +gchar* filepath; katze_assign (view->uri, g_strdup ("")); -g_file_get_contents (MDATADIR "/midori/res/speeddial-head.html", - &speed_dial_head, NULL, NULL); +filepath = sokoke_find_data_filename ("midori/res/speeddial-head.html"); +g_file_get_contents (filepath, &speed_dial_head, NULL, NULL); +g_free (filepath); if (G_UNLIKELY (!speed_dial_head)) speed_dial_head = g_strdup (""); @@ -3147,11 +3156,13 @@ midori_view_set_uri (MidoriView* view, if (g_access (body_fname, F_OK) != 0) { -if (g_file_get_contents (MDATADIR "/midori/res/speeddial.json", +filepath = sokoke_find_data_filename ("midori/res/speeddial.json"); +if (g_file_get_contents (filepath, &speed_dial_body, NULL, NULL)) g_file_set_contents (body_fname, speed_dial_body, -1, NULL); else speed_dial_body = g_strdup (""); +g_free (filepath); } else g_file_get_contents (body_fname, &speed_dial_body, NULL, NULL); @@ -3196,38 +3207,50 @@ midori_view_set_uri (MidoriView* view, if (!strncmp (uri, "error:nodisplay ", 16)) { gchar* title; +gchar* logo_path; +gchar* logo_uri; katze_assign (view->uri, g_strdup (&uri[16])); title = g_strdup_printf (_("Document cannot be displayed")); +logo_path = sokoke_find_data_filename ("midori/logo-shade.png"); +logo_uri = g_filename_to_uri (logo_path, NULL, NULL); +g_free (logo_path); data = g_strdup_printf ( "%s" "%s" -"" "The document %s of type '%s' cannot be displayed." "", -title, title, view->uri, view->mime_type); +title, title, logo_uri, view->uri, view->mime_type); g_free (title); +g_free (logo_uri); } #endif if (!strncmp (uri, "error:nodocs ", 13)) { gchar* title; +gchar* logo_path; +gchar* logo_uri; katze_assign (view->uri, g_strdup (&uri[13])); title = g_strdup_printf (_("No documentation installed")); +logo_path = sokoke_find_data_filename ("midori/logo-shade.png"); +logo_uri = g_filename_to_uri (logo_path, NULL, NULL); +g_free (logo_path); data = g_strdup_printf ( "%s" "%s" -"" "There is no documentation installed at %s." "You may want to ask your distribution or " "package maintainer for it or if this a custom build "
[Xfce4-commits] Look for extensions relative to program folder on win32
Updating branch refs/heads/master to c90344ac4420405bf0476a9ddd26d5ae525f1f60 (commit) from f4b2111b403eaa74dc3fb9727be331f733ac3716 (commit) commit c90344ac4420405bf0476a9ddd26d5ae525f1f60 Author: Peter de Ridder Date: Tue Feb 16 00:42:39 2010 +0100 Look for extensions relative to program folder on win32 midori/main.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/midori/main.c b/midori/main.c index 9c6848d..8c01f62 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1076,7 +1076,22 @@ midori_load_extensions (gpointer data) GDir* extension_dir; if (!(extension_path = g_strdup (g_getenv ("MIDORI_EXTENSION_PATH" +{ +#ifdef G_OS_WIN32 +{ +gchar *path = g_win32_get_package_installation_directory_of_module (NULL); +extension_path = g_build_filename (path, "lib", PACKAGE_NAME, NULL); +g_free (path); +if (g_access (extension_path, F_OK) != 0) +{ +g_free (extension_path); +extension_path = g_build_filename (LIBDIR, PACKAGE_NAME, NULL); +} +} +#else extension_path = g_build_filename (LIBDIR, PACKAGE_NAME, NULL); +#endif +} extension_dir = g_dir_open (extension_path, 0, NULL); if (extension_dir != NULL) { ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Be sure to save outstanding changes to the config on quit
Updating branch refs/heads/master to f3f9dd2b3fc1a2da12490d2607696df1572528df (commit) from d1072b2c51cf0dddb221fc671c5cc49c604dc3a7 (commit) commit f3f9dd2b3fc1a2da12490d2607696df1572528df Author: Christian Dywan Date: Tue Feb 16 22:32:53 2010 +0100 Be sure to save outstanding changes to the config on quit We intentionally set a timeout before saving changes to avoid continuous disc access and also in case opening or closing a tab results in an immediate crash or freezing. But closing Midori normally should save outstanding changes. midori/main.c | 25 +++-- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/midori/main.c b/midori/main.c index 8c01f62..eed1713 100644 --- a/midori/main.c +++ b/midori/main.c @@ -419,14 +419,6 @@ midori_history_terminate (sqlite3* db, #endif static void -midori_app_quit_cb (MidoriApp* app) -{ -gchar* config_file = build_config_filename ("running"); -g_unlink (config_file); -g_free (config_file); -} - -static void settings_notify_cb (MidoriWebSettings* settings, GParamSpec*pspec, MidoriApp* app) @@ -707,6 +699,18 @@ midori_browser_session_cb (MidoriBrowser* browser, } static void +midori_app_quit_cb (MidoriBrowser* browser, +KatzeArray*session) +{ +gchar* config_file = build_config_filename ("running"); +g_unlink (config_file); +g_free (config_file); + +if (save_timeout && session) +midori_session_save_timeout_cb (session); +} + +static void midori_browser_weak_notify_cb (MidoriBrowser* browser, KatzeArray*session) { @@ -1269,6 +1273,8 @@ midori_load_session (gpointer data) G_CALLBACK (midori_browser_session_cb), session); g_signal_connect_after (browser, "remove-tab", G_CALLBACK (midori_browser_session_cb), session); +g_signal_connect (app, "quit", +G_CALLBACK (midori_app_quit_cb), session); g_object_weak_ref (G_OBJECT (session), (GWeakNotify)(midori_browser_weak_notify_cb), browser); @@ -1401,7 +1407,7 @@ static void signal_handler (int signal_id) { signal (signal_id, 0); -midori_app_quit_cb (NULL); +midori_app_quit_cb (NULL, NULL); if (kill (getpid (), signal_id)) exit (1); } @@ -1940,7 +1946,6 @@ main (intargc, gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } -g_signal_connect (app, "quit", G_CALLBACK (midori_app_quit_cb), NULL); midori_startup_timer ("Signal setup: \t%f"); g_object_set (app, "settings", settings, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Update TODO regarding window/ panel switching
Updating branch refs/heads/master to 302e751f8cfd79c37b21773b945bb2b7de74ca2f (commit) from d8d0c95a0211c745bd63d0224656e9af14cc8f51 (commit) commit 302e751f8cfd79c37b21773b945bb2b7de74ca2f Author: Christian Dywan Date: Wed Feb 17 23:18:42 2010 +0100 Update TODO regarding window/ panel switching TODO |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 502c217..2311184 100644 --- a/TODO +++ b/TODO @@ -46,12 +46,12 @@ TODO: . Show syntax errors in userscripts/ styles . Add HTTP_PRAGMA: no-cache when Ctrl+Shift+R . Honor HTTP_PRAGMA: no-cache in web cache - . Shortcut for switching browser windows + . Switching browser window: Ctrl+Shift+PageUp/PageDown + . Switching panel: Ctrl+Alt+PageUp/PageDown . Bookmark folder context menu, "Sort by Name" . Adblock Block image: dialog to edit regex before adding . KatzeArrayAction should support "activate" signal . Remove extra inner panel border - . Need a way to switch panels without menubar or operating controls . Move statusbar_contents below panel if statusbar is hidden . Teplace "disable plugins" with showing a "load plugins automatically", where unchecking that keeps a placeholder that can be clicked to play . Show "Type an address or keywords to search" in empty location even when focussed ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Look for inet_aton and inet_addr in more header files
Updating branch refs/heads/master to d8d0c95a0211c745bd63d0224656e9af14cc8f51 (commit) from f3f9dd2b3fc1a2da12490d2607696df1572528df (commit) commit d8d0c95a0211c745bd63d0224656e9af14cc8f51 Author: Rivo Nurges Date: Wed Feb 17 21:59:34 2010 +0100 Look for inet_aton and inet_addr in more header files This is needed for BSD like systems. wscript |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wscript b/wscript index 461baa0..fbbdbb0 100644 --- a/wscript +++ b/wscript @@ -257,8 +257,8 @@ def configure (conf): conf.define ('HAVE_NETDB_H', [0,1][conf.check (header_name='netdb.h')]) conf.check (header_name='sys/wait.h') conf.check (header_name='sys/select.h') -conf.check (function_name='inet_aton') -conf.check (function_name='inet_addr') +conf.check (function_name='inet_aton', header_name='sys/types.h sys/socket.h netinet/in.h arpa/inet.h') +conf.check (function_name='inet_addr', header_name='sys/types.h sys/socket.h netinet/in.h arpa/inet.h') conf.define ('HAVE_OSX', int(sys.platform == 'darwin')) if Options.platform == 'win32': conf.env.append_value ('LINKFLAGS', '-mwindows') ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Re-implement 'Recently visited pages' based on sqlite
Updating branch refs/heads/master to 10591640d1af191464bc0dd76ce558816f5bf081 (commit) from 302e751f8cfd79c37b21773b945bb2b7de74ca2f (commit) commit 10591640d1af191464bc0dd76ce558816f5bf081 Author: Christian Dywan Date: Wed Feb 17 23:25:05 2010 +0100 Re-implement 'Recently visited pages' based on sqlite midori/midori-browser.c | 94 ++- 1 files changed, 76 insertions(+), 18 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 1bbd49f..9d06007 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -210,6 +210,12 @@ midori_search_action_get_icon (KatzeItem*item, static void _midori_browser_find_done (MidoriBrowser* browser); +static gboolean +_action_menus_activate_item_alt (GtkAction* action, + KatzeItem* item, + guint button, + MidoriBrowser* browser); + #define _action_by_name(brwsr, nme) \ gtk_action_group_get_action (brwsr->action_group, nme) #define _action_set_sensitive(brwsr, nme, snstv) \ @@ -2874,22 +2880,85 @@ _action_trash_activate_item_alt (GtkAction* action, } static void +midori_browser_menu_item_activate_cb (GtkWidget* menuitem, + MidoriBrowser* browser) +{ +KatzeItem* item = g_object_get_data (G_OBJECT (menuitem), "KatzeItem"); +midori_browser_set_current_uri (browser, katze_item_get_uri (item)); +} + +static gboolean +midori_browser_menu_item_button_press_cb (GtkWidget* menuitem, + GdkEventButton* event, + MidoriBrowser* browser) +{ +KatzeItem* item = g_object_get_data (G_OBJECT (menuitem), "KatzeItem"); +return _action_menus_activate_item_alt (NULL, item, event->button, browser); +} + +static void _action_history_populate_popup (GtkAction* action, GtkMenu* menu, MidoriBrowser* browser) { -GList* children = gtk_container_get_children (GTK_CONTAINER (menu)); -guint i = 0; -GtkWidget* menuitem; +#if HAVE_SQLITE +sqlite3* db; +sqlite3_stmt* statement; +gint result; +const gchar* sqlcmd; -while ((menuitem = g_list_nth_data (children, i++))) +db = g_object_get_data (G_OBJECT (browser->history), "db"); +sqlcmd = "SELECT uri, title, date FROM history " + "GROUP BY uri ORDER BY date ASC LIMIT 10"; +result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); +if (result != SQLITE_OK) { +g_print (_("Failed to execute database statement: %s\n"), + sqlite3_errmsg (db)); +return; +} + +while ((result = sqlite3_step (statement)) == SQLITE_ROW) +{ +const unsigned char* uri; +const unsigned char* title; +KatzeItem* item; +GtkWidget* menuitem; +GdkPixbuf* icon; +GtkWidget* image; + +uri = sqlite3_column_text (statement, 0); +title = sqlite3_column_text (statement, 1); + +item = katze_item_new (); +katze_item_set_uri (item, (gchar*)uri); +katze_item_set_name (item, (gchar*)title); + +menuitem = katze_image_menu_item_new_ellipsized ((gchar*)title); +icon = katze_load_cached_icon ((gchar*)uri, GTK_WIDGET (browser)); +image = gtk_image_new_from_pixbuf (icon); +g_object_unref (icon); +gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image); +#if GTK_CHECK_VERSION (2, 16, 0) +gtk_image_menu_item_set_always_show_image ( +GTK_IMAGE_MENU_ITEM (menuitem), TRUE); +#endif +g_object_set_data_full (G_OBJECT (menuitem), "KatzeItem", +item, (GDestroyNotify)g_object_unref); +gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); +gtk_widget_show (menuitem); + +g_signal_connect (menuitem, "activate", +G_CALLBACK (midori_browser_menu_item_activate_cb), browser); +g_signal_connect (menuitem, "button-press-event", +G_CALLBACK (midori_browser_menu_item_button_press_cb), browser); g_signal_connect (menuitem, "select", G_CALLBACK (midori_browser_menu_item_select_cb), browser); g_signal_connect (menuitem, "deselect", G_CALLBACK (midori_browser_menu_item_deselect_cb), browser); } -g_list_free (children); +sqlite3_finalize (statement); +#endif } static void @@ -5697,8 +5766,6 @@ midori_browser_history_clear_cb (KatzeArray*history, MidoriBrowser* browser) { GtkAction* location_action = _action_by_name (browser, "Location"
[Xfce4-commits] Use allocation accessor in KatzeScrolled
Updating branch refs/heads/master to cd855b7cde6b275406f4acaac3578165bbd7d36a (commit) from ff97ec62321548dd24209dbac064b8f195fdd215 (commit) commit cd855b7cde6b275406f4acaac3578165bbd7d36a Author: Christian Dywan Date: Fri Feb 19 16:46:45 2010 +0100 Use allocation accessor in KatzeScrolled katze/katze-scrolled.c |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index c695fa0..3fc64f5 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -27,6 +27,7 @@ #endif #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw +#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation #endif #define DEFAULT_INTERVAL 50 @@ -320,6 +321,7 @@ adjust_scrollbar (KatzeScrolled* scrolled, gint x, y; gint size; double position; +GtkAllocation allocation; GtkWidget* window; page_size = gtk_adjustment_get_page_size (adjustment); @@ -333,8 +335,9 @@ adjust_scrollbar (KatzeScrolled* scrolled, return FALSE; } +gtk_widget_get_allocation (widget, &allocation); size = page_size / (upper - lower) -* (horizontal ? widget->allocation.height : widget->allocation.width); +* (horizontal ? allocation.height : allocation.width); if (size != *previous_size) { *previous_size = size; @@ -363,13 +366,13 @@ adjust_scrollbar (KatzeScrolled* scrolled, if (horizontal) { gtk_widget_translate_coordinates (widget, window, -widget->allocation.width - 20, position * widget->allocation.height, &x, &y); +allocation.width - 20, position * allocation.height, &x, &y); gdk_window_move (scrollbar_window, x, y); } else { gtk_widget_translate_coordinates (widget, window, -position * widget->allocation.width, widget->allocation.height - 20, &x, &y); +position * allocation.width, allocation.height - 20, &x, &y); gdk_window_move (scrollbar_window, x, y); } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Allocation/ requisition accessors in KatzeThrobber
Updating branch refs/heads/master to ff97ec62321548dd24209dbac064b8f195fdd215 (commit) from 42cf0287819d7a865a23b4f874176f7ca22e74a0 (commit) commit ff97ec62321548dd24209dbac064b8f195fdd215 Author: Christian Dywan Date: Fri Feb 19 16:39:14 2010 +0100 Allocation/ requisition accessors in KatzeThrobber katze/katze-throbber.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index e6ab7df..2846625 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -16,6 +16,10 @@ #include #include +#if !GTK_CHECK_VERSION (2, 18, 0) +#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#endif + struct _KatzeThrobber { GtkMisc parent_instance; @@ -793,16 +797,20 @@ katze_throbber_aligned_coords (GtkWidget* widget, { gfloat xalign, yalign; gint xpad, ypad; +GtkAllocation allocation; +GtkRequisition requisition; gtk_misc_get_alignment (GTK_MISC (widget), &xalign, &yalign); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) xalign = 1.0f - xalign; gtk_misc_get_padding (GTK_MISC (widget), &xpad, &ypad); -*ax = floor (widget->allocation.x + xpad -+ ((widget->allocation.width - widget->requisition.width) * xalign)); -*ay = floor (widget->allocation.y + ypad -+ ((widget->allocation.height - widget->requisition.height) * yalign)); +gtk_widget_get_allocation (widget, &allocation); +gtk_widget_size_request (widget, &requisition); +*ax = floor (allocation.x + xpad ++ ((allocation.width - requisition.width) * xalign)); +*ay = floor (allocation.y + ypad ++ ((allocation.height - requisition.height) * yalign)); } static gboolean ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use accessors for widget window in KatzeScrolled
Updating branch refs/heads/master to 42cf0287819d7a865a23b4f874176f7ca22e74a0 (commit) from 10591640d1af191464bc0dd76ce558816f5bf081 (commit) commit 42cf0287819d7a865a23b4f874176f7ca22e74a0 Author: Christian Dywan Date: Fri Feb 19 16:37:43 2010 +0100 Use accessors for widget window in KatzeScrolled katze/katze-scrolled.c | 34 +++--- 1 files changed, 23 insertions(+), 11 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 619e4b7..c695fa0 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -23,6 +23,10 @@ #define gtk_adjustment_get_upper(adj) adj->upper #define gtk_adjustment_get_lower(adj) adj->lower #define gtk_adjustment_get_value(adj) adj->value +#define gtk_widget_get_window(wdgt) wdgt->window +#endif +#if !GTK_CHECK_VERSION (2, 18, 0) +#define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw #endif #define DEFAULT_INTERVAL 50 @@ -642,7 +646,8 @@ button_press_event (GtkWidget* widget, g_source_remove (priv->scrolling_timeout_id); priv->scrolling_timeout_id = 0; } -gdk_window_get_pointer (GTK_WIDGET (scrolled)->window, &x, &y, &mask); +gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)), +&x, &y, &mask); /* do_motion_scroll (scrolled, widget, x, y, event->time); */ } else @@ -658,7 +663,8 @@ button_press_event (GtkWidget* widget, priv->dragged = FALSE; priv->previous_time = event->time; } -gdk_window_get_pointer (GTK_WIDGET (scrolled)->window, &x, &y, &mask); +gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)), +&x, &y, &mask); priv->start_x = priv->previous_x = priv->farest_x = x; priv->start_y = priv->previous_y = priv->farest_y = y; priv->start_time = event->time; @@ -699,7 +705,8 @@ button_release_event (GtkWidget* widget, gint y; GdkModifierType mask; -gdk_window_get_pointer (GTK_WIDGET (scrolled)->window, &x, &y, &mask); +gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)), +&x, &y, &mask); if (priv->press_received && gtk_drag_check_threshold (widget, priv->start_x, priv->start_y, x, y)) { priv->dragged = TRUE; @@ -744,7 +751,8 @@ motion_notify_event (GtkWidget* widget, if (priv->press_received) { -gdk_window_get_pointer (GTK_WIDGET (scrolled)->window, &x, &y, &mask); +gdk_window_get_pointer (gtk_widget_get_window (GTK_WIDGET (scrolled)), +&x, &y, &mask); do_motion_scroll (scrolled, widget, x, y, event->time); } @@ -787,7 +795,8 @@ katze_scrolled_event_handler (GdkEvent* event, crossing.type = GDK_LEAVE_NOTIFY; crossing.window = event->motion.window; crossing.send_event = event->motion.send_event; -crossing.subwindow = GTK_WIDGET (current_scrolled_window)->window; +crossing.subwindow = gtk_widget_get_window ( +GTK_WIDGET (current_scrolled_window)); crossing.time = event->motion.time; crossing.x = event->motion.x; crossing.y = event->motion.y; @@ -818,7 +827,8 @@ katze_scrolled_event_handler (GdkEvent* event, crossing.type = GDK_ENTER_NOTIFY; crossing.window = event->button.window; crossing.send_event = event->button.send_event; -crossing.subwindow = GTK_WIDGET (current_scrolled_window)->window; +crossing.subwindow = gtk_widget_get_window ( +GTK_WIDGET (current_scrolled_window)); crossing.time = event->button.time; crossing.x = event->button.x; crossing.y = event->button.y; @@ -852,6 +862,7 @@ katze_scrolled_realize (GtkWidget* widget) KatzeScrolledPrivate* priv = scrolled->priv; gboolean drag_scrolling; GtkPolicyType policy; +GdkWindow* window; GdkWindowAttr attr; GdkColor color; @@ -862,15 +873,16 @@ katze_scrolled_realize (GtkWidget* widget) g_object_set (scrolled, "drag-scrolling", drag_scrolling, "hscrollbar-policy", policy, "vscrollbar-policy", policy, NULL); -widget->window = g_object_ref (gtk_widget_get_parent_window (widget)); +window = g_object_ref (gtk_widget_get_parent_window (widget)); +gtk_widget_set_window (widget, window); attr.height = attr.width = 10; attr.event_mask = GDK_EXPOSURE_MASK; attr.wclass
[Xfce4-commits] Use allocation accessor in katze utils
Updating branch refs/heads/master to 20602673fe923e572738ae143b7217fd0206a5aa (commit) from fa66334289fe9281dcfa75255686ca909231b15b (commit) commit 20602673fe923e572738ae143b7217fd0206a5aa Author: Christian Dywan Date: Fri Feb 19 17:22:34 2010 +0100 Use allocation accessor in katze utils katze/katze-utils.c | 14 +- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 65b0763..21192d4 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -31,6 +31,7 @@ #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_get_has_window(wdgt) !GTK_WIDGET_NO_WINDOW (wdgt) +#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation #endif static void @@ -920,21 +921,24 @@ katze_widget_popup_position_menu (GtkMenu* menu, { gint wx, wy; gint menu_width; +GtkAllocation allocation; GtkRequisition menu_req; GtkRequisition widget_req; KatzePopupInfo* info = user_data; GtkWidget* widget = info->widget; gint widget_height; +gtk_widget_get_allocation (widget, &allocation); + /* Retrieve size and position of both widget and menu */ if (!gtk_widget_get_has_window (widget)) { -gdk_window_get_position (widget->window, &wx, &wy); -wx += widget->allocation.x; -wy += widget->allocation.y; +gdk_window_get_position (gtk_widget_get_window (widget), &wx, &wy); +wx += allocation.x; +wy += allocation.y; } else -gdk_window_get_origin (widget->window, &wx, &wy); +gdk_window_get_origin (gtk_widget_get_window (widget), &wx, &wy); gtk_widget_size_request (GTK_WIDGET (menu), &menu_req); gtk_widget_size_request (widget, &widget_req); menu_width = menu_req.width; @@ -945,7 +949,7 @@ katze_widget_popup_position_menu (GtkMenu* menu, ; /* Do nothing? */ else if (info->position == KATZE_MENU_POSITION_RIGHT) { -*x = wx + widget->allocation.width - menu_width; +*x = wx + allocation.width - menu_width; *y = wy + widget_height; } else if (info->position == KATZE_MENU_POSITION_LEFT) { ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Accessors instead of widget flag macros in Katze
Updating branch refs/heads/master to fa66334289fe9281dcfa75255686ca909231b15b (commit) from cd855b7cde6b275406f4acaac3578165bbd7d36a (commit) commit fa66334289fe9281dcfa75255686ca909231b15b Author: Christian Dywan Date: Fri Feb 19 17:05:54 2010 +0100 Accessors instead of widget flag macros in Katze katze/katze-scrolled.c | 10 -- katze/katze-throbber.c |5 - katze/katze-utils.c|6 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 3fc64f5..54cdc79 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -28,6 +28,12 @@ #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw #define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE +#endif +#if !GTK_CHECK_VERSION (2, 20, 0) +#define gtk_widget_set_realized(wdgt, real) \ +if (real) GTK_WIDGET_SET_FLAGS (wdgt, GTK_REALIZED); \ +else GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_REALIZED) #endif #define DEFAULT_INTERVAL 50 @@ -277,7 +283,7 @@ on_expose_event (GtkWidget* widget, KatzeScrolledPrivate* priv = scrolled->priv; gboolean ret = FALSE; -if (GTK_WIDGET_DRAWABLE (widget)) +if (gtk_widget_is_drawable (widget)) { if (event->window == priv->horizontal_scrollbar_window) { @@ -904,7 +910,7 @@ katze_scrolled_realize (GtkWidget* widget) color.red = color.green = color.blue = 0x; gdk_gc_set_rgb_fg_color (priv->shadow_gc, &color); -GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); +gtk_widget_set_realized (widget, TRUE); } static void diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 2846625..9956335 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -18,6 +18,9 @@ #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#define gtk_widget_set_has_window(wdgt, wnd) \ +if (wnd) GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_NO_WINDOW); \ +else GTK_WIDGET_SET_FLAGS (wdgt, GTK_NO_WINDOW) #endif struct _KatzeThrobber @@ -202,7 +205,7 @@ katze_throbber_class_init (KatzeThrobberClass* class) static void katze_throbber_init (KatzeThrobber *throbber) { -GTK_WIDGET_SET_FLAGS (throbber, GTK_NO_WINDOW); +gtk_widget_set_has_window (GTK_WIDGET (throbber), FALSE); throbber->timer_id = -1; } diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 63c69e4..65b0763 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -29,6 +29,10 @@ #include #endif +#if !GTK_CHECK_VERSION (2, 18, 0) +#define gtk_widget_get_has_window(wdgt) !GTK_WIDGET_NO_WINDOW (wdgt) +#endif + static void proxy_toggle_button_toggled_cb (GtkToggleButton* button, GObject* object) @@ -923,7 +927,7 @@ katze_widget_popup_position_menu (GtkMenu* menu, gint widget_height; /* Retrieve size and position of both widget and menu */ -if (GTK_WIDGET_NO_WINDOW (widget)) +if (!gtk_widget_get_has_window (widget)) { gdk_window_get_position (widget->window, &wx, &wy); wx += widget->allocation.x; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use the correct completion model and no static
Updating branch refs/heads/master to e94edca7664a054940d079e08e2e3050a1d83a9a (commit) from 20602673fe923e572738ae143b7217fd0206a5aa (commit) commit e94edca7664a054940d079e08e2e3050a1d83a9a Author: Alexander Butenko Date: Fri Feb 19 18:55:16 2010 +0100 Use the correct completion model and no static Since the model was a static variable and only set when the popup was created, we ended up using an obsolete model in case multiple windows were opened and closed. As a small optimization we don't need to retrieve the database pointer except when compiling the statement initially. midori/midori-locationaction.c | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 94777b1..1ab63c7 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -335,10 +335,8 @@ static gboolean midori_location_action_popup_timeout_cb (gpointer data) { MidoriLocationAction* action = data; -static GtkTreeModel* model = NULL; GtkTreeViewColumn* column; GtkListStore* store; -sqlite3* db; gint result; static sqlite3_stmt* stmt; const gchar* sqlcmd; @@ -353,9 +351,10 @@ midori_location_action_popup_timeout_cb (gpointer data) return FALSE; } -db = g_object_get_data (G_OBJECT (action->history), "db"); if (!stmt) { +sqlite3* db; +db = g_object_get_data (G_OBJECT (action->history), "db"); sqlcmd = "SELECT uri, title FROM history WHERE uri LIKE ? OR title LIKE ?" " GROUP BY uri ORDER BY count() DESC LIMIT ?"; sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); @@ -367,7 +366,7 @@ midori_location_action_popup_timeout_cb (gpointer data) result = sqlite3_step (stmt); if (result != SQLITE_ROW && !action->search_engines) { -g_print (_("Failed to select from history: %s\n"), sqlite3_errmsg (db)); +g_print (_("Failed to select from history\n")); sqlite3_reset (stmt); sqlite3_clear_bindings (stmt); midori_location_action_popdown_completion (action); @@ -376,6 +375,7 @@ midori_location_action_popup_timeout_cb (gpointer data) if (G_UNLIKELY (!action->popup)) { +GtkTreeModel* model = NULL; GtkWidget* popup; GtkWidget* scrolled; GtkWidget* treeview; @@ -425,7 +425,7 @@ midori_location_action_popup_timeout_cb (gpointer data) G_CALLBACK (gtk_widget_destroyed), &action->popup); } -store = GTK_LIST_STORE (model); +store = GTK_LIST_STORE (action->completion_model); gtk_list_store_clear (store); matches = searches = 0; @@ -1147,7 +1147,6 @@ midori_location_action_entry_popup_cb (GtkComboBox* combo_box, { #if HAVE_SQLITE GtkListStore* store; -sqlite3* db; gint result; const gchar* sqlcmd; static sqlite3_stmt* stmt; @@ -1156,9 +1155,10 @@ midori_location_action_entry_popup_cb (GtkComboBox* combo_box, store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_box)); gtk_list_store_clear (store); -db = g_object_get_data (G_OBJECT (location_action->history), "db"); if (!stmt) { +sqlite3* db; +db = g_object_get_data (G_OBJECT (location_action->history), "db"); sqlcmd = "SELECT uri, title FROM history" " GROUP BY uri ORDER BY count() DESC LIMIT ?"; sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); @@ -1168,8 +1168,7 @@ midori_location_action_entry_popup_cb (GtkComboBox* combo_box, result = sqlite3_step (stmt); if (result != SQLITE_ROW) { -g_print (_("Failed to execute database statement: %s\n"), - sqlite3_errmsg (db)); +g_print (_("Failed to execute database statement\n")); sqlite3_reset (stmt); sqlite3_clear_bindings (stmt); return; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Avoid GtkScrolledWindow members in KatzeScrolled
Updating branch refs/heads/master to daa04eaeb199804246f7a3527b1c6d639df3094c (commit) from e94edca7664a054940d079e08e2e3050a1d83a9a (commit) commit daa04eaeb199804246f7a3527b1c6d639df3094c Author: Christian Dywan Date: Fri Feb 19 19:02:57 2010 +0100 Avoid GtkScrolledWindow members in KatzeScrolled katze/katze-scrolled.c | 23 ++- 1 files changed, 14 insertions(+), 9 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 54cdc79..9d30110 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -29,8 +29,9 @@ #define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw #define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE +#define gtk_widget_get_drawable GTK_WIDGET_VISIBLE #endif -#if !GTK_CHECK_VERSION (2, 20, 0) +#if !GTK_CHECK_VERSION (2, 19, 6) #define gtk_widget_set_realized(wdgt, real) \ if (real) GTK_WIDGET_SET_FLAGS (wdgt, GTK_REALIZED); \ else GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_REALIZED) @@ -679,18 +680,22 @@ button_press_event (GtkWidget* widget, priv->start_time = event->time; } -if (priv->scrolling_hints && !GTK_SCROLLED_WINDOW (scrolled)->hscrollbar_visible && -adjust_scrollbar (scrolled, priv->horizontal_scrollbar_window, - gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled)), - &priv->horizontal_scrollbar_size, FALSE)) +if (priv->scrolling_hints +&& !gtk_widget_get_visible (gtk_scrolled_window_get_hscrollbar ( +GTK_SCROLLED_WINDOW (scrolled))) +&& adjust_scrollbar (scrolled, priv->horizontal_scrollbar_window, + gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (scrolled)), + &priv->horizontal_scrollbar_size, FALSE)) { gdk_window_raise (priv->horizontal_scrollbar_window); gdk_window_show (priv->horizontal_scrollbar_window); } -if (priv->scrolling_hints && !GTK_SCROLLED_WINDOW (scrolled)->vscrollbar_visible && -adjust_scrollbar (scrolled, priv->vertical_scrollbar_window, - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled)), - &priv->vertical_scrollbar_size, TRUE)) +if (priv->scrolling_hints +&& !gtk_widget_get_visible (gtk_scrolled_window_get_vscrollbar ( +GTK_SCROLLED_WINDOW (scrolled))) +&& adjust_scrollbar (scrolled, priv->vertical_scrollbar_window, + gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (scrolled)), + &priv->vertical_scrollbar_size, TRUE)) { gdk_window_raise (priv->vertical_scrollbar_window); gdk_window_show (priv->vertical_scrollbar_window); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use content_area instead of GtkDialog->vbox in browser
Updating branch refs/heads/master to 142dc432caa9e9b019784614fba3351a3e5f3aef (commit) from daa04eaeb199804246f7a3527b1c6d639df3094c (commit) commit 142dc432caa9e9b019784614fba3351a3e5f3aef Author: Christian Dywan Date: Fri Feb 19 19:05:29 2010 +0100 Use content_area instead of GtkDialog->vbox in browser midori/midori-browser.c | 36 +--- midori/sokoke.h |1 + 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 9d06007..f5906e2 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -691,6 +691,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, { const gchar* title; GtkWidget* dialog; +GtkWidget* content_area; GtkSizeGroup* sizegroup; GtkWidget* view; GtkWidget* hbox; @@ -716,10 +717,11 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); +content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_window_set_icon_name (GTK_WINDOW (dialog), new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); -gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5); +gtk_container_set_border_width (GTK_CONTAINER (content_area), 5); sizegroup = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); if (!bookmark) @@ -747,7 +749,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, value = katze_item_get_name (bookmark); gtk_entry_set_text (GTK_ENTRY (entry_title), value ? value : ""); gtk_box_pack_start (GTK_BOX (hbox), entry_title, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); hbox = gtk_hbox_new (FALSE, 8); @@ -763,7 +765,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, gtk_entry_set_text (GTK_ENTRY (entry_desc), value ? value : ""); } gtk_box_pack_start (GTK_BOX (hbox), entry_desc, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); entry_uri = NULL; @@ -787,7 +789,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, g_signal_connect (entry_uri, "changed", G_CALLBACK (midori_browser_edit_bookmark_uri_changed_cb), dialog); gtk_box_pack_start (GTK_BOX (hbox), entry_uri, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); } @@ -831,7 +833,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, if (n < 2) gtk_widget_set_sensitive (combo_folder, FALSE); gtk_box_pack_start (GTK_BOX (hbox), combo_folder, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); } @@ -844,7 +846,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar), katze_item_get_meta_string (bookmark, "toolbar") != NULL); gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); check_app = NULL; @@ -859,7 +861,7 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_app), katze_item_get_meta_string (bookmark, "app") != NULL); gtk_box_pack_start (GTK_BOX (hbox), check_app, TRUE, TRUE, 0); -gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); +gtk_container_add (GTK_CONTAINER (content_area), hbox); gtk_widget_show_all (hbox); } @@ -2357,7 +2359,7 @@ _action_compact_add_activate (GtkAction* action, dialog = g_object_new (GTK_TYPE_DIALOG, "transient-for", browser, "title", _("Add a new bookmark"), NULL); -box = GTK_BOX (GTK_DIALOG (dialog)->vbox); +box = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))); for (i = 0; i < G_N_ELEMENTS (actions); i++) { @@ -4437,6 +4439,7 @@ _action_bookmarks_import_activate (GtkAction* action, }; GtkWidget
[Xfce4-commits] Install extension config files to xdg, like search
Updating branch refs/heads/master to 34761080e7d6b6f2faad32b04ed52a99e18acfa7 (commit) from 142dc432caa9e9b019784614fba3351a3e5f3aef (commit) commit 34761080e7d6b6f2faad32b04ed52a99e18acfa7 Author: Alexander Butenko Date: Fri Feb 19 19:24:45 2010 +0100 Install extension config files to xdg, like search wscript |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/wscript b/wscript index fbbdbb0..d65671f 100644 --- a/wscript +++ b/wscript @@ -515,7 +515,7 @@ def build (bld): folder = 'lib' + extension + '.so' source = 'data/extensions/' + extension + '/config' if os.path.exists (source): -bld.install_files ('${SYSCONFDIR}/' + APPNAME + \ +bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + \ '/extensions/' + folder, source) if Options.commands['check']: ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Bump to version 0.2.3
Updating branch refs/heads/master to 623784d65d3e1a9b86eb1dd11298cbc350d7f834 (commit) from e81745f19df40726a1cf1d73ce28a790b83e79b6 (commit) commit 623784d65d3e1a9b86eb1dd11298cbc350d7f834 Author: Christian Dywan Date: Sat Feb 20 12:39:23 2010 +0100 Bump to version 0.2.3 ChangeLog | 26 ++ wscript |2 +- 2 files changed, 27 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70c7a89..cb8c3aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,31 @@ This file is licensed under the terms of the expat license, see the file EXPAT. +v0.2.3 + + Improve relocatability for Win32 + + Implement 'Close other tabs' menu item + + Use new GTK+ accessors where available + + Allow searching freely in History panel + + Re-implement completion based on sqlite + + Re-implement completion suggestion popup + + Simplify sqlite use towards efficient calls + + Move panel icons to the bottom + + Merge Netscape Plugins and Extensions panels + + Implement 'about:version' special page + + Implement 'Preferred languages' preference + + Improve window raising behaviour + + Allow Ctrl+Right-click to suppress javascript menu + + Add 'Open link as web app' in context menu + + Add 'Block image' menu item to Adblock + + Location progress and compat code refactored + + Implement 'Paste and proceed' in location + + Move DNS prefetching into the core + + Allow selecting and deleting multiple cookies + + Support attaching/ detaching web inspector + + Always enable web inspector + + --diagnostic-dialog command line switch + + Faster file existence checks + + Simplified, faster adblock implementation + v0.2.2 + Turn libnotify into a proper build-time dependency + Use Ctrl + Return to open tabs from the location entry diff --git a/wscript b/wscript index d65671f..4e7b7fe 100644 --- a/wscript +++ b/wscript @@ -25,7 +25,7 @@ import misc major = 0 minor = 2 -micro = 2 +micro = 3 APPNAME = 'midori' VERSION = str (major) + '.' + str (minor) + '.' + str (micro) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Creating annotated tag 0.2.3
Updating annotated tag refs/tags/0.2.3 as new annotated tag to e263afffd0db4d500e5a499eb45c4423add16bcc (tag) succeeds 0.2.2-354-ge81745f tagged by Christian Dywan on 2010-02-20 11:44 + Christian Dywan (1): Bump to version 0.2.3 ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Omit micro version and arch from ident string
Updating branch refs/heads/master to 7580ecad8e62633f9f4c05e37a6c466bc3b61564 (commit) from 9ae1d173d11f3878701e12742143e2aec03ada70 (commit) commit 7580ecad8e62633f9f4c05e37a6c466bc3b61564 Author: Christian Dywan Date: Sat Feb 20 22:28:52 2010 +0100 Omit micro version and arch from ident string midori/midori-websettings.c | 12 +++- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 77cb5f4..8b133cc 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -1188,7 +1188,7 @@ get_sys_name (void) { struct utsname name; if (uname (&name) != -1) -sys_name = g_strdup_printf ("%s %s", name.sysname, name.machine); +sys_name = name.sysname; else sys_name = "Unix"; } @@ -1214,15 +1214,10 @@ generate_ident_string (MidoriIdentity identify_as) const gchar* os = #if HAVE_OSX -/* #if defined (HAVE_X86) */ -"Intel Mac OS X"; -/* #else -"PPC Mac OS X"; -#endif */ +"Mac OS X"; #elif defined (G_OS_UNIX) get_sys_name (); #elif defined (G_OS_WIN32) -// FIXME: Windows NT version "Windows"; #else "Unknown"; @@ -1230,8 +1225,7 @@ generate_ident_string (MidoriIdentity identify_as) const gchar* appname = "Midori/" G_STRINGIFY (MIDORI_MAJOR_VERSION) "." -G_STRINGIFY (MIDORI_MINOR_VERSION) "." -G_STRINGIFY (MIDORI_MICRO_VERSION); +G_STRINGIFY (MIDORI_MINOR_VERSION); const gchar* lang = pango_language_to_string (gtk_get_default_language ()); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Fix fallback gtk_widget_get_allocation definitions
Updating branch refs/heads/master to 1f9dbe9f2587c43416c1fdd7cd5e4ef5cb6df896 (commit) from 1261405a0f52539e1a683be1d33316a8f802d785 (commit) commit 1f9dbe9f2587c43416c1fdd7cd5e4ef5cb6df896 Author: Christian Dywan Date: Sat Feb 20 23:54:03 2010 +0100 Fix fallback gtk_widget_get_allocation definitions katze/katze-scrolled.c |2 +- katze/katze-throbber.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 9d30110..2f0770c 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -27,7 +27,7 @@ #endif #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_set_window(wdgt, wndw) wdgt->window = wndw -#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE #define gtk_widget_get_drawable GTK_WIDGET_VISIBLE #endif diff --git a/katze/katze-throbber.c b/katze/katze-throbber.c index 9956335..dce2189 100644 --- a/katze/katze-throbber.c +++ b/katze/katze-throbber.c @@ -17,7 +17,7 @@ #include #if !GTK_CHECK_VERSION (2, 18, 0) -#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation #define gtk_widget_set_has_window(wdgt, wnd) \ if (wnd) GTK_WIDGET_UNSET_FLAGS (wdgt, GTK_NO_WINDOW); \ else GTK_WIDGET_SET_FLAGS (wdgt, GTK_NO_WINDOW) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Always use Icons only for panel toolbar
Updating branch refs/heads/master to 7cf326a33842fe072475d591f2b66e74290b793a (commit) from 515795a31764dc7c45d0a5049b3ff90419ed0de6 (commit) commit 7cf326a33842fe072475d591f2b66e74290b793a Author: Christian Dywan Date: Sun Feb 21 18:03:27 2010 +0100 Always use Icons only for panel toolbar midori/midori-panel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/midori/midori-panel.c b/midori/midori-panel.c index 3a27acc..1698bef 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -405,6 +405,7 @@ midori_panel_init (MidoriPanel* panel) /* Create the sidebar */ panel->toolbar = gtk_toolbar_new (); +gtk_toolbar_set_style (GTK_TOOLBAR (panel->toolbar), GTK_TOOLBAR_ICONS); gtk_toolbar_set_icon_size (GTK_TOOLBAR (panel->toolbar), GTK_ICON_SIZE_BUTTON); gtk_toolbar_set_show_arrow (GTK_TOOLBAR (panel->toolbar), FALSE); gtk_widget_show_all (panel->toolbar); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Add fallback definition of gtk_widget_get_visible in KatzeScrolled
Updating branch refs/heads/master to 515795a31764dc7c45d0a5049b3ff90419ed0de6 (commit) from 1f9dbe9f2587c43416c1fdd7cd5e4ef5cb6df896 (commit) commit 515795a31764dc7c45d0a5049b3ff90419ed0de6 Author: Christian Dywan Date: Sun Feb 21 18:01:20 2010 +0100 Add fallback definition of gtk_widget_get_visible in KatzeScrolled katze/katze-scrolled.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/katze/katze-scrolled.c b/katze/katze-scrolled.c index 2f0770c..6266b63 100644 --- a/katze/katze-scrolled.c +++ b/katze/katze-scrolled.c @@ -30,6 +30,7 @@ #define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE #define gtk_widget_get_drawable GTK_WIDGET_VISIBLE +#define gtk_widget_get_visible(wdgt) GTK_WIDGET_VISIBLE (wdgt) #endif #if !GTK_CHECK_VERSION (2, 19, 6) #define gtk_widget_set_realized(wdgt, real) \ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Don't override small toolbar icon size
Updating branch refs/heads/master to 679ecf5d84071162b3af5873ac140af7d4f355a9 (commit) from 6788ae477071f107c0960fc558a26124ffe35bbd (commit) commit 679ecf5d84071162b3af5873ac140af7d4f355a9 Author: Christian Dywan Date: Mon Feb 22 14:21:09 2010 +0100 Don't override small toolbar icon size The hack was originally meant to fix themes with no proper small icons, but it doesn't really help in most cases. midori/sokoke.h |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/midori/sokoke.h b/midori/sokoke.h index 8ffc3a1..7d46de2 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -61,9 +61,6 @@ sokoke_js_script_eval (JSContextRef js_context, const gchar*script, gchar** exception); -/* Many themes need this hack for small toolbars to work */ -#define GTK_ICON_SIZE_SMALL_TOOLBAR GTK_ICON_SIZE_BUTTON - void sokoke_message_dialog (GtkMessageType message_type, const gchar*short_message, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Fallback to the first browser if one is closed
Updating branch refs/heads/master to f3f53db4d7389a2cd2a5ab2627475bdfb0ee5fda (commit) from 8388e263c2981094e7f0b695705b0947931edebe (commit) commit f3f53db4d7389a2cd2a5ab2627475bdfb0ee5fda Author: Alexander Butenko Date: Mon Feb 22 18:53:00 2010 +0100 Fallback to the first browser if one is closed We need to keep one browser as the default for commands and opening files externally. midori/midori-app.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/midori/midori-app.c b/midori/midori-app.c index 0bf21b1..d8cb2d9 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -172,7 +172,10 @@ midori_browser_destroy_cb (MidoriBrowser* browser, g_signal_emit (app, signals[REMOVE_BROWSER], 0, browser); katze_array_remove_item (app->browsers, browser); if (!katze_array_is_empty (app->browsers)) +{ +app->browser = katze_array_get_nth_item (app->browsers, 0); return FALSE; +} midori_app_quit (app); return TRUE; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Dupe OS type for ident string before using it
Updating branch refs/heads/master to 458c5109bec859f762de6dfb0c49b693f360c4de (commit) from f3f53db4d7389a2cd2a5ab2627475bdfb0ee5fda (commit) commit 458c5109bec859f762de6dfb0c49b693f360c4de Author: Alexander Butenko Date: Mon Feb 22 19:02:32 2010 +0100 Dupe OS type for ident string before using it midori/midori-websettings.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 8b133cc..d07baa0 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -1188,7 +1188,7 @@ get_sys_name (void) { struct utsname name; if (uname (&name) != -1) -sys_name = name.sysname; +sys_name = g_strdup(name.sysname); else sys_name = "Unix"; } ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Store searches and completion search in the location
Updating branch refs/heads/master to de89bcd2dca283e0e93b0d5fe1ce6d881c7b42cc (commit) from 705d2b7627826c6f6c7ac0f6aab242b5963df2fe (commit) commit de89bcd2dca283e0e93b0d5fe1ce6d881c7b42cc Author: Christian Dywan Date: Mon Feb 22 23:49:27 2010 +0100 Store searches and completion search in the location midori/main.c | 12 +++-- midori/midori-browser.c| 28 ++ midori/midori-locationaction.c | 51 +++ 3 files changed, 72 insertions(+), 19 deletions(-) diff --git a/midori/main.c b/midori/main.c index eed1713..70eb1b0 100644 --- a/midori/main.c +++ b/midori/main.c @@ -368,9 +368,15 @@ midori_history_initialize (KatzeArray* array, } if (sqlite3_exec (db, - "CREATE TABLE IF NOT EXISTS " - "history(uri text, title text, date integer, day integer)", - NULL, NULL, errmsg) != SQLITE_OK) + "CREATE TABLE IF NOT EXISTS " + "history (uri text, title text, date integer, day integer);" + "CREATE TABLE IF NOT EXISTS " + "search (keywords text, uri text, day integer);" + "CREATE TEMP VIEW history_view AS SELECT " + "1 AS type, uri, title FROM history;" + "CREATE TEMP VIEW search_view AS SELECT " + "2 AS type, uri, keywords AS title FROM search;", + NULL, NULL, errmsg) != SQLITE_OK) return NULL; sqlite3_prepare_v2 (db, "SELECT day FROM history LIMIT 1", -1, &stmt, NULL); diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f5906e2..f5c41d6 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3853,6 +3853,12 @@ _action_location_submit_uri (GtkAction* action, gchar** parts; gchar* keywords = NULL; const gchar* search_uri = NULL; +#if HAVE_SQLITE +time_t now; +gint64 day; +sqlite3* db; +static sqlite3_stmt* statement = NULL; +#endif /* Do we have a keyword and a string? */ parts = g_strsplit (stripped_uri, " ", 2); @@ -3876,6 +3882,28 @@ _action_location_submit_uri (GtkAction* action, } new_uri = sokoke_search_uri (search_uri, keywords); +#if HAVE_SQLITE +now = time (NULL); +day = sokoke_time_t_to_julian (&now); + +db = g_object_get_data (G_OBJECT (browser->history), "db"); +if (!statement) +{ +const gchar* sqlcmd; +sqlcmd = "INSERT INTO search (keywords, uri, day) VALUES (?,?,?)"; +sqlite3_prepare_v2 (db, sqlcmd, strlen (sqlcmd) + 1, &statement, NULL); +} +sqlite3_bind_text (statement, 1, keywords, -1, 0); +sqlite3_bind_text (statement, 2, search_uri, -1, 0); +sqlite3_bind_int64 (statement, 3, day); + +if (sqlite3_step (statement) != SQLITE_DONE) +g_printerr (_("Failed to insert new history item: %s\n"), +sqlite3_errmsg (db)); +sqlite3_reset (statement); +sqlite3_clear_bindings (statement); +#endif + g_free (keywords); } else diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 1ab63c7..b10a9fc 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -87,6 +87,7 @@ enum VISIBLE_COL, YALIGN_COL, BACKGROUND_COL, +STYLE_COL, N_COLS }; @@ -268,7 +269,8 @@ midori_location_action_create_model (void) { GtkTreeModel* model = (GtkTreeModel*) gtk_list_store_new (N_COLS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, -G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_FLOAT, GDK_TYPE_COLOR); +G_TYPE_INT, G_TYPE_BOOLEAN, G_TYPE_FLOAT, +GDK_TYPE_COLOR, G_TYPE_BOOLEAN); return model; } @@ -341,6 +343,7 @@ midori_location_action_popup_timeout_cb (gpointer data) static sqlite3_stmt* stmt; const gchar* sqlcmd; gint matches, searches, height, screen_height, sep; +GtkStyle* style; if (!gtk_widget_has_focus (action->entry) || !action->history) return FALSE; @@ -355,13 +358,16 @@ midori_location_action_popup_timeout_cb (gpointer data) { sqlite3* db; db = g_object_get_data (G_OBJECT (action->history), "db"); -sqlcmd = "SELECT uri, title FROM history WHERE uri LIKE ? OR title LIKE ?" - " GROUP BY uri ORDER BY count() DESC LIMIT ?"; -sqlite3_prepare_v2 (db, sqlcmd, -1, &stmt, NULL); +sqlcmd = "SELECT type, uri, title, count() AS ct FROM history_view " + "WHERE uri LIK
[Xfce4-commits] Include previous searches in History panel items
Updating branch refs/heads/master to 3f886f71536e4cee8011a3908f9eb727fa1cefd9 (commit) from cc79b94c34f8f20d24f7a77d51b838a064aebe3c (commit) commit 3f886f71536e4cee8011a3908f9eb727fa1cefd9 Author: Christian Dywan Date: Thu Feb 25 23:09:31 2010 +0100 Include previous searches in History panel items midori/main.c |4 ++-- midori/midori-locationaction.c |6 ++ panels/midori-history.c|9 ++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/midori/main.c b/midori/main.c index 70eb1b0..9e2f377 100644 --- a/midori/main.c +++ b/midori/main.c @@ -373,9 +373,9 @@ midori_history_initialize (KatzeArray* array, "CREATE TABLE IF NOT EXISTS " "search (keywords text, uri text, day integer);" "CREATE TEMP VIEW history_view AS SELECT " - "1 AS type, uri, title FROM history;" + "1 AS type, uri, title, day FROM history;" "CREATE TEMP VIEW search_view AS SELECT " - "2 AS type, uri, keywords AS title FROM search;", + "2 AS type, uri, keywords AS title, day FROM search;", NULL, NULL, errmsg) != SQLITE_OK) return NULL; diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index b10a9fc..f86260c 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -361,7 +361,7 @@ midori_location_action_popup_timeout_cb (gpointer data) sqlcmd = "SELECT type, uri, title, count() AS ct FROM history_view " "WHERE uri LIKE ?1 OR title LIKE ?1 GROUP BY uri " "UNION ALL " - "SELECT type, uri, title, count() AS ct FROM search_view " + "SELECT type, replace(uri, '%s', title) AS uri, title, count() AS ct FROM search_view " "WHERE title LIKE ?1 GROUP BY uri " "ORDER BY ct DESC LIMIT ?2"; sqlite3_prepare_v2 (db, sqlcmd, strlen (sqlcmd) + 1, &stmt, NULL); @@ -450,12 +450,10 @@ midori_location_action_popup_timeout_cb (gpointer data) FAVICON_COL, icon, -1); else if (type == 2 /* search_view */) { -gchar* search_uri = sokoke_search_uri ((gchar*)uri, (gchar*)title); gchar* search_title = g_strdup_printf (_("Search for %s"), title); gtk_list_store_insert_with_values (store, NULL, matches, -URI_COL, search_uri, TITLE_COL, search_title, YALIGN_COL, 0.25, +URI_COL, uri, TITLE_COL, search_title, YALIGN_COL, 0.25, STYLE_COL, 1, FAVICON_COL, icon, -1); -g_free (search_uri); g_free (search_title); } diff --git a/panels/midori-history.c b/panels/midori-history.c index 0d6c186..41b1951 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -210,9 +210,12 @@ midori_history_read_from_db (MidoriHistory* history, { gchar* filterstr; -sqlcmd = "SELECT uri, title, date " - "FROM history WHERE uri LIKE ? or title LIKE ? " - "GROUP BY uri ORDER BY date ASC"; +sqlcmd = "SELECT uri, title, day FROM history_view " + "WHERE uri LIKE ? or title LIKE ? GROUP BY uri " + "UNION ALL " + "SELECT replace(uri, '%s', title) AS uri, title, day " + "FROM search_view WHERE title LIKE ?1 GROUP BY uri " + "ORDER BY day ASC"; result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL); filterstr = g_strdup_printf ("%%%s%%", filter); sqlite3_bind_text (statement, 1, filterstr, -1, g_free); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Implement Scroll actions, defaulting to Vim direction keys
Updating branch refs/heads/master to fe203524fefd52f41e7c99cefa7a8020ba8469ba (commit) from 3f886f71536e4cee8011a3908f9eb727fa1cefd9 (commit) commit fe203524fefd52f41e7c99cefa7a8020ba8469ba Author: Christian Dywan Date: Sun Feb 28 23:41:54 2010 +0100 Implement Scroll actions, defaulting to Vim direction keys midori/midori-browser.c | 44 midori/midori-view.c|6 -- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index f5c41d6..9041d3d 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3647,6 +3647,32 @@ _action_fullscreen_activate (GtkAction* action, gtk_window_fullscreen (GTK_WINDOW (browser)); } +#if WEBKIT_CHECK_VERSION (1, 1, 4) +static void +_action_scroll_somewhere_activate (GtkAction* action, + MidoriBrowser* browser) +{ +GtkWidget* view; +WebKitWebView* web_view; +const gchar* name; + +view = midori_browser_get_current_tab (browser); +if (!view) +return; +web_view = WEBKIT_WEB_VIEW (gtk_bin_get_child (GTK_BIN (view))); +name = gtk_action_get_name (action); + +if (g_str_equal (name, "ScrollLeft")) +webkit_web_view_move_cursor (web_view, GTK_MOVEMENT_VISUAL_POSITIONS, -1); +if (g_str_equal (name, "ScrollDown")) +webkit_web_view_move_cursor (web_view, GTK_MOVEMENT_DISPLAY_LINES, 1); +else if (g_str_equal (name, "ScrollUp")) +webkit_web_view_move_cursor (web_view, GTK_MOVEMENT_DISPLAY_LINES, -1); +else if (g_str_equal (name, "ScrollRight")) +webkit_web_view_move_cursor (web_view, GTK_MOVEMENT_VISUAL_POSITIONS, 1); +} +#endif + static void _action_back_activate (GtkAction* action, MidoriBrowser* browser) @@ -5366,6 +5392,20 @@ static const GtkActionEntry entries[] = { { "Fullscreen", GTK_STOCK_FULLSCREEN, NULL, "F11", N_("Toggle fullscreen view"), G_CALLBACK (_action_fullscreen_activate) }, + #if WEBKIT_CHECK_VERSION (1, 1, 4) + { "ScrollLeft", NULL, + N_("Scroll _Left"), "h", + N_("Scroll to the left"), G_CALLBACK (_action_scroll_somewhere_activate) }, + { "ScrollDown", NULL, + N_("Scroll _Down"), "j", + N_("Scroll down"), G_CALLBACK (_action_scroll_somewhere_activate) }, + { "ScrollUp", NULL, + N_("Scroll _Up"), "k", + N_("Scroll up"), G_CALLBACK (_action_scroll_somewhere_activate) }, + { "ScrollRight", NULL, + N_("Scroll _Right"), "l", + N_("Scroll to the right"), G_CALLBACK (_action_scroll_somewhere_activate) }, + #endif { "Go", NULL, N_("_Go") }, { "Back", GTK_STOCK_GO_BACK, @@ -5692,6 +5732,10 @@ static const gchar* ui_markup = /* For accelerators to work all actions need to be used *somewhere* in the UI definition */ "" +"" +"" +"" +"" "" "" "" diff --git a/midori/midori-view.c b/midori/midori-view.c index a2487ca..3bd811e 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1385,11 +1385,13 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view, GdkEventKey* event, MidoriView*view) { -guint character = gdk_unicode_to_keyval (event->keyval); +guint character; if (event->keyval == '.' || event->keyval == '/' || event->keyval == GDK_KP_Divide) character = '\0'; -else if (!view->find_while_typing) +else if (view->find_while_typing) +character = gdk_unicode_to_keyval (event->keyval); +else return FALSE; /* Skip control characters */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Implement "Export bookmarks" menu item to export to XBEL
Updating branch refs/heads/master to 100eea41dad1c3aec7a36101276a1b1037cc0dfe (commit) from cbd5e54daba6c668b1d6b11558150dcbc6dc1461 (commit) commit 100eea41dad1c3aec7a36101276a1b1037cc0dfe Author: Christian Dywan Date: Mon Mar 1 22:10:42 2010 +0100 Implement "Export bookmarks" menu item to export to XBEL midori/midori-browser.c | 39 +++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 9041d3d..759e1ec 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3001,9 +3001,14 @@ _action_bookmarks_populate_popup (GtkAction* action, gtk_widget_show (menuitem); } menuitem = gtk_action_create_menu_item ( +_action_by_name (browser, "BookmarksExport")); +gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); +gtk_widget_show (menuitem); +menuitem = gtk_action_create_menu_item ( _action_by_name (browser, "BookmarksImport")); gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); + menuitem = gtk_action_create_menu_item ( _action_by_name (browser, "BookmarkFolderAdd")); gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), menuitem); @@ -4636,6 +4641,36 @@ _action_bookmarks_import_activate (GtkAction* action, } static void +_action_bookmarks_export_activate (GtkAction* action, + MidoriBrowser* browser) +{ +GtkWidget* file_dialog; +gchar* path = NULL; +GError* error; + +file_dialog = sokoke_file_chooser_dialog_new (_("Save file as"), +GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE); +gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_dialog), + "bookmarks.xbel"); +if (gtk_dialog_run (GTK_DIALOG (file_dialog)) == GTK_RESPONSE_OK) +path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog)); +gtk_widget_destroy (file_dialog); + +if (path == NULL) +return; + +error = NULL; +if (!midori_array_to_file (browser->bookmarks, path, "xbel", &error)) +{ +sokoke_message_dialog (GTK_MESSAGE_ERROR, +_("Failed to export bookmarks"), error ? error->message : ""); +if (error) +g_error_free (error); +} +g_free (path); +} + +static void _action_manage_search_engines_activate (GtkAction* action, MidoriBrowser* browser) { @@ -5441,6 +5476,9 @@ static const GtkActionEntry entries[] = { { "BookmarksImport", NULL, N_("_Import bookmarks"), "", NULL, G_CALLBACK (_action_bookmarks_import_activate) }, + { "BookmarksExport", NULL, + N_("_Export bookmarks"), "", + NULL, G_CALLBACK (_action_bookmarks_export_activate) }, { "ManageSearchEngines", GTK_STOCK_PROPERTIES, N_("_Manage Search Engines"), "s", N_("Add, edit and remove search engines..."), @@ -5740,6 +5778,7 @@ static const gchar* ui_markup = "" "" "" +"" "" "" "" ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Declare widget allocation macros for GTK+ < 2.18 properly
Updating branch refs/heads/master to 3583a070565f6f17278ac2c1b8dc77c5b1fa3579 (commit) from 100eea41dad1c3aec7a36101276a1b1037cc0dfe (commit) commit 3583a070565f6f17278ac2c1b8dc77c5b1fa3579 Author: Enrico Tröger Date: Tue Mar 2 23:57:14 2010 +0100 Declare widget allocation macros for GTK+ < 2.18 properly katze/katze-utils.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 21192d4..a4af47a 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -31,7 +31,7 @@ #if !GTK_CHECK_VERSION (2, 18, 0) #define gtk_widget_get_has_window(wdgt) !GTK_WIDGET_NO_WINDOW (wdgt) -#define gtk_widget_get_allocation (wdgt, alloc) *alloc = wdgt->allocation +#define gtk_widget_get_allocation(wdgt, alloc) *alloc = wdgt->allocation #endif static void ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Only middle click search if the selection contains :// or Alt
Updating branch refs/heads/master to 044f1f96fbf2dad626e5e03d23e377b0036b1a33 (commit) from 3583a070565f6f17278ac2c1b8dc77c5b1fa3579 (commit) commit 044f1f96fbf2dad626e5e03d23e377b0036b1a33 Author: Christian Dywan Date: Wed Mar 3 00:31:35 2010 +0100 Only middle click search if the selection contains :// or Alt Accidentally searching is annoying. Presumably when a proper address is selected it was intentional. midori/midori-view.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/midori/midori-view.c b/midori/midori-view.c index 3bd811e..917ccb3 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1324,6 +1324,11 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view, } katze_assign (uri, new_uri); } +else if (!strstr (uri, "://")) +{ +g_free (uri); +return FALSE; +} if (MIDORI_MOD_NEW_TAB (event->state)) { @@ -1337,8 +1342,8 @@ gtk_widget_button_press_event_cb (WebKitWebView* web_view, midori_view_set_uri (MIDORI_VIEW (view), uri); gtk_widget_grab_focus (GTK_WIDGET (view)); } +g_free (uri); return TRUE; -g_free (uri); } } break; ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Add -Wunreachable-code to compilation warnings
Updating branch refs/heads/master to baef8d12839fbf641dc4d356f76aabd02f71ce26 (commit) from 1900c603a91763c7fb7bb04ea165e7c0345a2f03 (commit) commit baef8d12839fbf641dc4d356f76aabd02f71ce26 Author: Christian Dywan Date: Wed Mar 3 23:19:22 2010 +0100 Add -Wunreachable-code to compilation warnings wscript |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/wscript b/wscript index 4e7b7fe..11f28f7 100644 --- a/wscript +++ b/wscript @@ -297,7 +297,7 @@ def configure (conf): '-Wno-missing-field-initializers ' '-Wredundant-decls -Wmissing-noreturn ' '-Wshadow -Wpointer-arith -Wcast-align ' -'-Winline -Wformat-security ' +'-Winline -Wformat-security -Wunreachable-code ' '-Winit-self -Wundef -Wdeclaration-after-statement ' '-Wmissing-format-attribute -Wnested-externs ' # -DGSEAL_ENABLE ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Always append tabs added from a loaded session
Updating branch refs/heads/master to 6ae3633dce4e4ed6c892f6090ed4f7feb2de0c9c (commit) from 8f23dcfd33fc63357480904539b086def3bcdf91 (commit) commit 6ae3633dce4e4ed6c892f6090ed4f7feb2de0c9c Author: Christian Dywan Date: Wed Mar 3 23:52:07 2010 +0100 Always append tabs added from a loaded session We shouldn't honor user preferences for new tabs when loading the session. Rather we append in the order they were saved in. This is currently a hack. In the future we should consider public API additions to insert tabs in a particular order. midori/main.c |3 +++ midori/midori-browser.c |4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/midori/main.c b/midori/main.c index 9e2f377..d02bb7c 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1261,7 +1261,10 @@ midori_load_session (gpointer data) session = midori_browser_get_proxy_array (browser); i = 0; while ((item = katze_array_get_nth_item (_session, i++))) +{ +g_object_set_data (G_OBJECT (item), "midori-view-append", (void*)1); midori_browser_add_item (browser, item); +} current = katze_item_get_meta_integer (KATZE_ITEM (_session), "current"); if (current < 0) current = 0; diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 759e1ec..3f87759 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -7333,6 +7333,10 @@ midori_browser_add_item (MidoriBrowser* browser, midori_view_set_uri (MIDORI_VIEW (view), uri); gtk_widget_show (view); +/* FIXME: We should have public API for that */ +if (g_object_get_data (G_OBJECT (item), "midori-view-append")) +g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1); + page = midori_browser_add_tab (browser, view); proxy_item = midori_view_get_proxy_item (MIDORI_VIEW (view)); if ((keys = katze_item_get_meta_keys (item))) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Disconnect tab callback when disabling Colorful Tabs
Updating branch refs/heads/master to 8f23dcfd33fc63357480904539b086def3bcdf91 (commit) from baef8d12839fbf641dc4d356f76aabd02f71ce26 (commit) commit 8f23dcfd33fc63357480904539b086def3bcdf91 Author: Samuel Creshal Date: Wed Mar 3 23:32:00 2010 +0100 Disconnect tab callback when disabling Colorful Tabs extensions/colorful-tabs.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/extensions/colorful-tabs.c b/extensions/colorful-tabs.c index f000639..01a0bd7 100644 --- a/extensions/colorful-tabs.c +++ b/extensions/colorful-tabs.c @@ -80,6 +80,8 @@ colorful_tabs_deactivate_cb (MidoriExtension* extension, g_signal_handlers_disconnect_by_func ( app, colorful_tabs_app_add_browser_cb, extension); g_signal_handlers_disconnect_by_func ( +browser, colorful_tabs_browser_add_tab_cb, extension); +g_signal_handlers_disconnect_by_func ( extension, colorful_tabs_deactivate_cb, browser); i = 0; while ((view = midori_browser_get_nth_tab (browser, i++))) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Relate completion height to browser window height
Updating branch refs/heads/master to cf6cffe2bcb861194a2dd19c78e55a00a1ce9f88 (commit) from 6ae3633dce4e4ed6c892f6090ed4f7feb2de0c9c (commit) commit cf6cffe2bcb861194a2dd19c78e55a00a1ce9f88 Author: Christian Dywan Date: Thu Mar 4 23:47:05 2010 +0100 Relate completion height to browser window height To prevent the completion from obscuring other windows, it will relate to 2/3 of the browser window and screen height respectively. midori/midori-locationaction.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index f86260c..d053b7f 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -342,7 +342,8 @@ midori_location_action_popup_timeout_cb (gpointer data) gint result; static sqlite3_stmt* stmt; const gchar* sqlcmd; -gint matches, searches, height, screen_height, sep; +gint matches, searches, height, screen_height, browser_height, sep; +MidoriBrowser* browser = midori_browser_get_for_widget (action->entry); GtkStyle* style; if (!gtk_widget_has_focus (action->entry) || !action->history) @@ -497,10 +498,12 @@ midori_location_action_popup_timeout_cb (gpointer data) column = gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0); gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, &height); screen_height = gdk_screen_get_height (gtk_widget_get_screen (action->popup)); +gtk_window_get_size (GTK_WINDOW (browser), NULL, &browser_height); +screen_height = MIN (MIN (browser_height, screen_height / 1.5), screen_height / 1.5); gtk_widget_style_get (action->treeview, "vertical-separator", &sep, NULL); /* FIXME: Instead of 1.5 we should relate to the height of one line */ height = MIN (matches * height + (matches + searches) * sep - + searches * height / 1.5, screen_height / 1.5); + + searches * height / 1.5, screen_height); gtk_widget_set_size_request (action->treeview, -1, height); midori_location_action_popup_position (action->popup, action->entry); gtk_widget_show_all (action->popup); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Remove -Wunreachable-code due to false positives
Updating branch refs/heads/master to f4565203738d06c3080c4eb971934413e2d7342a (commit) from 3aac49063be5a30042bc30a378471fdd3f0486f4 (commit) commit f4565203738d06c3080c4eb971934413e2d7342a Author: Christian Dywan Date: Sat Mar 6 18:55:15 2010 +0100 Remove -Wunreachable-code due to false positives wscript |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/wscript b/wscript index 11f28f7..4e7b7fe 100644 --- a/wscript +++ b/wscript @@ -297,7 +297,7 @@ def configure (conf): '-Wno-missing-field-initializers ' '-Wredundant-decls -Wmissing-noreturn ' '-Wshadow -Wpointer-arith -Wcast-align ' -'-Winline -Wformat-security -Wunreachable-code ' +'-Winline -Wformat-security ' '-Winit-self -Wundef -Wdeclaration-after-statement ' '-Wmissing-format-attribute -Wnested-externs ' # -DGSEAL_ENABLE ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Bail out of Export if no bookmarks or hidden
Updating branch refs/heads/master to e7005abd55d8d3f54a08dda2ad2d1532e8822179 (commit) from 9f20a889e1548287694c23b380d13239e40f4bb9 (commit) commit e7005abd55d8d3f54a08dda2ad2d1532e8822179 Author: Christian Dywan Date: Sat Mar 6 19:16:52 2010 +0100 Bail out of Export if no bookmarks or hidden midori/midori-browser.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 3f87759..566b800 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -4648,6 +4648,9 @@ _action_bookmarks_export_activate (GtkAction* action, gchar* path = NULL; GError* error; +if (!browser->bookmarks || !GTK_WIDGET_VISIBLE (browser)) +return; + file_dialog = sokoke_file_chooser_dialog_new (_("Save file as"), GTK_WINDOW (browser), GTK_FILE_CHOOSER_ACTION_SAVE); gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (file_dialog), ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Cancel completion if we don't have an entry
Updating branch refs/heads/master to e69ee84b6b8ecfce66b4caa51e118fc576c26190 (commit) from e7005abd55d8d3f54a08dda2ad2d1532e8822179 (commit) commit e69ee84b6b8ecfce66b4caa51e118fc576c26190 Author: Christian Dywan Date: Sat Mar 6 19:18:09 2010 +0100 Cancel completion if we don't have an entry midori/midori-locationaction.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index d053b7f..87eb568 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -343,10 +343,10 @@ midori_location_action_popup_timeout_cb (gpointer data) static sqlite3_stmt* stmt; const gchar* sqlcmd; gint matches, searches, height, screen_height, browser_height, sep; -MidoriBrowser* browser = midori_browser_get_for_widget (action->entry); +MidoriBrowser* browser; GtkStyle* style; -if (!gtk_widget_has_focus (action->entry) || !action->history) +if (!action->entry || !gtk_widget_has_focus (action->entry) || !action->history) return FALSE; if (!(action->key && *action->key)) @@ -495,6 +495,7 @@ midori_location_action_popup_timeout_cb (gpointer data) gtk_tree_view_columns_autosize (GTK_TREE_VIEW (action->treeview)); } +browser = midori_browser_get_for_widget (action->entry); column = gtk_tree_view_get_column (GTK_TREE_VIEW (action->treeview), 0); gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, &height); screen_height = gdk_screen_get_height (gtk_widget_get_screen (action->popup)); ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Bump version to 0.2.4
Updating branch refs/heads/master to 37fc44c375678b208d973da46458ffb44875d863 (commit) from e69ee84b6b8ecfce66b4caa51e118fc576c26190 (commit) commit 37fc44c375678b208d973da46458ffb44875d863 Author: Christian Dywan Date: Sun Mar 7 22:23:04 2010 +0100 Bump version to 0.2.4 ChangeLog | 12 wscript |2 +- 2 files changed, 13 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb8c3aa..d5a8a89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ This file is licensed under the terms of the expat license, see the file EXPAT. +v0.2.4 + + Prevent completion from overlapping + + Fix tab order when restoring session + + Ignore accidentally middle click search + + Implement bookmark export to XBEL + + Provide scroll hotkeys, default to Vim + + Store and complete search in location + + Fix opening externally with multiple windows + + Only use icons in panel buttons + + Fix build with different GTK+ versions + + Omit micro version and arch from ident string + v0.2.3 + Improve relocatability for Win32 + Implement 'Close other tabs' menu item diff --git a/wscript b/wscript index 4e7b7fe..0adb766 100644 --- a/wscript +++ b/wscript @@ -25,7 +25,7 @@ import misc major = 0 minor = 2 -micro = 3 +micro = 4 APPNAME = 'midori' VERSION = str (major) + '.' + str (minor) + '.' + str (micro) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Skip unavailable languages in LINGUAS
Updating branch refs/heads/master to f3cb7c31ec8e54e45f47021ad156550de26c018c (commit) from 574b00ae5009c6c9c9cd714eab8019641fbb2b11 (commit) commit f3cb7c31ec8e54e45f47021ad156550de26c018c Author: Christian Dywan Date: Mon Mar 8 21:12:00 2010 +0100 Skip unavailable languages in LINGUAS wscript |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/wscript b/wscript index 0adb766..bb789a0 100644 --- a/wscript +++ b/wscript @@ -379,7 +379,10 @@ def write_linguas_file (self): else: podir = '../po' if 'LINGUAS' in Build.bld.env: -linguas = Build.bld.env['LINGUAS'] +files = Build.bld.env['LINGUAS'] +for f in files.split (' '): +if os.path.exists (podir + '/' + f + '.po'): +linguas += f + ' ' else: files = os.listdir (podir) for f in files: ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Free text after proxy combo text change
Updating branch refs/heads/master to 8c1e5e430529e773a2a4713dbc7a8ac256f44891 (commit) from aff89e587f9632e358920ad2f74951f503785ca5 (commit) commit 8c1e5e430529e773a2a4713dbc7a8ac256f44891 Author: Christian Dywan Date: Thu Mar 11 23:03:54 2010 +0100 Free text after proxy combo text change katze/katze-utils.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index a4af47a..d3e93d6 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -85,6 +85,7 @@ proxy_combo_box_text_changed_cb (GtkComboBox* button, gchar* text = gtk_combo_box_get_active_text (button); const gchar* property = g_object_get_data (G_OBJECT (button), "property"); g_object_set (object, property, text, NULL); +g_free (text); } static const gchar* ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Merge KatzeNet icon loading into MidoriView
Updating branch refs/heads/master to b5f83343607b8f0434bc5f848754a4b03a2ccd1c (commit) from 8c1e5e430529e773a2a4713dbc7a8ac256f44891 (commit) commit b5f83343607b8f0434bc5f848754a4b03a2ccd1c Author: Christian Dywan Date: Thu Mar 11 23:27:37 2010 +0100 Merge KatzeNet icon loading into MidoriView MidoriView is the only place where icons are and should be loaded, elsewhere we just use cached icons. midori_view_get_icon_uri allows distinguishing whether a view has an icon or a default icon, and using the filename. katze/katze-net.c| 252 +- katze/katze-net.h| 11 +-- midori/midori-view.c | 226 +++- midori/midori-view.h |3 + 4 files changed, 227 insertions(+), 265 deletions(-) diff --git a/katze/katze-net.c b/katze/katze-net.c index c4cdbae..d781b9b 100644 --- a/katze/katze-net.c +++ b/katze/katze-net.c @@ -27,7 +27,6 @@ struct _KatzeNet { GObject parent_instance; -GHashTable* memory; gchar* cache_path; guint cache_size; @@ -54,17 +53,8 @@ katze_net_class_init (KatzeNetClass* class) } static void -katze_net_object_maybe_unref (gpointer object) -{ -if (object) -g_object_unref (object); -} - -static void katze_net_init (KatzeNet* net) { -net->memory = g_hash_table_new_full (g_str_hash, g_str_equal, - g_free, katze_net_object_maybe_unref); net->cache_path = g_build_filename (g_get_user_cache_dir (), PACKAGE_NAME, NULL); @@ -76,7 +66,6 @@ katze_net_finalize (GObject* object) { KatzeNet* net = KATZE_NET (object); -g_hash_table_destroy (net->memory); katze_assign (net->cache_path, NULL); G_OBJECT_CLASS (katze_net_parent_class)->finalize (object); @@ -147,7 +136,7 @@ katze_net_priv_free (KatzeNetPriv* priv) g_free (priv); } -static gchar* +gchar* katze_net_get_cached_path (KatzeNet*net, const gchar* uri, const gchar* subfolder) @@ -383,242 +372,3 @@ katze_net_load_uri (KatzeNet* net, g_idle_add ((GSourceFunc)katze_net_default_cb, priv); } -typedef struct -{ -KatzeNet* net; -gchar* icon_file; -KatzeNetIconCb icon_cb; -GtkWidget* widget; -gpointer user_data; -} KatzeNetIconPriv; - -static void -katze_net_icon_priv_free (KatzeNetIconPriv* priv) -{ -g_free (priv->icon_file); -if (priv->widget) -g_object_unref (priv->widget); -g_free (priv); -} - -static gboolean -katze_net_icon_status_cb (KatzeNetRequest* request, - KatzeNetIconPriv* priv) -{ -switch (request->status) -{ -case KATZE_NET_VERIFIED: -if (request->mime_type && -!g_str_has_prefix (request->mime_type, "image/")) -{ -katze_net_icon_priv_free (priv); -return FALSE; -} -break; -case KATZE_NET_MOVED: -break; -default: -katze_net_icon_priv_free (priv); -return FALSE; -} - -return TRUE; -} - -static void -katze_net_icon_transfer_cb (KatzeNetRequest* request, -KatzeNetIconPriv* priv) -{ -GdkPixbuf* pixbuf; -FILE* fp; -GdkPixbuf* pixbuf_scaled; -gint icon_width, icon_height; -size_t ret; -GtkSettings* settings; - -if (request->status == KATZE_NET_MOVED) -return; - -pixbuf = NULL; -if (request->data) -{ -if ((fp = fopen (priv->icon_file, "wb"))) -{ -ret = fwrite (request->data, 1, request->length, fp); -fclose (fp); -if ((ret - request->length) != 0) -{ -g_warning ("Error writing to file %s " - "in katze_net_icon_transfer_cb()", priv->icon_file); -} -pixbuf = gdk_pixbuf_new_from_file (priv->icon_file, NULL); -} -else -pixbuf = katze_pixbuf_new_from_buffer ((guchar*)request->data, -request->length, request->mime_type, NULL); -if (pixbuf) -g_object_ref (pixbuf); -g_hash_table_insert (priv->net->memory, -g_strdup (priv->icon_file), pixbuf); -} - -if (!priv->icon_cb) -{ -katze_net_icon_priv_free (priv); -return; -} - -if (!pixbuf) -{ -if (priv->widget) -pixbuf = gtk_widget_render_icon (priv->widget, -GTK_STOCK_FILE, GTK_ICON_SIZE_MENU, NULL); -else -{ -priv->icon_cb (NULL, priv->user_data); -katze_net_icon_priv_free (priv); -return; -} -} - -if (priv->widget) -settings = gtk_widget_get_settings (priv->wi
[Xfce4-commits] Implement and use sokoke_recursive_fork_protection
Updating branch refs/heads/master to 283005e217d3735ebf30e7ee6cbbf904c9f97fb1 (commit) from b0162d83f2978d290381f90b196a1e5c32cdde8c (commit) commit 283005e217d3735ebf30e7ee6cbbf904c9f97fb1 Author: André Stösel Date: Fri Mar 12 23:25:09 2010 +0100 Implement and use sokoke_recursive_fork_protection As Midori may call external tools to open URIs it cannot handle, and at the same time Midori is commonly the default browser, this can end in recursion when the external tool also calls Midori. See the description of sokoke_recursive_fork_protection(). midori/midori-app.c | 15 +-- midori/sokoke.c | 33 + midori/sokoke.h |4 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/midori/midori-app.c b/midori/midori-app.c index d8cb2d9..52716ee 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -470,14 +470,17 @@ midori_app_command_received (MidoriApp* app, gchar* fixed_uri = sokoke_magic_uri (*uris); if (!fixed_uri) fixed_uri = g_strdup (*uris); -if (first) +if (sokoke_recursive_fork_protection (fixed_uri, FALSE)) { -midori_browser_set_current_uri (browser, fixed_uri); -first = FALSE; +if (first) +{ +midori_browser_set_current_uri (browser, fixed_uri); +first = FALSE; +} +else +midori_browser_set_current_page (browser, +midori_browser_add_uri (browser, fixed_uri)); } -else -midori_browser_set_current_page (browser, -midori_browser_add_uri (browser, fixed_uri)); g_free (fixed_uri); uris++; } diff --git a/midori/sokoke.c b/midori/sokoke.c index 657ba9a..a26078a 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -273,6 +273,7 @@ sokoke_show_uri (GdkScreen* screen, guint32 timestamp, GError** error) { + #if HAVE_HILDON HildonURIAction* action = hildon_uri_get_default_action_by_uri (uri, NULL); return hildon_uri_open (uri, action, error); @@ -352,6 +353,8 @@ sokoke_show_uri (GdkScreen* screen, g_return_val_if_fail (uri != NULL, FALSE); g_return_val_if_fail (!error || !*error, FALSE); +sokoke_recursive_fork_protection (uri, TRUE); + #if GTK_CHECK_VERSION (2, 14, 0) if (gtk_show_uri (screen, uri, timestamp, error)) return TRUE; @@ -1740,6 +1743,36 @@ sokoke_prefetch_uri (const char* uri) return TRUE; } +/** + * sokoke_recursive_fork_protection + * @uri: the URI to check + * @set_uri: if TRUE the URI will be saved + * + * Protects against recursive invokations of the Midori executable + * with the same URI. + * + * As an example, consider having an URI starting with 'tel://'. You + * could attempt to open it with sokoke_show_uri. In turn, 'exo-open' + * might be called. Now quite possibly 'exo-open' is unable to handle + * 'tel://' and might well fall back to 'midori' as default browser. + * + * To protect against this scenario, call this function with the + * URI and %TRUE before calling any external tool. + * #MidoriApp calls sokoke_recursive_fork_protection() with %FALSE + * and bails out if %FALSE is returned. + * + * Return value: %TRUE if @uri is new, %FALSE on recursion + **/ +gboolean +sokoke_recursive_fork_protection (const gchar* uri, + gboolean set_uri) +{ +static gchar* fork_uri = NULL; +if (set_uri) +katze_assign (fork_uri, g_strdup (uri)); +return g_strcmp0 (fork_uri, uri) == 0 ? FALSE : TRUE; +} + /* Provide a new way for SoupSession to assume an 'Accept-Language' string automatically from the return value of g_get_language_names(), properly formatted according to RFC2616. diff --git a/midori/sokoke.h b/midori/sokoke.h index 7d46de2..927cfee 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -226,4 +226,8 @@ sokoke_prefetch_uri (const char* uri); gchar * sokoke_accept_languages (const gchar* const * lang_names); +gboolean +sokoke_recursive_fork_protection(const gchar* uri, + gboolean set_uri); + #endif /* !__SOKOKE_H__ */ ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Creating annotated tag 0.2.4
Updating annotated tag refs/tags/0.2.4 as new annotated tag to 3bc5e487c81c94080d2bbdb906318b9c2176c895 (tag) succeeds 0.2.3-43-ge69ee84 tagged by Christian Dywan on 2010-03-13 13:51 + Christian Dywan (1): Bump version to 0.2.4 ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] Use "post" method for the error page Reload button
Updating branch refs/heads/master to 597dde083bb001ab621e9932239db2b8bc030b4f (commit) from 283005e217d3735ebf30e7ee6cbbf904c9f97fb1 (commit) commit 597dde083bb001ab621e9932239db2b8bc030b4f Author: André Stösel Date: Sat Mar 13 15:05:40 2010 +0100 Use "post" method for the error page Reload button This allows us to retain "get" parameters in the address. data/error.html |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/data/error.html b/data/error.html index 600a6c8..e3ea4c5 100644 --- a/data/error.html +++ b/data/error.html @@ -68,7 +68,7 @@ description { {title} {message} {description} - + {tryagain} ___ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits