[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r22046 - in gnunet-gtk: contrib src/fs src/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r22046 - in gnunet-gtk: contrib src/fs src/lib |
Date: |
Sat, 16 Jun 2012 20:25:53 +0200 |
Author: grothoff
Date: 2012-06-16 20:25:53 +0200 (Sat, 16 Jun 2012)
New Revision: 22046
Modified:
gnunet-gtk/contrib/Makefile.am
gnunet-gtk/contrib/gnunet_fs_gtk_publish_tab.glade
gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
gnunet-gtk/src/lib/animations.c
Log:
-starting to get working animation for publish tab
Modified: gnunet-gtk/contrib/Makefile.am
===================================================================
--- gnunet-gtk/contrib/Makefile.am 2012-06-16 18:13:36 UTC (rev 22045)
+++ gnunet-gtk/contrib/Makefile.am 2012-06-16 18:25:53 UTC (rev 22046)
@@ -13,6 +13,12 @@
$(IMAGES)
pkgdata_DATA = \
+ downloading.gif \
+ downloaded.gif \
+ found_source.gif \
+ published.gif \
+ publishing.gif \
+ searching_sources.gif \
gnunet_fs_gtk_about_window.glade \
gnunet_fs_gtk_create_namespace_dialog.glade \
gnunet_fs_gtk_download_as_dialog.glade \
Modified: gnunet-gtk/contrib/gnunet_fs_gtk_publish_tab.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_fs_gtk_publish_tab.glade 2012-06-16 18:13:36 UTC
(rev 22045)
+++ gnunet-gtk/contrib/gnunet_fs_gtk_publish_tab.glade 2012-06-16 18:25:53 UTC
(rev 22046)
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.20"/>
<!-- interface-naming-policy toplevel-contextual -->
@@ -21,6 +21,7 @@
</columns>
</object>
<object class="GtkWindow" id="_publish_frame_window">
+ <property name="can_focus">False</property>
<property name="title">You should never see this</property>
<child>
<object class="GtkScrolledWindow" id="_publish_frame_scrolled_window">
@@ -28,13 +29,13 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
- <object class="GtkTreeView" id="_publish_frame">
+ <object class="GtkTreeView" id="_publish_tree_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">_publish_frame_tree_store</property>
<property name="enable_tree_lines">True</property>
- <signal name="button_press_event"
handler="GNUNET_FS_GTK_publish_treeview_button_press_event"/>
- <signal name="popup_menu"
handler="GNUNET_FS_GTK_publish_treeview_popup_menu"/>
+ <signal name="button-press-event"
handler="GNUNET_FS_GTK_publish_treeview_button_press_event" swapped="no"/>
+ <signal name="popup-menu"
handler="GNUNET_FS_GTK_publish_treeview_popup_menu" swapped="no"/>
<child>
<object class="GtkTreeViewColumn" id="filename">
<property name="sizing">autosize</property>
@@ -62,6 +63,17 @@
</object>
</child>
<child>
+ <object class="GtkTreeViewColumn" id="_publish_animated_icon">
+ <property name="title" translatable="yes">Status</property>
+ <child>
+ <object class="GtkCellRendererPixbuf"
id="_publish_animated_icon_renderer"/>
+ <attributes>
+ <attribute name="pixbuf">6</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
<object class="GtkTreeViewColumn" id="filesize">
<property name="sizing">autosize</property>
<property name="title">Size</property>
@@ -81,17 +93,21 @@
</child>
</object>
<object class="GtkWindow" id="_publish_label_window">
+ <property name="can_focus">False</property>
<child>
<object class="GtkHBox" id="_publish_label_hbox">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="border_width">5</property>
<child>
<object class="GtkLabel" id="_publish_label_window_label">
<property name="height_request">30</property>
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes">Publishing</property>
</object>
<packing>
+ <property name="expand">True</property>
<property name="fill">False</property>
<property name="padding">5</property>
<property name="position">0</property>
@@ -99,14 +115,16 @@
</child>
<child>
<object class="GtkButton" id="_publish_label_close_button">
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">half</property>
- <signal name="clicked"
handler="GNUNET_FS_GTK_publish_label_close_button_clicked"/>
+ <signal name="clicked"
handler="GNUNET_FS_GTK_publish_label_close_button_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="close_icon_stock_image">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="stock">gtk-close</property>
<property name="icon-size">2</property>
</object>
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:13:36 UTC
(rev 22045)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c 2012-06-16 18:25:53 UTC
(rev 22046)
@@ -191,6 +191,11 @@
* Associated tree store.
*/
GtkTreeStore *ts;
+
+ /**
+ * Animation handle associated with the tree store.
+ */
+ struct GNUNET_FS_AnimationTreeViewHandle *atv;
};
@@ -250,10 +255,33 @@
*/
static struct PublishTab *publish_tab;
+/**
+ * Animation to display while publishing.
+ */
+static struct GNUNET_FS_AnimationContext *animation_publishing;
+
+
/* ***************** Search event handling ****************** */
+static struct GNUNET_FS_AnimationContext *
+load_animation (const char *basename)
+{
+ struct GNUNET_FS_AnimationContext *ac;
+ const char *dd;
+ char *fn;
+
+ dd = GNUNET_GTK_get_data_dir ();
+ GNUNET_asprintf (&fn,
+ "%s%s.gif",
+ dd, basename);
+ ac = GNUNET_GTK_animation_context_create (fn);
+ GNUNET_free (fn);
+ return ac;
+}
+
+
/**
* Clear the metadata list and the preview widget.
*/
@@ -2617,6 +2645,36 @@
/**
+ * Remove publish tab from notebook
+ */
+static void
+delete_publish_tab ()
+{
+ GtkNotebook *notebook;
+ int index;
+ int i;
+
+ notebook =
+ GTK_NOTEBOOK (GNUNET_FS_GTK_get_main_window_object
+ ("GNUNET_GTK_main_window_notebook"));
+ index = -1;
+ for (i = gtk_notebook_get_n_pages (notebook) - 1; i >= 0; i--)
+ if (publish_tab->frame == gtk_notebook_get_nth_page (notebook, i))
+ index = i;
+ gtk_notebook_remove_page (notebook, index);
+
+ /* fully destroy tab */
+ g_object_unref (publish_tab->builder);
+ if (NULL != publish_tab->atv)
+ GNUNET_GTK_animation_tree_view_unregister (publish_tab->atv);
+ GNUNET_free (publish_tab);
+ publish_tab = NULL;
+ GNUNET_GTK_animation_context_destroy (animation_publishing);
+ animation_publishing = NULL;
+}
+
+
+/**
* A publishing operation was stopped (in FS API). Free an entry in
* the publish tab and its associated state.
*
@@ -2644,6 +2702,8 @@
GNUNET_FS_uri_destroy (pe->uri);
pe->uri = NULL;
}
+ if (! gtk_tree_model_iter_children (GTK_TREE_MODEL (pe->tab->ts), &iter,
NULL))
+ delete_publish_tab ();
GNUNET_free (pe);
}
@@ -2663,9 +2723,6 @@
struct PublishEntry *pe;
GtkTreeIter iter;
GtkTreeModel *tm;
- GtkNotebook *notebook;
- int index;
- int i;
GNUNET_assert (tab == publish_tab);
/* stop all active operations */
@@ -2676,21 +2733,7 @@
GNUNET_FS_publish_stop (pe->pc);
}
clear_metadata_display ();
-
- /* remove tab from notebook */
- notebook =
- GTK_NOTEBOOK (GNUNET_FS_GTK_get_main_window_object
- ("GNUNET_GTK_main_window_notebook"));
- index = -1;
- for (i = gtk_notebook_get_n_pages (notebook) - 1; i >= 0; i--)
- if (publish_tab->frame == gtk_notebook_get_nth_page (notebook, i))
- index = i;
- gtk_notebook_remove_page (notebook, index);
-
- /* fully destroy tab */
- g_object_unref (publish_tab->builder);
- GNUNET_free (publish_tab);
- publish_tab = NULL;
+ delete_publish_tab ();
}
@@ -2717,6 +2760,8 @@
GtkWidget *tab_label;
GtkNotebook *notebook;
char *size_fancy;
+ GtkTreeView *tv;
+ GtkTreeViewColumn *anim_col;
if (NULL == publish_tab)
{
@@ -2739,7 +2784,15 @@
g_object_ref (tab_label);
gtk_container_remove (GTK_CONTAINER (df), tab_label);
gtk_widget_destroy (GTK_WIDGET (df));
-
+
+ tv = GTK_TREE_VIEW (gtk_builder_get_object
+ (publish_tab->builder, "_publish_tree_view"));
+ anim_col = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object
+ (publish_tab->builder, "_publish_animated_icon"));
+ if ( (NULL != tv) && (NULL != anim_col) )
+ publish_tab->atv = GNUNET_GTK_animation_tree_view_register (tv,
+ anim_col);
+
/* make visible */
notebook =
GTK_NOTEBOOK (GNUNET_FS_GTK_get_main_window_object
@@ -2770,6 +2823,8 @@
}
pitrptr = &piter;
}
+ if (NULL == animation_publishing)
+ animation_publishing = load_animation ("publishing");
/* create entry and perform insertion */
ent = GNUNET_malloc (sizeof (struct PublishEntry));
@@ -2783,6 +2838,8 @@
PUBLISH_TAB_MC_BGCOLOUR, "white",
PUBLISH_TAB_MC_PROGRESS, (guint) 0,
PUBLISH_TAB_MC_ENT, ent,
+ PUBLISH_TAB_MC_STATUS_ICON,
+ GNUNET_GTK_animation_context_get_pixbuf
(animation_publishing),
-1);
GNUNET_free (size_fancy);
path = gtk_tree_model_get_path (GTK_TREE_MODEL (publish_tab->ts), &iter);
Modified: gnunet-gtk/src/lib/animations.c
===================================================================
--- gnunet-gtk/src/lib/animations.c 2012-06-16 18:13:36 UTC (rev 22045)
+++ gnunet-gtk/src/lib/animations.c 2012-06-16 18:25:53 UTC (rev 22046)
@@ -142,6 +142,9 @@
ac->ani = gdk_pixbuf_animation_new_from_file (filename, &err);
if (NULL == ac->ani)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("Failed to load animation from file `%s'\n"),
+ filename);
GNUNET_free (ac);
return NULL;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r22046 - in gnunet-gtk: contrib src/fs src/lib,
gnunet <=