gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3566 - in gnunet-gtk/src: common include plugins/daemon pl


From: grothoff
Subject: [GNUnet-SVN] r3566 - in gnunet-gtk/src: common include plugins/daemon plugins/fs
Date: Sun, 29 Oct 2006 15:35:49 -0800 (PST)

Author: grothoff
Date: 2006-10-29 15:35:44 -0800 (Sun, 29 Oct 2006)
New Revision: 3566

Modified:
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/include/gnunetgtk_common.h
   gnunet-gtk/src/plugins/daemon/daemon.c
   gnunet-gtk/src/plugins/fs/fs.c
   gnunet-gtk/src/plugins/fs/namespace.c
   gnunet-gtk/src/plugins/fs/search.c
Log:
fixing save call API and uses

Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2006-10-29 22:40:43 UTC (rev 3565)
+++ gnunet-gtk/src/common/helper.c      2006-10-29 23:35:44 UTC (rev 3566)
@@ -44,8 +44,9 @@
 typedef struct {
   struct SEMAPHORE * sem;
   void * args;
-  SimpleCallback func;
+  PThreadMain func;
   int destroyed;
+  void * rval;
 } SaveCall;
 
 typedef struct Plugin {
@@ -112,8 +113,7 @@
          pscCount-1);
     MUTEX_UNLOCK(sclock);
   }
-
-  call->func(call->args);
+  call->rval = call->func(call->args);
   if (call->sem != NULL)
     SEMAPHORE_UP(call->sem);
   return FALSE;
@@ -124,8 +124,8 @@
  * Since GTK doesn't work with multi-threaded applications under Windows,
  * all GTK operations have to be done in the main thread
  */
-void gtkSaveCall(SimpleCallback func,
-                void * args) {
+void * gtkSaveCall(PThreadMain func,
+                  void * args) {
   SaveCall call;
 
   MUTEX_LOCK(sclock);
@@ -135,6 +135,7 @@
     call.func = func;
     call.sem  = SEMAPHORE_CREATE(0);
     call.destroyed = 0;
+    call.rval = NULL;
     GROW(psc,
         pscCount,
         pscCount+1);
@@ -145,9 +146,10 @@
     PTHREAD_STOP_SLEEP(mainThread);
     SEMAPHORE_DOWN(call.sem, YES);
     SEMAPHORE_DESTROY(call.sem);
+    return call.rval;
   } else {
     MUTEX_UNLOCK(sclock);
-    func(args);
+    return func(args);
   }
 }
 
@@ -171,7 +173,7 @@
 /**
  * Callback for infoMessage()
  */
-static void doInfoMessage(void * args) {
+static void * doInfoMessage(void * args) {
   const InfoMessage * info = args;
   GtkTextIter iter;
   GtkTextBuffer * buffer;
@@ -185,6 +187,7 @@
                         &iter,
                         info->note,
                         -1);
+  return NULL;
 }
 
 /**
@@ -207,7 +210,7 @@
   g_free(info.note);
 }
 
-static void saveAddLogEntry(void * args) {
+static void * saveAddLogEntry(void * args) {
   static GtkWidget * s = NULL;
   static int once = 1;
   static guint id;
@@ -224,6 +227,7 @@
   gtk_statusbar_push(GTK_STATUSBAR(s),
                     id,
                     (const char*) args);
+  return NULL;
 }
 
 /**
@@ -487,10 +491,10 @@
   return ret;
 }
 
-void run_with_save_calls(PThreadMain cb,
-                        void * arg) {
+void * run_with_save_calls(PThreadMain cb,
+                          void * arg) {
   struct PTHREAD * doneThread;
-  void * unused;
+  void * retval;
   struct rwsc_closure cls;
   int i;
 
@@ -525,8 +529,9 @@
     }
   }
   PTHREAD_JOIN(doneThread,
-              &unused);
+              &retval);
   SEMAPHORE_DESTROY(cls.sig);
+  return retval;
 }
 
 /**
@@ -627,8 +632,7 @@
 */
 void saveMainWindowState(GtkWidget *main_window,
                          GdkEventWindowState *event,
-                         gpointer user_data)
-{
+                         gpointer user_data) {
   main_window_state = (*event).new_window_state;
   return;
 }
