Author: peter
Date: 2007-01-12 23:32:33 +0000 (Fri, 12 Jan 2007)
New Revision: 24380

Modified:
   squeeze/trunk/libsqueeze/archive-support-zip.c
   squeeze/trunk/libsqueeze/archive-support.c
   squeeze/trunk/libsqueeze/archive-support.h
   squeeze/trunk/src/widget_factory.c
Log:
made posible for zip integrity test to notify the user about the results
the integrity test has still to by run, though :)


Modified: squeeze/trunk/libsqueeze/archive-support-zip.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support-zip.c      2007-01-12 21:38:30 UTC 
(rev 24379)
+++ squeeze/trunk/libsqueeze/archive-support-zip.c      2007-01-12 23:32:33 UTC 
(rev 24380)
@@ -63,7 +63,7 @@
 static gint lsq_archive_support_zip_remove(LSQArchive *, GSList *);
 static gint lsq_archive_support_zip_refresh(LSQArchive *);
 
-static gboolean lsq_archive_support_zip_integrity_test(LSQArchiveSupport *, 
LSQArchive *, gpointer);
+static gboolean lsq_archive_support_zip_integrity_test(LSQArchiveSupport *, 
LSQArchive *, LSQCustomAction*, gpointer);
 
 GType
 lsq_archive_support_zip_get_type ()
@@ -496,13 +496,15 @@
 }
 
 static gboolean
-lsq_archive_support_zip_integrity_test(LSQArchiveSupport *support, LSQArchive 
*archive, gpointer user_data)
+lsq_archive_support_zip_integrity_test(LSQArchiveSupport *support, LSQArchive 
*archive, LSQCustomAction *action, gpointer user_data)
 {
 #ifdef DEBUG
        g_debug("Custom action %s called", __FUNCTION__);
 #endif /* DEBUG */
 
-       return FALSE;
+       lsq_custom_action_notify(action, "Integrity test completed");
+
+       return TRUE;
 }
 
 static void

Modified: squeeze/trunk/libsqueeze/archive-support.c
===================================================================
--- squeeze/trunk/libsqueeze/archive-support.c  2007-01-12 21:38:30 UTC (rev 
24379)
+++ squeeze/trunk/libsqueeze/archive-support.c  2007-01-12 23:32:33 UTC (rev 
24380)
@@ -351,5 +351,18 @@
        }
        /* set post-condition-callback */
        action->post_func = post_func;  
-       action->func(action->support, archive, action->user_data);
+       action->func(action->support, archive, action, action->user_data);
 }
+
+void
+lsq_custom_action_notify(LSQCustomAction *action, const gchar *message)
+{
+       action->notify_func(action->support->id, message, action->user_data);
+}
+
+void
+lsq_custom_action_set_notify_function(LSQCustomAction *action, 
LSQCustomActionNotifyFunc func, gpointer user_data)
+{
+       action->notify_func = func;
+       action->notify_user_data = user_data;
+}

Modified: squeeze/trunk/libsqueeze/archive-support.h
===================================================================
--- squeeze/trunk/libsqueeze/archive-support.h  2007-01-12 21:38:30 UTC (rev 
24379)
+++ squeeze/trunk/libsqueeze/archive-support.h  2007-01-12 23:32:33 UTC (rev 
24380)
@@ -45,8 +45,9 @@
 typedef struct _LSQArchiveSupport LSQArchiveSupport;
 
 typedef gboolean (*LSQCustomActionPreFunc) (LSQCustomAction *);
-typedef gboolean (*LSQCustomActionFunc) (LSQArchiveSupport *support, 
LSQArchive *, gpointer user_data);
+typedef gboolean (*LSQCustomActionFunc) (LSQArchiveSupport *support, 
LSQArchive *, LSQCustomAction*, gpointer user_data);
 typedef gboolean (*LSQCustomActionPostFunc) (LSQCustomAction *, gboolean);
+typedef gboolean (*LSQCustomActionNotifyFunc) (const gchar*, const gchar*, 
gpointer);
 
 struct _LSQCustomAction
 {
@@ -56,6 +57,8 @@
        gchar *icon;
        LSQCustomActionFunc func;
        LSQCustomActionPostFunc post_func;
+       LSQCustomActionNotifyFunc notify_func;
+       gpointer notify_user_data;
        LSQArchiveSupport *support;
        gpointer user_data;
 };
@@ -126,6 +129,8 @@
 const gchar*         lsq_custom_action_get_blurb(LSQCustomAction*);
 const gchar*         lsq_custom_action_get_icon_name(LSQCustomAction*);
 void                 lsq_custom_action_execute(LSQCustomAction*, LSQArchive *, 
LSQCustomActionPreFunc, LSQCustomActionPostFunc);
+void                 lsq_custom_action_notify(LSQCustomAction*, const gchar*);
+void                 lsq_custom_action_set_notify_function(LSQCustomAction*, 
LSQCustomActionNotifyFunc, gpointer);
 
 G_END_DECLS
 

Modified: squeeze/trunk/src/widget_factory.c
===================================================================
--- squeeze/trunk/src/widget_factory.c  2007-01-12 21:38:30 UTC (rev 24379)
+++ squeeze/trunk/src/widget_factory.c  2007-01-12 23:32:33 UTC (rev 24380)
@@ -71,6 +71,9 @@
 static void
 cb_sq_widget_factory_action_triggered(GtkWidget *widget, gpointer user_data);
 
+static void
+sq_widget_factory_notify(const gchar *name, const gchar *message, gpointer 
user_data);
+
 GType
 sq_widget_factory_get_type()
 {
@@ -961,6 +964,7 @@
        {
                if(strncmp("menu", lsq_custom_action_get_name(action[i]), 4) == 
0)
                {
+                       lsq_custom_action_set_notify_function(action[i], 
(LSQCustomActionNotifyFunc)sq_widget_factory_notify, NULL);
                        item = 
gtk_menu_item_new_with_label(lsq_custom_action_get_nick(action[i]));
                        g_object_set_data(G_OBJECT(item), 
SQ_ACTION_CUSTOM_DATA, action[i]);
                        g_signal_connect(G_OBJECT(item), "activate", 
G_CALLBACK(cb_sq_widget_factory_action_triggered), archive);
@@ -988,3 +992,10 @@
        g_signal_handlers_disconnect_by_func(user_data, 
cb_sq_widget_factory_property_notify, obj);
 }
 
+static void
+sq_widget_factory_notify(const gchar *name, const gchar *message, gpointer 
user_data)
+{
+       GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(user_data), 
GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s: %s", name, message);
+       gtk_dialog_run(GTK_DIALOG(dialog));
+       gtk_widget_destroy(dialog);
+}

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to