[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22048 - in gnunet-gtk: contrib src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22048 - in gnunet-gtk: contrib src/fs |
Date: |
Sat, 16 Jun 2012 21:14:55 +0200 |
Author: grothoff
Date: 2012-06-16 21:14:55 +0200 (Sat, 16 Jun 2012)
New Revision: 22048
Modified:
gnunet-gtk/contrib/Makefile.am
gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.h
Log:
-towards status icons for searching
Modified: gnunet-gtk/contrib/Makefile.am
===================================================================
--- gnunet-gtk/contrib/Makefile.am 2012-06-16 18:35:09 UTC (rev 22047)
+++ gnunet-gtk/contrib/Makefile.am 2012-06-16 19:14:55 UTC (rev 22048)
@@ -14,6 +14,7 @@
pkgdata_DATA = \
downloading.gif \
+ downloading_not_receiving.gif \
downloaded.gif \
found_source.gif \
published.gif \
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2012-06-16 18:35:09 UTC
(rev 22047)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2012-06-16 19:14:55 UTC
(rev 22048)
@@ -260,8 +260,38 @@
*/
static struct GNUNET_FS_AnimationContext *animation_publishing;
+/**
+ * Animation to display after publishing is complete.
+ */
+static struct GNUNET_FS_AnimationContext *animation_published;
+/**
+ * Animation to display while downloading.
+ */
+static struct GNUNET_FS_AnimationContext *animation_downloading;
+/**
+ * Animation to display after downloading is complete.
+ */
+static struct GNUNET_FS_AnimationContext *animation_downloaded;
+
+/**
+ * Animation to display if a download has stalled.
+ */
+static struct GNUNET_FS_AnimationContext *animation_download_stalled;
+
+/**
+ * Animation to display while searching for sources to download from.
+ */
+static struct GNUNET_FS_AnimationContext *animation_searching_sources;
+
+/**
+ * Animation to display if we found sources to download from.
+ */
+static struct GNUNET_FS_AnimationContext *animation_found_sources;
+
+
+
/* ***************** Search event handling ****************** */
@@ -1013,7 +1043,23 @@
GNUNET_CONTAINER_DLL_remove (search_tab_head, search_tab_tail, tab);
if (tab == uri_tab)
uri_tab = NULL;
+ if (NULL != tab->atv)
+ GNUNET_GTK_animation_tree_view_unregister (tab->atv);
GNUNET_free (tab);
+ if (NULL == search_tab_head)
+ {
+ GNUNET_GTK_animation_context_destroy (animation_downloading);
+ animation_downloading = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_downloaded);
+ animation_downloaded = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_download_stalled);
+ animation_download_stalled = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_searching_sources);
+ animation_searching_sources = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_found_sources);
+ animation_found_sources = NULL;
+
+ }
}
@@ -1921,8 +1967,18 @@
struct SearchTab *tab;
GtkNotebook *notebook;
GtkWindow *sf;
+ GtkTreeViewColumn *anim_col;
+ GtkTreeView *tv;
gint pages;
+ if (NULL == animation_downloading)
+ {
+ animation_downloading = load_animation ("downloading");
+ animation_downloaded = load_animation ("downloaded");
+ animation_download_stalled = load_animation ("downloading_not_receiving");
+ animation_searching_sources = load_animation ("searching_sources");
+ animation_found_sources = load_animation ("found_source");
+ }
tab = GNUNET_malloc (sizeof (struct SearchTab));
GNUNET_CONTAINER_DLL_insert (search_tab_head, search_tab_tail, tab);
tab->sc = sc;
@@ -1945,6 +2001,12 @@
GTK_TREE_STORE (gtk_builder_get_object
(tab->builder,
"GNUNET_GTK_file_sharing_result_tree_store"));
+ tv = GTK_TREE_VIEW (gtk_builder_get_object
+ (tab->builder, "_search_result_frame"));
+ anim_col = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object
+ (tab->builder,
"search_result_status_pixbuf_column"));
+ tab->atv = GNUNET_GTK_animation_tree_view_register (tv,
+ anim_col);
/* load frame */
sf = GTK_WINDOW (gtk_builder_get_object
(tab->builder, "_search_result_frame_window"));
@@ -2609,6 +2671,8 @@
gtk_tree_store_set (pe->tab->ts, &iter,
PUBLISH_TAB_MC_RESULT_STRING, uris,
PUBLISH_TAB_MC_PROGRESS, 100,
+ PUBLISH_TAB_MC_STATUS_ICON,
+ GNUNET_GTK_animation_context_get_pixbuf
(animation_published),
-1);
GNUNET_free (uris);
change_publish_color (pe, "green");
@@ -2671,6 +2735,8 @@
publish_tab = NULL;
GNUNET_GTK_animation_context_destroy (animation_publishing);
animation_publishing = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_published);
+ animation_published = NULL;
}
@@ -2824,8 +2890,10 @@
pitrptr = &piter;
}
if (NULL == animation_publishing)
+ {
animation_publishing = load_animation ("publishing");
-
+ animation_published = load_animation ("published");
+ }
/* create entry and perform insertion */
ent = GNUNET_malloc (sizeof (struct PublishEntry));
ent->is_top = (parent == NULL) ? GNUNET_YES : GNUNET_NO;
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.h
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.h 2012-06-16 18:35:09 UTC
(rev 22047)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.h 2012-06-16 19:14:55 UTC
(rev 22048)
@@ -108,6 +108,11 @@
GtkTreeStore *ts;
/**
+ * Animation handle associated with the tree store.
+ */
+ struct GNUNET_FS_AnimationTreeViewHandle *atv;
+
+ /**
* Number of results we got for this search.
*/
unsigned int num_results;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22048 - in gnunet-gtk: contrib src/fs,
gnunet <=