@@ -636,14 +640,13 @@
 /**
 * Get the last main window state when restoring (tray icon use)
 */
-GdkWindowState getMainWindowState()
-{
+GdkWindowState getMainWindowState() {
   return main_window_state;
 }
 
 /**
-* Start gnunet-setup, asking for a password if needed
-*/
+ * Start gnunet-setup, asking for a password if needed
+ */
 gboolean startGNUnetSetup (gboolean run_wizard) {
   int code;
   char *error_message;

Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h   2006-10-29 22:40:43 UTC (rev 
3565)
+++ gnunet-gtk/src/include/gnunetgtk_common.h   2006-10-29 23:35:44 UTC (rev 
3566)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     (C) 2005 Christian Grothoff (and other contributing authors)
+     (C) 2005, 2006 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -80,17 +80,12 @@
 void addLogEntry(const char * txt, ...);
        
 /**
- * Simple callback function.
- */
-typedef void (*SimpleCallback)(void *);
-
-/**
  * Call a callback function from the mainloop/main thread ("SaveCall").
  * Since GTK doesn't work with multi-threaded applications under Windows,
  * all GTK operations have to be done in the main thread
  */
-void gtkSaveCall(SimpleCallback func,
-                void * arg);
+void * gtkSaveCall(PThreadMain func,
+                  void * arg);
 
 /**
  * Run the given "cb" function and save calls
@@ -98,8 +93,8 @@
  * keep save calls going while something else
  * happens).
  */
-void run_with_save_calls(PThreadMain cb,
-                        void * arg);
+void * run_with_save_calls(PThreadMain cb,
+                          void * arg);
 
 /**
  * Bind handlers defined by the various

Modified: gnunet-gtk/src/plugins/daemon/daemon.c
===================================================================
--- gnunet-gtk/src/plugins/daemon/daemon.c      2006-10-29 22:40:43 UTC (rev 
3565)
+++ gnunet-gtk/src/plugins/daemon/daemon.c      2006-10-29 23:35:44 UTC (rev 
3566)
@@ -41,7 +41,7 @@
  * cron job that periodically updates the model for the
  * application list.
  */
-static void updateAppModelSafe(void * unused) {
+static void * updateAppModelSafe(void * unused) {
   struct ClientServerConnection * sock;
   GtkWidget * w;
   GtkListStore * model;
@@ -104,6 +104,7 @@
   gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(w)),
                              GTK_SELECTION_NONE);
   connection_destroy(sock);
+  return NULL;
 }
 
 static void updateAppModel(void * dummy) {
@@ -111,7 +112,7 @@
 }
 
 
-static void doUpdateMenus(void * arg) {
+static void * doUpdateMenus(void * arg) {
   int ret = *(int*) arg;
   static GtkWidget * killEntry = NULL;
   static GtkWidget * launchEntry = NULL;
@@ -158,6 +159,7 @@
     gtk_widget_set_sensitive(killEntry, TRUE);
     gtk_widget_set_sensitive(launchEntry, FALSE);
   }
+  return NULL;
 }
 
 static void cronCheckDaemon(void * dummy) {

Modified: gnunet-gtk/src/plugins/fs/fs.c
===================================================================
--- gnunet-gtk/src/plugins/fs/fs.c      2006-10-29 22:40:43 UTC (rev 3565)
+++ gnunet-gtk/src/plugins/fs/fs.c      2006-10-29 23:35:44 UTC (rev 3566)
@@ -50,9 +50,12 @@
 
 GtkTreeStore * upload_summary;
 
-static void * eventProcessor(void * unused,
-                            const FSUI_Event * event) {
-  void * ret = NULL;
+static void *
+saveEventProcessor(void * cls) {
+  const FSUI_Event * event = cls;
+  void * ret;
+
+  ret = NULL;
   switch (event->type) {
     /* search events */
   case FSUI_search_started:
@@ -186,6 +189,12 @@
   return ret;
 }
 
+static void * 
+eventProcessor(void * unused,
+              const FSUI_Event * event) {
+  return gtkSaveCall(&saveEventProcessor,
+                    (void*) event);
+}
 
 /**
  * Setup the summary views (in particular the models

Modified: gnunet-gtk/src/plugins/fs/namespace.c
===================================================================
--- gnunet-gtk/src/plugins/fs/namespace.c       2006-10-29 22:40:43 UTC (rev 
3565)
+++ gnunet-gtk/src/plugins/fs/namespace.c       2006-10-29 23:35:44 UTC (rev 
3566)
@@ -313,7 +313,7 @@
   return OK;
 }
 
-static void clearContentList(void * mdl) {
+static void * clearContentList(void * mdl) {
   GtkTreeModel * model = GTK_TREE_MODEL(mdl);
   struct ECRS_URI * uri;
   struct ECRS_MetaData * meta;
@@ -339,12 +339,13 @@
                                   &iter));
   }
   DEBUG_END();
+  return NULL;
 }
 
 /**
  * Update the list of the globally available content.
  */
-static void doUpdateContentList(void * unused) {
+static void * doUpdateContentList(void * unused) {
   GtkWidget * contentList;
   GtkTreeModel * model;
 
@@ -360,6 +361,7 @@
                    &updateView,
                    model);
   DEBUG_END();
+  return NULL;
 }
 
 static void updateContentList(void * unused) {

Modified: gnunet-gtk/src/plugins/fs/search.c
===================================================================
--- gnunet-gtk/src/plugins/fs/search.c  2006-10-29 22:40:43 UTC (rev 3565)
+++ gnunet-gtk/src/plugins/fs/search.c  2006-10-29 23:35:44 UTC (rev 3566)
@@ -34,237 +34,9 @@
 #include <GNUnet/gnunet_util_crypto.h>
 #include <GNUnet/gnunet_namespace_lib.h>
 
-/**
- * The user has clicked the "SEARCH" button.
- * Initiate a search.
- */
-void on_fssearchbutton_clicked_fs(gpointer dummy2,
-                                 GtkWidget * searchButton) {
-  struct ECRS_URI * uri;
-  const char * searchString;
-  gint pages;
-  gint i;
-  SearchList * list;
-  GtkTreeIter iter;
-  GtkComboBox * searchKeywordGtkCB;
-  GtkWidget * searchNamespaceGtkCB;
-  GtkNotebook * notebook;
+/* **************** FSUI event handling ****************** */
 
-  searchString = getEntryLineValue(getMainXML(),
-                                  "fssearchKeywordComboBoxEntry");
-  if (searchString == NULL) {
-    GE_LOG(ectx,
-          GE_ERROR | GE_USER | GE_IMMEDIATE,
-          _("Need a keyword to search!\n"));
-    return;
-  }
-  /* add the keyword to the list of keywords that have
-     been used so far */
-  searchKeywordGtkCB
-    = GTK_COMBO_BOX(glade_xml_get_widget(getMainXML(),
-                                        "fssearchKeywordComboBoxEntry"));
-  i = gtk_combo_box_get_active(searchKeywordGtkCB);
-  if (i == -1) {
-    GtkListStore * model;
-
-    model = GTK_LIST_STORE(gtk_combo_box_get_model(searchKeywordGtkCB));
-    gtk_list_store_prepend(model,
-                          &iter);
-    gtk_list_store_set(model,
-                      &iter,
-                      0, searchString,
-                      -1);
-  }
-  uri = NULL;
-  /* check for namespace search */
-  searchNamespaceGtkCB
-    = glade_xml_get_widget(getMainXML(),
-                          "searchNamespaceComboBoxEntry");
-  if (TRUE == 
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(searchNamespaceGtkCB),
-                                           &iter)) {
-    const char * descStr;
-    const char * ns;
-
-    ns = NULL;
-    descStr = NULL;
-    
gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(searchNamespaceGtkCB)),
-                      &iter,
-                      NS_SEARCH_DESCRIPTION, &descStr,
-                      NS_SEARCH_ENCNAME, &ns,
-                      -1);
-
-    if ( (descStr != NULL) &&
-        (0 == strcmp(descStr,
-                     _("globally"))) ) {
-      ns = NULL;
-    } else {
-      GE_ASSERT(ectx, strlen(ns) == sizeof(EncName) - 1);
-      if (descStr == NULL)
-       descStr = ns;
-    }
-    if (ns != NULL) {
-      char * ustring;
-
-      ustring = MALLOC(strlen(searchString) + sizeof(EncName) +
-                      strlen(ECRS_URI_PREFIX) +
-                      strlen(ECRS_SUBSPACE_INFIX) + 10);
-      strcpy(ustring, ECRS_URI_PREFIX);
-      strcat(ustring, ECRS_SUBSPACE_INFIX);
-      strcat(ustring, ns);
-      strcat(ustring, "/");
-      strcat(ustring, searchString);
-      uri = ECRS_stringToUri(ectx, ustring);
-      if (uri == NULL) {
-       GE_LOG(ectx,
-              GE_ERROR | GE_BULK | GE_USER,
-              _("Failed to create namespace URI from `%s'.\n"),
-              ustring);
-      }
-      FREE(ustring);
-    }
-  }
-  if (uri == NULL)
-    uri = ECRS_parseCharKeywordURI(ectx, searchString);
-  if (uri == NULL) {
-    GE_BREAK(ectx, 0);
-    return;
-  }
-  /* check if search is already running */
-  notebook
-    = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(),
-                                       "downloadNotebook"));
-  pages = gtk_notebook_get_n_pages(notebook);
-  list = search_head;
-  while (list != NULL) {
-    if (ECRS_equalsUri(list->uri,
-                      uri)) {
-      for (i=0;i<pages;i++) {
-       if (gtk_notebook_get_nth_page(notebook,
-                                     i)
-           == list->searchpage) {
-         gtk_notebook_set_current_page(notebook,
-                                       i);
-         ECRS_freeUri(uri);
-         return;
-       }
-      }
-      GE_BREAK(ectx, 0);
-    }
-    list = list->next;
-  }
-  FSUI_startSearch(ctx,
-                  getSpinButtonValue(getMainXML(),
-                                     "searchAnonymitySelectionSpinButton"),    
-                  getSpinButtonValue(getMainXML(),
-                                     "maxResultsSpinButton"),  
-                  getSpinButtonValue(getMainXML(),
-                                     "searchDelaySpinButton") * cronSECONDS,
-                  uri);
-}
-
 /**
- * This method is called when the user clicks on either
- * the "CLOSE" button (at the bottom of the search page)
- * or on the "CANCEL (X)" button in the TAB of the
- * search notebook.  Note that "searchPage" can thus
- * either refer to the main page in the tab or to the
- * main entry of the tab label.
- */ 
-void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
-                                    GtkWidget * closeButton) {
-  SearchList * list;
-
-  list = search_head;
-  while (list != NULL) {
-    if ( (list->searchpage == searchPage) ||
-        (list->tab_label  == searchPage) )
-      break;
-    list = list->next;
-  }
-  GE_ASSERT(ectx, list != NULL);
-  FSUI_stopSearch(ctx,
-                 list->fsui_list);
-}
-
-/**
- * The abort button was clicked.  Abort the search.
- */
-void on_abortSearchButton_clicked_fs(GtkWidget * searchPage,
-                                    GtkWidget * closeButton) {
-  SearchList * list;
-
-  list = search_head;
-  while (list != NULL) {
-    if (list->searchpage == searchPage)
-      break;
-    list = list->next;
-  }
-  GE_ASSERT(ectx, list != NULL);
-  FSUI_abortSearch(ctx,
-                  list->fsui_list);
-}
-
-static void stopSearch(GtkTreeModel * model,
-                      GtkTreePath * path,
-                      GtkTreeIter * iter,
-                      gpointer unused) {
-  SearchList * s;
-
-  s = NULL;
-  gtk_tree_model_get(model,
-                     iter,
-                    SEARCH_SUMMARY_INTERNAL, &s,
-                     -1);
-  if (s != NULL)
-    FSUI_stopSearch(ctx,
-                   s->fsui_list);
-}
-
-/**
- * The stop button in the search summary was clicked.
- */
-void on_closeSearchSummaryButton_clicked_fs(GtkWidget * treeview,
-                                           GtkWidget * closeButton) {
-  GtkTreeSelection * selection;
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
-  gtk_tree_selection_selected_foreach
-    (selection,
-     &stopSearch,
-     NULL);
-}
-
-static void abortSearch(GtkTreeModel * model,
-                       GtkTreePath * path,
-                       GtkTreeIter * iter,
-                       gpointer unused) {
-  SearchList * s;
-
-  s = NULL;
-  gtk_tree_model_get(model,
-                     iter,
-                    SEARCH_SUMMARY_INTERNAL, &s,
-                     -1);
-  if (s != NULL)
-    FSUI_abortSearch(ctx,
-                    s->fsui_list);
-}
-
-/**
- * The abort button in the search summary was clicked.
- */
-void on_abortSearchSummaryButton_clicked_fs(GtkWidget * treeview,
-                                           GtkWidget * closeButton) {
-  GtkTreeSelection * selection;
-
-  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
-  gtk_tree_selection_selected_foreach
-    (selection,
-     &abortSearch,
-     NULL);
-}
-
-/**
  * Update the number of results received for the given
  * search in the summary and in the label of the tab.
  */
