[easytag/wip/musicbrainz-support-merge: 8/75] Make TreeView multi selectable



commit 01f59e2fe292dbcc6e4f5ab1d208d95d6a15776c
Author: Abhinav <abhijangda hotmail com>
Date:   Thu Aug 7 22:25:28 2014 +0530

    Make TreeView multi selectable
    
    Modified GtkTreeView in EtMbEntityView to select more than one rows.

 src/mb_search.h    |    2 ++
 src/mbentityview.c |   18 +++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/src/mb_search.h b/src/mb_search.h
index f718056..6ba9e7b 100644
--- a/src/mb_search.h
+++ b/src/mb_search.h
@@ -32,6 +32,8 @@
  ****************/
 
 #define NAME_MAX_SIZE 256
+#define SEARCH_LIMIT_INT 2
+#define SEARCH_LIMIT_STR "2"
 
 GCancellable *mb5_search_cancellable;
 
diff --git a/src/mbentityview.c b/src/mbentityview.c
index f532467..c966d90 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -952,10 +952,16 @@ et_mb_entity_view_select_up (EtMbEntityView *entity_view)
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
-    selected_rows = gtk_tree_selection_get_selected_rows (selection, &priv->filter);
+    selected_rows = gtk_tree_selection_get_selected_rows (selection,
+                                                          &priv->filter);
+    if (!selected_rows)
+    {
+        return;
+    }
+
     gtk_tree_model_get_iter (priv->filter, &iter,
                              (g_list_first (selected_rows)->data));
-    if (!gtk_tree_model_iter_next (priv->filter, &iter))
+    if (!gtk_tree_model_iter_previous (priv->filter, &iter))
     {
         goto exit;
     }
@@ -982,7 +988,13 @@ et_mb_entity_view_select_down (EtMbEntityView *entity_view)
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
-    selected_rows = gtk_tree_selection_get_selected_rows (selection, &priv->filter);
+    selected_rows = gtk_tree_selection_get_selected_rows (selection,
+                                                          &priv->filter);
+    if (!selected_rows)
+    {
+        return;
+    }
+
     gtk_tree_model_get_iter (priv->filter, &iter,
                              g_list_last (selected_rows)->data);
     if (!gtk_tree_model_iter_next (priv->filter, &iter))


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