summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorJens Finke <jens@triq.net>2003-05-31 12:06:16 +0000
committerJens Finke <jens@src.gnome.org>2003-05-31 12:06:16 +0000
commit6f28d19e0057bd414d65f726c6fd28c1e7e97340 (patch)
treed88e631e91c2af2c2d5b5c91d4f2a56fca27859c /shell
parent629a5c5187f765278cb9c04217330615801c020a (diff)
downloadeog-6f28d19e0057bd414d65f726c6fd28c1e7e97340.tar.gz
Added progress indication.
2003-05-31 Jens Finke <jens@triq.net> Added progress indication. * collection/eog-collection-view.c: New property "image/progress". (image_progress_cb): New function. (apply_transformation): Setup the progress indication stuff. (handle_selection_changed): Connect to the image progress changed signal. (eog_collection_view_construct): Register "image/progress" property. * collection/eog-collection-view-ui.xml: Added "Undo" mnemonic. * libeog/eog-image.c (eog_image_class_init): New signal "progress". (check_load_status): Check for progress changes and emit signal if appropriate. (transform_progress_hook_async): New function. (real_image_load): Determine file size of image to load and update progress status. Ref/unref clean up when transforming the image. (check_progress_sync), (transform_progress_hook_sync): New functions. (image_transform): Register progress hooks on image transformation. (eog_image_transform): Init progress check function. * libeog/eog-transform.[ch] (eog_transform_apply): Added callback function, which is called in intervalls to update progress status. * shell/eog-window.c (eog_window_construct): Put progressbar on statusbar. (check_for_control_properties), (property_changed_cb): Handle progress property. * viewer/eog-image-view.c (image_progress_cb): New functin. (load_uri_cb): Connect to object's progress signal. (eog_image_view_construct): Register "image/progress" property.
Diffstat (limited to 'shell')
-rw-r--r--shell/eog-window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/shell/eog-window.c b/shell/eog-window.c
index e51cc740..1d79ed0d 100644
--- a/shell/eog-window.c
+++ b/shell/eog-window.c
@@ -56,6 +56,7 @@
#define PROPERTY_WINDOW_TITLE "window/title"
#define PROPERTY_WINDOW_WIDTH "window/width"
#define PROPERTY_WINDOW_HEIGHT "window/height"
+#define PROPERTY_IMAGE_PROGRESS "image/progress"
/* Private part of the Window structure */
struct _EogWindowPrivate {
@@ -686,7 +687,7 @@ eog_window_construct (EogWindow *window)
G_CALLBACK (open_recent_cb), window);
/* add statusbar */
- priv->statusbar = gnome_appbar_new (FALSE, TRUE, GNOME_PREFERENCES_NEVER);
+ priv->statusbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_box_pack_end (GTK_BOX (priv->box), GTK_WIDGET (priv->statusbar),
FALSE, FALSE, 0);
gtk_widget_show (GTK_WIDGET (priv->statusbar));
@@ -799,7 +800,11 @@ property_changed_cb (BonoboListener *listener,
if (any == NULL) return;
- if (!g_ascii_strcasecmp (event_name, PROPERTY_WINDOW_TITLE)) {
+ if (!g_ascii_strcasecmp (event_name, PROPERTY_IMAGE_PROGRESS)) {
+ gnome_appbar_set_progress_percentage (GNOME_APPBAR (window->priv->statusbar),
+ BONOBO_ARG_GET_FLOAT (any));
+ }
+ else if (!g_ascii_strcasecmp (event_name, PROPERTY_WINDOW_TITLE)) {
char *title;
title = BONOBO_ARG_GET_STRING (any);
@@ -882,6 +887,11 @@ check_for_control_properties (EogWindow *window)
/* query window size */
height = bonobo_pbclient_get_long (pb, PROPERTY_WINDOW_HEIGHT, &ev);
}
+ else if (g_ascii_strcasecmp ((char*) it->data, PROPERTY_IMAGE_PROGRESS) == 0) {
+ bonobo_event_source_client_add_listener (pb,
+ (BonoboListenerCallbackFn) property_changed_cb,
+ PROPERTY_IMAGE_PROGRESS, &ev, window);
+ }
}
adapt_window_size (window, width, height);