From 08f19653a06707419930640628d33acd3170aa95 Mon Sep 17 00:00:00 2001
From: Antoine Fontaine <antoine.fontaine@epfl.ch>
Date: Tue, 11 Jun 2019 00:19:50 +0200
Subject: [PATCH] Made it impossible to request a file several time in a row by
 double clicking

---
 src/gui-resource.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gui-resource.c b/src/gui-resource.c
index 0110e90..5d0af39 100644
--- a/src/gui-resource.c
+++ b/src/gui-resource.c
@@ -88,6 +88,10 @@ open_folder_cb (gpointer ptr, gpointer data)
 void
 activated_cb (GtkListBox* unused, GuiResource *self)
 {
+  // no need to save if we were sensitive: if it wasn't the case,
+  // then this function wouldn't be called.
+  gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (self), FALSE);
+
   switch (self->type) {
   case RESOURCE_ASSIGNMENT:
     // just open it in the web browser
@@ -136,6 +140,8 @@ activated_cb (GtkListBox* unused, GuiResource *self)
     //g_warning ("Ressource type %i isn't supported\n", self->type);
     break;
   }
+
+  gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (self), TRUE);
 }
 
 static void
-- 
GitLab