@@ -685,5 +457,239 @@
   FREE(list);
 }
 
+/* ****************** User event handling ************* */
 
+
+/**
+ * The user has clicked the "SEARCH" button.
+ * Initiate a search.
+ */
+void on_fssearchbutton_clicked_fs(gpointer dummy2,
+                                 GtkWidget * searchButton) {
+  struct ECRS_URI * uri;
+  const char * searchString;
+  gint pages;
+  gint i;
+  SearchList * list;
+  GtkTreeIter iter;
+  GtkComboBox * searchKeywordGtkCB;
+  GtkWidget * searchNamespaceGtkCB;
+  GtkNotebook * notebook;
+
+  searchString = getEntryLineValue(getMainXML(),
+                                  "fssearchKeywordComboBoxEntry");
+  if (searchString == NULL) {
+    GE_LOG(ectx,
+          GE_ERROR | GE_USER | GE_IMMEDIATE,
+          _("Need a keyword to search!\n"));
+    return;
+  }
+  /* add the keyword to the list of keywords that have
+     been used so far */
+  searchKeywordGtkCB
+    = GTK_COMBO_BOX(glade_xml_get_widget(getMainXML(),
+                                        "fssearchKeywordComboBoxEntry"));
+  i = gtk_combo_box_get_active(searchKeywordGtkCB);
+  if (i == -1) {
+    GtkListStore * model;
+
+    model = GTK_LIST_STORE(gtk_combo_box_get_model(searchKeywordGtkCB));
+    gtk_list_store_prepend(model,
+                          &iter);
+    gtk_list_store_set(model,
+                      &iter,
+                      0, searchString,
+                      -1);
+  }
+  uri = NULL;
+  /* check for namespace search */
+  searchNamespaceGtkCB
+    = glade_xml_get_widget(getMainXML(),
+                          "searchNamespaceComboBoxEntry");
+  if (TRUE == 
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(searchNamespaceGtkCB),
+                                           &iter)) {
+    const char * descStr;
+    const char * ns;
+
+    ns = NULL;
+    descStr = NULL;
+    
gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(searchNamespaceGtkCB)),
+                      &iter,
+                      NS_SEARCH_DESCRIPTION, &descStr,
+                      NS_SEARCH_ENCNAME, &ns,
+                      -1);
+
+    if ( (descStr != NULL) &&
+        (0 == strcmp(descStr,
+                     _("globally"))) ) {
+      ns = NULL;
+    } else {
+      GE_ASSERT(ectx, strlen(ns) == sizeof(EncName) - 1);
+      if (descStr == NULL)
+       descStr = ns;
+    }
+    if (ns != NULL) {
+      char * ustring;
+
+      ustring = MALLOC(strlen(searchString) + sizeof(EncName) +
+                      strlen(ECRS_URI_PREFIX) +
+                      strlen(ECRS_SUBSPACE_INFIX) + 10);
+      strcpy(ustring, ECRS_URI_PREFIX);
+      strcat(ustring, ECRS_SUBSPACE_INFIX);
+      strcat(ustring, ns);
+      strcat(ustring, "/");
+      strcat(ustring, searchString);
+      uri = ECRS_stringToUri(ectx, ustring);
+      if (uri == NULL) {
+       GE_LOG(ectx,
+              GE_ERROR | GE_BULK | GE_USER,
+              _("Failed to create namespace URI from `%s'.\n"),
+              ustring);
+      }
+      FREE(ustring);
+    }
+  }
+  if (uri == NULL)
+    uri = ECRS_parseCharKeywordURI(ectx, searchString);
+  if (uri == NULL) {
+    GE_BREAK(ectx, 0);
+    return;
+  }
+  /* check if search is already running */
+  notebook
+    = GTK_NOTEBOOK(glade_xml_get_widget(getMainXML(),
+                                       "downloadNotebook"));
+  pages = gtk_notebook_get_n_pages(notebook);
+  list = search_head;
+  while (list != NULL) {
+    if (ECRS_equalsUri(list->uri,
+                      uri)) {
+      for (i=0;i<pages;i++) {
+       if (gtk_notebook_get_nth_page(notebook,
+                                     i)
+           == list->searchpage) {
+         gtk_notebook_set_current_page(notebook,
+                                       i);
+         ECRS_freeUri(uri);
+         return;
+       }
+      }
+      GE_BREAK(ectx, 0);
+    }
+    list = list->next;
+  }
+  FSUI_startSearch(ctx,
+                  getSpinButtonValue(getMainXML(),
+                                     "searchAnonymitySelectionSpinButton"),    
+                  getSpinButtonValue(getMainXML(),
+                                     "maxResultsSpinButton"),  
+                  getSpinButtonValue(getMainXML(),
+                                     "searchDelaySpinButton") * cronSECONDS,
+                  uri);
+}
+
+/**
+ * This method is called when the user clicks on either
+ * the "CLOSE" button (at the bottom of the search page)
+ * or on the "CANCEL (X)" button in the TAB of the
+ * search notebook.  Note that "searchPage" can thus
+ * either refer to the main page in the tab or to the
+ * main entry of the tab label.
+ */ 
+void on_closeSearchButton_clicked_fs(GtkWidget * searchPage,
+                                    GtkWidget * closeButton) {
+  SearchList * list;
+
+  list = search_head;
+  while (list != NULL) {
+    if ( (list->searchpage == searchPage) ||
+        (list->tab_label  == searchPage) )
+      break;
+    list = list->next;
+  }
+  GE_ASSERT(ectx, list != NULL);
+  FSUI_stopSearch(ctx,
+                 list->fsui_list);
+}
+
+/**
+ * The abort button was clicked.  Abort the search.
+ */
+void on_abortSearchButton_clicked_fs(GtkWidget * searchPage,
+                                    GtkWidget * closeButton) {
+  SearchList * list;
+
+  list = search_head;
+  while (list != NULL) {
+    if (list->searchpage == searchPage)
+      break;
+    list = list->next;
+  }
+  GE_ASSERT(ectx, list != NULL);
+  FSUI_abortSearch(ctx,
+                  list->fsui_list);
+}
+
+static void stopSearch(GtkTreeModel * model,
+                      GtkTreePath * path,
+                      GtkTreeIter * iter,
+                      gpointer unused) {
+  SearchList * s;
+
+  s = NULL;
+  gtk_tree_model_get(model,
+                     iter,
+                    SEARCH_SUMMARY_INTERNAL, &s,
+                     -1);
+  if (s != NULL)
+    FSUI_stopSearch(ctx,
+                   s->fsui_list);
+}
+
+/**
+ * The stop button in the search summary was clicked.
+ */
+void on_closeSearchSummaryButton_clicked_fs(GtkWidget * treeview,
+                                           GtkWidget * closeButton) {
+  GtkTreeSelection * selection;
+
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
+  gtk_tree_selection_selected_foreach
+    (selection,
+     &stopSearch,
+     NULL);
+}
+
+static void abortSearch(GtkTreeModel * model,
+                       GtkTreePath * path,
+                       GtkTreeIter * iter,
+                       gpointer unused) {
+  SearchList * s;
+
+  s = NULL;
+  gtk_tree_model_get(model,
+                     iter,
+                    SEARCH_SUMMARY_INTERNAL, &s,
+                     -1);
+  if (s != NULL)
+    FSUI_abortSearch(ctx,
+                    s->fsui_list);
+}
+
+/**
+ * The abort button in the search summary was clicked.
+ */
+void on_abortSearchSummaryButton_clicked_fs(GtkWidget * treeview,
+                                           GtkWidget * closeButton) {
+  GtkTreeSelection * selection;
+
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
+  gtk_tree_selection_selected_foreach
+    (selection,
+     &abortSearch,
+     NULL);
+}
+
+
+
 /* end of search.c */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]