summaryrefslogtreecommitdiff
path: root/components/services/nautilus-dependent-shared
diff options
context:
space:
mode:
authorMaciej Stachowiak <mstachow@src.gnome.org>2001-02-19 23:12:11 +0000
committerMaciej Stachowiak <mstachow@src.gnome.org>2001-02-19 23:12:11 +0000
commitbe34bbbe95ec8303bc21345ac886246f03c3a0e5 (patch)
tree95720c2703ab7e21498087782d6954c58cc67529 /components/services/nautilus-dependent-shared
parentbe9e2a17796b5c7b21004d7198d601c7449974f8 (diff)
downloadnautilus-be34bbbe95ec8303bc21345ac886246f03c3a0e5.tar.gz
reviewed by: John Harper <jsh@eazel.com>
Fixed bugs 3743 (Summary view gives the same vague error message for many different causes), 3972 (If user can't connect to service, they end up with gray content view), 5973 (blank summary view after install view finishes) and 6166 (Summary Login dialog does not have initial focus) and 6018 (Nautilus returns to wrong directory if services are unavailable). Also did much code cleanup, and made the service and featured download icons in the summary view prelighting and clickable. Fixed many other nits as well. * components/services/nautilus-dependent-shared/eazel-services-extensions.h, components/services/nautilus-dependent-shared/eazel-services-extensions.c (eazel_services_clickable_image_new_from_uri): Convenience wrapper to make a new clickable image from a URI. * components/services/nautilus-dependent-shared/eazel-services-footer.c (eazel_services_footer_update): Clear the footer before updating, instead of just dumping the new items in along with the old ones. * components/services/trilobite/libtrilobite/trilobite-core-network.h, components/services/trilobite/libtrilobite/trilobite-core-network.c: Adjusted formatting, fixed headers. * components/services/trilobite/libtrilobite/trilobite-file-utilities.h, components/services/trilobite/libtrilobite/trilobite-file-utilities.c: Cut 'n' pasted some useful code from libnautilus-extensions to avoid depending on it, whee. * components/services/trilobite/libtrilobite/Makefile.am: Added above to the build. * components/services/trilobite/libtrilobite/trilobite-redirect.h, components/services/trilobite/libtrilobite/trilobite-redirect.c: (trilobite_redirect_fetch_table_async, trilobite_redirect_fetch_table_cancel): Asynchronous version of redirect fetching code. (redirect_fetch_callback): Helper function. (trilobite_redirect_parse_xml): Null terminate buffer properly or XML parsing code will get confused. (trilobite_redirect_fetch_table): Removed the old synchronous code since now no one is using it. * components/services/summary/lib/eazel-summary-shared.h, components/services/summary/lib/eazel-summary-shared.c: (eazel_summary_fetch_data_cancel, eazel_summary_fetch_data_async): Asynchronous version of summary fetching code. (summary_data_fetch_callback): Helper function. (eazel_summary_data_parse_xml): Same null termination trick as for redirects. (parse_summary_xml_file): Removed old synchronous code since now no one is unsing it. * components/services/summary/nautilus-view/main.c (main): Set user agent to trilobite user agent; intialize gnome-vfs. * components/services/summary/nautilus-view/nautilus-summary-dialogs.h, components/services/summary/nautilus-view/nautilus-summary-dialogs.c (nautilus_summary_show_login_failure_dialog): Renamed from `nautilus_summary_login_failure_dialog' (nautilus_summary_show_error_dialog): Renamed from `generate_error_dialog'. (nautilus_summary_show_login_dialog): Renamed from `generate_login_dialog'. (error_dialog_cancel_cb): Go back instead of (incorrectly) trying to go back to the user's homedir. (set_dialog_parent): Do the magic coordinate adjustment like gnome_dialog_set_parent, but do not set it transient, or it will not get focus in click to focus mode. * components/services/summary/nautilus-view/nautilus-summary-callbacks.c: (authn_cb_failed): Adjust to above renaming. * components/services/summary/nautilus-view/nautilus-summary-footer.c (footer_item_clicked_callback): Ditto. * components/services/summary/nautilus-view/nautilus-summary-menu-items.c: (bonobo_login_callback): Ditto. * components/services/summary/nautilus-view/nautilus-summary-view-private.h: Removed unused fields. Added async handles for redirect and summary XML fetch. * components/services/summary/nautilus-view/nautilus-summary-view.c: (services_button_callback_data_free, summary_view_button_callback, goto_uri_on_clicked, summary_view_button_new, summary_view_link_image_new): Cleaned up summary view button code, added code for the clickable icons and refactored a bit. (create_header): Start out saying "Connecting to Eazel Services..." instead of blank, and don't call `update_header' from here. (update_footer): fix incorrect polarity of offline and online. (create_footer): remove call to update_footer; leave offline items in place until connected. (create_news_pane, create_services_list_pane, create_featured_downloads_pane): Do not call corresponding update func, updating is now separate from creating. (generate_service_entry_row, generate_update_news_entry_row): Make icons clickable. (update_summary_form): New function to update the existing summary view with new data, to avoid recreating even the fixed widgets from scratch all the time. (create_summary_form): Do not destroy all widgets at the beginning. Remove some useless widgetry. (nautilus_summary_view_initialize): Create the widgetry but do not fill it with data. (nautilus_summary_view_destroy, summary_fetch_callback, redirect_fetch_callback, cancel_load_in_progress), nautilus_summary_view_load_uri, summary_load_location_callback): Change things around so loading of the summary data is asynchronous. (summary_stop_loading_callback): Handle "stop_loading".
Diffstat (limited to 'components/services/nautilus-dependent-shared')
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-extensions.c47
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-extensions.h5
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-footer.c4
3 files changed, 50 insertions, 6 deletions
diff --git a/components/services/nautilus-dependent-shared/eazel-services-extensions.c b/components/services/nautilus-dependent-shared/eazel-services-extensions.c
index 29f4b499e..6a183538f 100644
--- a/components/services/nautilus-dependent-shared/eazel-services-extensions.c
+++ b/components/services/nautilus-dependent-shared/eazel-services-extensions.c
@@ -126,12 +126,6 @@ eazel_services_image_new_from_uri (const char *uri,
g_return_val_if_fail (uri != NULL, NULL);
- /* as an optimization, it can be a local file. If it doesn't start with http://,
- just pass it on to create_image_widget */
- if (!nautilus_istr_has_prefix (uri, "http://")) {
- return eazel_services_image_new (uri, tile_name, background_color);
- }
-
/* load the image - synchronously, at least at first */
pixbuf = nautilus_gdk_pixbuf_load (uri);
@@ -154,6 +148,47 @@ eazel_services_image_new_from_uri (const char *uri,
return image;
}
+
+
+GtkWidget *
+eazel_services_clickable_image_new_from_uri (const char *uri,
+ const char *tile_name,
+ guint32 background_color,
+ int max_width,
+ int max_height)
+{
+ GtkWidget *image = NULL;
+ GdkPixbuf *pixbuf;
+ GdkPixbuf *scaled_pixbuf;
+
+ g_return_val_if_fail (uri != NULL, NULL);
+
+ /* load the image - synchronously, at least at first */
+ pixbuf = nautilus_gdk_pixbuf_load (uri);
+
+ /* pin the image to the specified dimensions if necessary */
+ if (pixbuf && max_width > 0 && max_height > 0) {
+ scaled_pixbuf = nautilus_gdk_pixbuf_scale_down_to_fit (pixbuf, max_width, max_height);
+ gdk_pixbuf_unref (pixbuf);
+ pixbuf = scaled_pixbuf;
+ }
+
+ /* create the image widget then release the pixbuf*/
+ image = eazel_services_image_new_clickable (NULL, tile_name, background_color);
+
+ if (pixbuf != NULL) {
+ nautilus_labeled_image_set_pixbuf (NAUTILUS_LABELED_IMAGE (image),
+ pixbuf);
+ }
+
+ nautilus_gdk_pixbuf_unref_if_not_null (pixbuf);
+
+ return image;
+}
+
+
+
+
GtkWidget *
eazel_services_label_new (const char *text,
guint drop_shadow_offset,
diff --git a/components/services/nautilus-dependent-shared/eazel-services-extensions.h b/components/services/nautilus-dependent-shared/eazel-services-extensions.h
index 68ecb1b6d..818133182 100644
--- a/components/services/nautilus-dependent-shared/eazel-services-extensions.h
+++ b/components/services/nautilus-dependent-shared/eazel-services-extensions.h
@@ -75,6 +75,11 @@ GtkWidget *eazel_services_image_new_from_uri (const char *uri,
guint32 background_color,
int max_width,
int max_height);
+GtkWidget *eazel_services_clickable_image_new_from_uri (const char *uri,
+ const char *tile_name,
+ guint32 background_color,
+ int max_width,
+ int max_height);
GtkWidget *eazel_services_label_new (const char *text,
guint drop_shadow_offset,
float xalign,
diff --git a/components/services/nautilus-dependent-shared/eazel-services-footer.c b/components/services/nautilus-dependent-shared/eazel-services-footer.c
index aebcea1d0..1c4220772 100644
--- a/components/services/nautilus-dependent-shared/eazel-services-footer.c
+++ b/components/services/nautilus-dependent-shared/eazel-services-footer.c
@@ -318,6 +318,10 @@ eazel_services_footer_update (EazelServicesFooter *footer,
g_return_if_fail (items != NULL);
g_return_if_fail (num_items > 0);
+ gtk_container_foreach (GTK_CONTAINER (footer),
+ (GtkCallback) gtk_widget_destroy,
+ NULL);
+
for (i = 0; i < num_items; i++) {
GtkWidget *item;