Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7697/src

Modified Files:
        display.c display.h display_playlists.c display_private.h 
        display_sorttabs.c display_tracks.c misc.c misc.h misc_track.c 
        prefs.c prefs_window.c 
Log Message:
Clicking on an item with the right mouse button will select and open
the context menu, which is the intended behavior. As a consequence,
the interface will remain blocked while the selection is being updated
and displayed.




Index: display.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- display.c   24 Feb 2007 06:24:10 -0000      1.152
+++ display.c   18 Mar 2007 14:27:18 -0000      1.153
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-24 15:18:00 jcs>
+/* Time-stamp: <2007-03-18 23:17:19 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -48,9 +48,6 @@
 
 GtkWidget *gtkpod_window = NULL;
 
-/* used for stopping of display refresh */
-gint stop_add = SORT_TAB_MAX;
-
 /* Create the listviews etc */
 void display_create (void)
 {
@@ -504,253 +501,10 @@
 
 /* ------------------------------------------------------------
 
-           Functions for stopping display update
+           Functions for treeview autoscroll (during DND)
 
    ------------------------------------------------------------ */
 
-enum {
-    BR_BLOCK,
-    BR_RELEASE,
-    BR_ADD,
-    BR_CALL,
-};
-
-
-#if DEBUG_CB_INIT
-static gchar *act_to_str (gint action)
-{
-    switch (action)
-    {
-    case BR_BLOCK: return ("BLOCK");
-    case BR_RELEASE: return ("RELEASE");
-    case BR_ADD: return ("ADD");
-    case BR_CALL: return ("CALL");
-    }
-    return "\"\"";
-}
-#endif
-
-/* called by block_selection() and release_selection */
-static void block_release_selection (gint inst, gint action,
-                                    br_callback brc,
-                                    gpointer user_data1,
-                                    gpointer user_data2)
-{
-    static gint count_st[SORT_TAB_MAX];
-    static gint count_pl = 0;
-    static GtkWidget *stop_button = NULL;
-    /* instance that has a pending callback */
-    static gint level = SORT_TAB_MAX; /* no level -> no registered callback */
-    static br_callback r_brc;
-    static gpointer r_user_data1;
-    static gpointer r_user_data2;
-    static guint timeout_id = 0;
-    gint i;
-
-#if DEBUG_CB_INIT
-    printf ("block_release_selection: inst: %d, action: %s, callback: %p\n  
user1: %p, user2: %d\n", inst, act_to_str (action), brc, user_data1, 
(guint)user_data2);
-    printf ("  enter: level: %d, count_pl: %d, cst0: %d, cst1: %d\n",
-           level, count_pl, count_st[0], count_st[1]);
-#endif
-
-    /* lookup stop_button */
-    if (stop_button == NULL)
-    {
-       stop_button = gtkpod_xml_get_widget (main_window_xml, "stop_button");
-       if (stop_button == NULL)
-           g_warning ("Programming error: stop_button not found\n");
-    }
-
-    switch (action)
-    {
-    case BR_BLOCK:
-       if (count_pl == 0)
-       {
-           block_widgets ();
-           if (stop_button) gtk_widget_show (stop_button);
-       }
-       ++count_pl;
-       for (i=0; (i<=inst) && (i<SORT_TAB_MAX); ++i)
-       {
-           ++count_st[i];
-       }
-       break;
-    case BR_RELEASE:
-       for (i=0; (i<=inst) && (i<SORT_TAB_MAX); ++i)
-       {
-           --count_st[i];
-           if ((count_st[i] == 0) && (stop_add == i))
-               stop_add = SORT_TAB_MAX;
-       }
-       --count_pl;
-       if (count_pl == 0)
-       {
-           if (stop_button) gtk_widget_hide (stop_button);
-           stop_add = SORT_TAB_MAX;
-           release_widgets ();
-       }
-       /* check if we have to call a callback */
-       if (level < SORT_TAB_MAX)
-       {
-           /* don't call it directly -- let's first return to the
-              calling function */
-/*         if (timeout_id == 0) */
-/*         { */
-/*             timeout_id =  */
-/*                 gtk_idle_add_priority (G_PRIORITY_HIGH_IDLE, */
-/*                                        selection_callback_timeout, */
-/*                                        NULL); */
-/*         } */
-           /* remove timeout function just to be sure */
-           if (timeout_id)
-           {
-               gtk_timeout_remove (timeout_id);
-               timeout_id = 0;
-           }
-           if (((level == -1) && (count_pl == 0)) ||
-               ((level >= 0) && (count_st[level] == 0)))
-           {
-               level = SORT_TAB_MAX;
-               r_brc (r_user_data1, r_user_data2);
-           }
-       }
-       break;
-    case BR_ADD:
-/*     printf("adding: inst: %d, level: %d, brc: %p, data1: %p, data2: %p\n",
-       inst, level, brc, user_data1, user_data2);*/
-       if (((inst == -1) && (count_pl == 0)) ||
-           ((inst >= 0) && (count_st[inst] == 0)))
-       { /* OK, we could just call the desired function because there
-           is nothing to be stopped. However, due to a bug or a
-            inevitability of gtk+, if we interrupt the selection
-           process with a gtk_main_iteration() call the button
-           release event will be "discarded". Therefore we register
-           the call here and have it activated with a timeout
-           function. */
-           /* We overwrite an older callback of the same level or
-            * higher  */
-           if (inst <= level)
-           {
-               level = inst;
-               r_brc = brc;
-               r_user_data1 = user_data1;
-               r_user_data2 = user_data2;
-               if (timeout_id == 0)
-               {
-                   timeout_id =
-                       gtk_idle_add_priority (G_PRIORITY_HIGH_IDLE,
-                                              selection_callback_timeout,
-                                              NULL);
-               }
-           }
-       }
-       else
-       {
-           if (inst <= level)
-           {   /* Once the functions have stopped, down to the
-               specified level/instance, the desired function is
-               called (about 15 lines up: r_brc (...)) */
-               /* We need to emit a stop_add signal */
-               stop_add = inst;
-               /* and safe the callback data */
-               level = inst;
-               r_brc = brc;
-               r_user_data1 = user_data1;
-               r_user_data2 = user_data2;
-               /* don't let a timeout snatch away this callback
-                * before all functions have stopped */
-               if (timeout_id)
-               {
-                   gtk_timeout_remove (timeout_id);
-                   timeout_id = 0;
-               }
-           }
-       }
-       break;
-    case BR_CALL:
-       if (timeout_id)
-       {
-           gtk_timeout_remove (timeout_id);
-           timeout_id = 0;
-       }
-       if (level == SORT_TAB_MAX) break;  /* hmm... what happened to
-                                             our callback? */
-       if (((level == -1) && (count_pl == 0)) ||
-           ((level >= 0) && (count_st[level] == 0)))
-       { /* Let's call the callback function */
-               level = SORT_TAB_MAX;
-               r_brc (r_user_data1, r_user_data2);
-       }
-       else
-       { /* This is strange and should not happen -- let's forget
-          * about the callback */
-           level = SORT_TAB_MAX;
-       }
-       break;
-    default:
-       g_warning ("Programming error: unknown BR_...: %d\n", action);
-       break;
-    }
-#if DEBUG_CB_INIT
-    printf ("   exit: level: %d, count_pl: %d, cst0: %d, cst1: %d\n",
-           level, count_pl, count_st[0], count_st[1]);
-#endif
-}
-
-/* Will block the possibility to select another playlist / sort tab
-   page / tab entry. Will also block the widgets and activate the
-   "stop button" that can be pressed to stop the update
-   process. "inst" is the sort tab instance up to which the selections
-   should be blocked. "-1" corresponds to the playlist view */
-void block_selection (gint inst)
-{
-    block_release_selection (inst, BR_BLOCK, NULL, NULL, NULL);
-}
-
-/* Makes selection possible again */
-void release_selection (gint inst)
-{
-    block_release_selection (inst, BR_RELEASE, NULL, NULL, NULL);
-}
-
-
-/* Stops the display updates down to instance "inst". "-1" is the
- * playlist view */
-void display_stop_update (gint inst)
-{
-    stop_add = inst;
-}
-
-/* registers @brc to be called as soon as all functions down to
-   instance @inst have been stopped */
-void add_selection_callback (gint inst, br_callback brc,
-                                   gpointer user_data1, gpointer user_data2)
-{
-    block_release_selection (inst, BR_ADD, brc, user_data1, user_data2);
-}
-
-/* Called as a high priority timeout to initiate the callback of @brc
-   in the last function */
-gboolean selection_callback_timeout (gpointer data)
-{
-    block_release_selection (0, BR_CALL, NULL, NULL, NULL);
-    return FALSE;
-}
-
-
-
-/* Put all treeviews into the unsorted state (@enable=FALSE) or back
-   to the sorted state (@enable=TRUE) */
-/* Indicates that we begin adding playlists from iTunesDB.
-   This is a good time to stop sorting display. */
-void display_enable_disable_view_sort (gboolean enable)
-{
-    st_enable_disable_view_sort (0, enable);
-/*    tm_enable_disable_view_sort (enable);*/
-}
-
-
-
 static void _remove_scroll_row_timeout (GtkWidget *widget)
 {
     g_return_if_fail (widget);
@@ -1247,13 +1001,6 @@
 
 
 void
-on_stop_button_clicked                 (GtkButton       *button,
-                                       gpointer         user_data)
-{
-    display_stop_update (-1);
-}
-
-void
 on_update_playlist_activate (GtkMenuItem     *menuitem,
                             gpointer         user_data)
 {

Index: display.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.h,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- display.h   20 Feb 2007 14:11:23 -0000      1.120
+++ display.h   18 Mar 2007 14:27:18 -0000      1.121
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 23:05:44 jcs>
+/* Time-stamp: <2007-03-18 22:42:37 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -88,12 +88,6 @@
 /* max. number of stars */
 #define RATING_MAX 5
 
-/* time between display refreshs in ms */
-#define REFRESH_MS 200
-/* initial count number between display refreshs -- will be
-   re-calculated to match the time interval specified above */
-#define REFRESH_INIT_COUNT 5
-
 /* struct for each entry in sort tab */
 typedef struct {
   gchar *name;
@@ -289,7 +283,6 @@
 void display_reset (gint inst);
 GList *display_get_selection (guint32 inst);
 GList *display_get_selected_members (gint inst);
-void display_enable_disable_view_sort (gboolean enable);
 void display_remove_autoscroll_row_timeout (GtkWidget *widget);
 void display_install_autoscroll_row_timeout (GtkWidget *widget);
 
@@ -351,7 +344,6 @@
 void display_set_default_sizes (void);
 void display_show_hide_tooltips (void);
 void display_set_info_window_menu (void);
-void display_stop_update (gint inst);
 
 void spl_edit (Playlist *spl);
 void spl_edit_new (iTunesDB *itdb, gchar *name, gint32 pos);

Index: display_playlists.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_playlists.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- display_playlists.c 27 Feb 2007 22:42:44 -0000      1.98
+++ display_playlists.c 18 Mar 2007 14:27:18 -0000      1.99
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 23:05:44 jcs>
+/* Time-stamp: <2007-03-18 23:04:55 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -1322,9 +1322,9 @@
 }
 
 
-static void pm_selection_changed_cb (gpointer user_data1, gpointer user_data2)
+static void pm_selection_changed_cb (GtkTreeSelection *selection,
+                                    gpointer user_data2)
 {
-  GtkTreeSelection *selection = (GtkTreeSelection *)user_data1;
   GtkTreeModel *model;
   GtkTreeIter  iter;
   Playlist *new_playlist = NULL;
@@ -1371,56 +1371,27 @@
          itdb_spl_update (new_playlist);
       if (new_playlist->members)
       {
-         GTimeVal time;
-         float max_count = REFRESH_INIT_COUNT;
-         gint count = max_count - 1;
-         float ms;
          GList *gl;
 
-         if (!prefs_get_int("block_display"))
-         {
-             block_selection (-1);
-             g_get_current_time (&time);
-         }
          st_enable_disable_view_sort (0, FALSE);
          for (gl=new_playlist->members; gl; gl=gl->next)
          { /* add all tracks to sort tab 0 */
              Track *track = gl->data;
-             if (stop_add == -1)  break;
              st_add_track (track, FALSE, TRUE, 0);
-             --count;
-             if ((count < 0) && !prefs_get_int("block_display"))
-             {
-                 gtkpod_tracks_statusbar_update();
-                 while (gtk_events_pending ())       gtk_main_iteration ();
-                 ms = get_ms_since (&time, TRUE);
-                 /* first time takes significantly longer, so we adjust
-                    the max_count */
-                 if (max_count == REFRESH_INIT_COUNT) max_count *= 2.5;
-                 /* average the new and the old max_count */
-                 max_count *= (1 + 2 * REFRESH_MS / ms) / 3;
-                 count = max_count - 1;
-#if DEBUG_TIMING
-                 printf("pm_s_c ms: %f mc: %f\n", ms, max_count);
-#endif
-             }
          }
          st_enable_disable_view_sort (0, TRUE);
-         if (stop_add != -1) st_add_track (NULL, TRUE, TRUE, 0);
-         if (!prefs_get_int("block_display"))
-         {
-             while (gtk_events_pending ())           gtk_main_iteration ();
-             release_selection (-1);
-         }
+         st_add_track (NULL, TRUE, TRUE, 0);
       }
       gtkpod_tracks_statusbar_update();
   }
   
   /* Reallow the coverart selection update */
-        coverart_block_change (FALSE);
+  coverart_block_change (FALSE);
         
   /* Set the coverart display based on the selected playlist */
   coverart_set_images ();
+
+  space_data_update ();
     
 #if DEBUG_TIMING
   g_get_current_time (&time);
@@ -1433,16 +1404,11 @@
 
 /* Callback function called when the selection
    of the playlist view has changed */
-/* Instead of handling the selection directly, we add a
-   "callback". Currently running display updates will be stopped
-   before the pm_selection_changed_cb is actually called */
 static void pm_selection_changed (GtkTreeSelection *selection,
                                  gpointer user_data)
 {
-    space_data_update ();
     if (!pm_selection_blocked)
-       add_selection_callback (-1, pm_selection_changed_cb,
-                               (gpointer)selection, user_data);
+       pm_selection_changed_cb (selection, user_data);
 }
 
 

Index: display_private.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_private.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- display_private.h   20 Feb 2007 14:11:24 -0000      1.25
+++ display_private.h   18 Mar 2007 14:27:18 -0000      1.26
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 23:05:44 jcs>
+/* Time-stamp: <2007-03-18 23:04:55 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -56,14 +56,6 @@
 /* print info when adding tracks */
 #define DEBUG_ADD_TRACK 0
 
-/* used for stopping of display refresh */
-typedef void (*br_callback)(gpointer user_data1, gpointer user_data2);
-void block_selection (gint inst);
-void release_selection (gint inst);
-void add_selection_callback (gint inst, br_callback brc, gpointer user_data1, 
gpointer user_data2);
-gboolean selection_callback_timeout (gpointer data);
-extern gint stop_add;
-
 /* used for display organization */
 void pm_create_treeview (void);
 void pm_set_selected_playlist(Playlist *pl);

Index: display_sorttabs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_sorttabs.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- display_sorttabs.c  20 Feb 2007 14:11:24 -0000      1.88
+++ display_sorttabs.c  18 Mar 2007 14:27:18 -0000      1.89
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 23:05:44 jcs>
+/* Time-stamp: <2007-03-18 23:14:37 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -618,52 +618,20 @@
 
     if (st->sp_members)
     {
-       GTimeVal time;
-       float max_count = REFRESH_INIT_COUNT;
-       gint count = max_count - 1;
-       float ms;
        GList *gl;
 
-       if (!prefs_get_int("block_display"))
-       {
-           block_selection (inst);
-           g_get_current_time (&time);
-       }
        st_enable_disable_view_sort (inst+1, FALSE);
        for (gl=st->sp_members; gl; gl=gl->next)
        { /* add all member tracks to next instance */
            Track *track = (Track *)gl->data;
-           if (stop_add <= (gint)inst) break;
            if (sp_check_track (track, inst))
            {
                st->sp_selected = g_list_append (st->sp_selected, track);
                st_add_track (track, FALSE, TRUE, inst+1);
            }
-           --count;
-           if ((count < 0) && !prefs_get_int("block_display"))
-           {
-               gtkpod_tracks_statusbar_update();
-               while (gtk_events_pending ())       gtk_main_iteration ();
-               ms = get_ms_since (&time, TRUE);
-               /* first time takes significantly longer, so we adjust
-                  the max_count */
-               if (max_count == REFRESH_INIT_COUNT) max_count *= 2.5;
-               /* average the new and the old max_count */
-               max_count *= (1 + 2 * REFRESH_MS / ms) / 3;
-               count = max_count - 1;
-#if DEBUG_TIMING
-               printf("st_s_c ms: %f mc: %f\n", ms, max_count);
-#endif
-           }
        }
        st_enable_disable_view_sort (inst+1, TRUE);
-       if (stop_add > (gint)inst)
-           st_add_track (NULL, TRUE, st->final, inst+1);
-       if (!prefs_get_int("block_display"))
-       {
-           while (gtk_events_pending ())         gtk_main_iteration ();
-           release_selection (inst);
-       }
+       st_add_track (NULL, TRUE, st->final, inst+1);
     }
     gtkpod_tracks_statusbar_update();
 #if DEBUG_TIMING
@@ -716,11 +684,7 @@
      * being used (maybe the user 'forgot' to press enter */
     sp_store_sp_entries (inst);
 
-    /* Instead of handling the selection directly, we add a
-       "callback". Currently running display updates will be stopped
-       before the sp_go_cb is actually called */
-    add_selection_callback (inst, sp_go_cb,
-                           GUINT_TO_POINTER(inst), NULL);
+    sp_go_cb (GUINT_TO_POINTER(inst), NULL);
 }
 
 
@@ -1881,7 +1845,6 @@
 /*  printf("ps%d: cat: %d\n", inst, page);*/
 
   if (inst == -1) return; /* invalid notebook */
-  if (stop_add < (gint)inst)  return;
   st = sorttab[inst];
   /* remember old is_go state and current page */
   is_go = st->is_go;
@@ -1894,55 +1857,21 @@
   copy = display_get_selected_members (inst-1);
   if (copy)
   {
-      GTimeVal time;
-      float max_count = REFRESH_INIT_COUNT;
-      gint count = max_count - 1;
-      float ms;
       GList *gl;
-      /* block playlist view and all sort tab notebooks <= inst */
-      if (!prefs_get_int("block_display"))
-      {
-         block_selection (inst-1);
-         g_get_current_time (&time);
-      }
+      gboolean final;
       /* add all tracks previously present to sort tab */
       st_enable_disable_view_sort (inst, FALSE);
       for (gl=copy; gl; gl=gl->next)
       {
          Track *track = gl->data;
-         if (stop_add < (gint)inst)  break;
          st_add_track (track, FALSE, TRUE, inst);
-         --count;
-         if ((count < 0) && !prefs_get_int("block_display"))
-         {
-             gtkpod_tracks_statusbar_update();
-             while (gtk_events_pending ())       gtk_main_iteration ();
-             ms = get_ms_since (&time, TRUE);
-             /* first time takes significantly longer, so we adjust
-                the max_count */
-             if (max_count == REFRESH_INIT_COUNT) max_count *= 2.5;
-             /* average the new and the old max_count */
-             max_count *= (1 + 2 * REFRESH_MS / ms) / 3;
-             count = max_count - 1;
-#if DEBUG_TIMING
-             printf("st_p_s ms: %f mc: %f\n", ms, max_count);
-#endif
-         }
       }
       st_enable_disable_view_sort (inst, TRUE);
-      if (stop_add >= (gint)inst)
-      {
-         gboolean final = TRUE;  /* playlist is always complete */
-         /* if playlist is not source, get final flag from
-          * corresponding sorttab */
-         if ((inst > 0) && (sorttab[inst-1])) final = sorttab[inst-1]->final;
-         st_add_track (NULL, final, TRUE, inst);
-      }
-      if (!prefs_get_int("block_display"))
-      {
-         while (gtk_events_pending ())      gtk_main_iteration ();
-         release_selection (inst-1);
-      }
+      final = TRUE;  /* playlist is always complete */
+      /* if playlist is not source, get final flag from
+       * corresponding sorttab */
+      if ((inst > 0) && (sorttab[inst-1])) final = sorttab[inst-1]->final;
+      st_add_track (NULL, final, TRUE, inst);
   }
 #if DEBUG_TIMING
   g_get_current_time (&time);
@@ -1954,9 +1883,6 @@
 
 
 /* Called when page in sort tab is selected */
-/* Instead of handling the selection directly, we add a
-   "callback". Currently running display updates will be stopped
-   before the st_page_selected_cb is actually called */
 void st_page_selected (GtkNotebook *notebook, guint page)
 {
   guint32 inst;
@@ -1969,8 +1895,7 @@
   /* inst-1: changing a page in the first sort tab is like selecting a
      new playlist and so on. Therefore we subtract 1 from the
      instance. */
-  add_selection_callback (inst-1, st_page_selected_cb,
-                         (gpointer)notebook, GUINT_TO_POINTER(page));
+  st_page_selected_cb (notebook, GUINT_TO_POINTER(page));
 }
 
 
@@ -2164,48 +2089,16 @@
 
       if (new_entry->members)
       {
-         GTimeVal time;
-         float max_count = REFRESH_INIT_COUNT;
-         gint count = max_count - 1;
-         float ms;
          GList *gl;
-         if (!prefs_get_int("block_display"))
-         {
-             block_selection (inst);
-             g_get_current_time (&time);
-         }
          st_enable_disable_view_sort (inst+1, FALSE);
                  
          for (gl=new_entry->members; gl; gl=gl->next)
          { /* add all member tracks to next instance */
              Track *track = gl->data;
-             if (stop_add <= (gint)inst) break;
              st_add_track (track, FALSE, TRUE, inst+1);
-             --count;
-             if ((count < 0) && !prefs_get_int("block_display"))
-             {
-                 gtkpod_tracks_statusbar_update();
-                 while (gtk_events_pending ())       gtk_main_iteration ();
-                 ms = get_ms_since (&time, TRUE);
-                 /* first time takes significantly longer, so we adjust
-                    the max_count */
-                 if (max_count == REFRESH_INIT_COUNT) max_count *= 2.5;
-                 /* average the new and the old max_count */
-                 max_count *= (1 + 2 * REFRESH_MS / ms) / 3;
-                 count = max_count - 1;
-#if DEBUG_TIMING
-                 printf("st_s_c ms: %f mc: %f\n", ms, max_count);
-#endif
-             }
          }
          st_enable_disable_view_sort (inst+1, TRUE);
-         if (stop_add > (gint)inst)
-             st_add_track (NULL, TRUE, st->final, inst+1);
-         if (!prefs_get_int("block_display"))
-         {
-             while (gtk_events_pending ())       gtk_main_iteration ();
-             release_selection (inst);
-         }
+         st_add_track (NULL, TRUE, st->final, inst+1);
       }
       gtkpod_tracks_statusbar_update();
       
@@ -2218,7 +2111,9 @@
                                coverart_select_cover (track);
       }
   }
-  
+
+  space_data_update ();
+
 #if DEBUG_TIMING
   g_get_current_time (&time);
   printf ("st_selection_changed_cb exit:  %ld.%06ld sec\n",
@@ -2238,9 +2133,7 @@
 #if DEBUG_CB_INIT
     printf("st_s_c enter (inst: %d)\n", (gint)user_data);
 #endif
-    space_data_update ();
-    add_selection_callback ((gint)GPOINTER_TO_INT(user_data), 
st_selection_changed_cb,
-                           (gpointer)selection, user_data);
+    st_selection_changed_cb ((gpointer)selection, user_data);
 #if DEBUG_CB_INIT
     printf("st_s_c exit (inst: %d)\n", (gint)user_data);
 #endif
@@ -2524,8 +2417,7 @@
        if (disable_count[inst] == 0)
        {
            /* Re-enable sorting */
-           if ((prefs_get_int("st_sort") != SORT_NONE) &&
-               sorting_disabled ())
+           if (prefs_get_int("st_sort") != SORT_NONE)
            {
                SortTab *st = sorttab[inst];
                if (st && 
@@ -2556,8 +2448,7 @@
        if (disable_count[inst] == 0)
        {
            /* Disable sorting */
-           if ((prefs_get_int("st_sort") != SORT_NONE) &&
-               sorting_disabled ())
+           if (prefs_get_int("st_sort") != SORT_NONE)
            {
                SortTab *st = sorttab[inst];
                if (st && 

Index: display_tracks.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_tracks.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- display_tracks.c    20 Feb 2007 14:11:24 -0000      1.118
+++ display_tracks.c    18 Mar 2007 14:27:18 -0000      1.119
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-20 23:05:44 jcs>
+/* Time-stamp: <2007-03-18 21:34:22 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -2337,8 +2337,7 @@
            fprintf (stderr, "Programming error: disable_count < 0\n");
        if (disable_count == 0 && track_treeview)
        {
-           if ((prefs_get_int("tm_sort") != SORT_NONE) &&
-               sorting_disabled())
+           if (prefs_get_int("tm_sort") != SORT_NONE)
            {
                /* Re-enable sorting */
                GtkTreeModel *model = gtk_tree_view_get_model (track_treeview);
@@ -2363,8 +2362,7 @@
     {
        if (disable_count == 0 && track_treeview)
        {
-           if ((prefs_get_int("tm_sort") != SORT_NONE) &&
-               sorting_disabled ())
+           if (prefs_get_int("tm_sort") != SORT_NONE)
            {
                /* Disable sorting */
                GtkTreeModel *model = gtk_tree_view_get_model (track_treeview);

Index: misc.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/misc.c,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -d -r1.215 -r1.216
--- misc.c      16 Jan 2007 14:08:55 -0000      1.215
+++ misc.c      18 Mar 2007 14:27:18 -0000      1.216
@@ -1,5 +1,5 @@
 /* -*- coding: utf-8; -*-
-|  Time-stamp: <2007-01-16 22:58:57 jcs>
+|  Time-stamp: <2007-03-18 21:34:22 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -1560,14 +1560,6 @@
     g_free (key);
 }
 
-/* Sorting gets disabled if either tmp disable sort or
- * block display are true */
-gboolean sorting_disabled()
-{
-    return (prefs_get_int("block_display") || 
-           prefs_get_int("tmp_disable_sort"));
-}
-
 /* retrieve offline mode from itdb (convenience function) */
 gboolean get_offline (iTunesDB *itdb)
 {

Index: misc.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/misc.h,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- misc.h      16 Jan 2007 14:08:55 -0000      1.121
+++ misc.h      18 Mar 2007 14:27:19 -0000      1.122
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-01-16 17:50:43 jcs>
+/* Time-stamp: <2007-03-18 21:34:23 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -253,7 +253,6 @@
 void set_itdb_index_prefs_int (gint index,
                               const gchar *subkey, gint value);
 gboolean get_offline (iTunesDB *itdb);
-gboolean sorting_disabled();
 
 guint32 guiToDB(gint gui);
 gint dbToGUI(guint32 db);

Index: misc_track.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/misc_track.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- misc_track.c        24 Feb 2007 05:48:33 -0000      1.58
+++ misc_track.c        18 Mar 2007 14:27:19 -0000      1.59
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-24 14:33:56 jcs>
+/* Time-stamp: <2007-03-18 21:43:39 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -337,7 +337,7 @@
  */
 void gp_itdb_hash (iTunesDB *itdb)
 {
-   gint ns, count, track_nr;
+   gint ns, track_nr;
    Track *track, *oldtrack;
 
    g_return_if_fail (itdb);
@@ -351,22 +351,12 @@
    block_widgets (); /* block widgets -- this might take a while,
                        so we'll do refreshs */
    sha1_free (itdb);  /* release md5 hash */
-   count = 0;
    track_nr = 0;
    /* populate the hash table */
    while ((track = g_list_nth_data (itdb->tracks, track_nr)))
    {
        oldtrack = sha1_track_exists_insert (itdb, track);
-       ++count;
 /*        printf("%d:%d:%p:%p\n", count, track_nr, track, oldtrack); */
-       if (!prefs_get_int("block_display") &&
-          (((count % 20) == 1) || (count == ns)))
-       { /* update for count == 1, 21, 41 ... and for count == n */
-          gtkpod_statusbar_message (ngettext ("Hashed %d of %d track.",
-                                              "Hashed %d of %d tracks.", ns),
-                                    count, ns);
-          while (widgets_blocked && gtk_events_pending ())  gtk_main_iteration 
();
-       }
        if (oldtrack)
        {
           gp_duplicate_remove (oldtrack, track);

Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.277
retrieving revision 1.278
diff -u -d -r1.277 -r1.278
--- prefs.c     24 Feb 2007 06:24:10 -0000      1.277
+++ prefs.c     18 Mar 2007 14:27:19 -0000      1.278
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-24 15:22:28 jcs>
+/* Time-stamp: <2007-03-18 21:34:21 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Copyright (C) 2006 James Liggett <jrliggett at cox.net>
@@ -260,7 +260,6 @@
     prefs_set_int("add_recursively", TRUE);
     prefs_set_int("info_window", FALSE);
     prefs_set_int("last_prefs_page", 0);
-    prefs_set_int("tmp_disable_sort", TRUE);
     prefs_set_int("multi_edit_title", TRUE);
     prefs_set_int("multi_edit", FALSE);
     prefs_set_int("not_played_track", TRUE);
@@ -270,7 +269,6 @@
     prefs_set_int("display_tooltips_prefs", TRUE);
     prefs_set_int("display_toolbar", TRUE);
     prefs_set_int("toolbar_style", GTK_TOOLBAR_BOTH);
-    prefs_set_int("block_display", FALSE);
     prefs_set_int("md5", TRUE);
     prefs_set_string("export_template", "%o;%a - %t.mp3;%t.wav");
     prefs_set_int("file_dialog_details_expanded", FALSE);
@@ -896,7 +894,8 @@
     prefs_set_string("write_gaintag", NULL);
     prefs_set_string("automount", NULL);
     prefs_set_string("display_artcovers", NULL);
-
+    prefs_set_string("block_display", NULL);
+    prefs_set_string("tmp_disable_sort", NULL);
 
     /* sp_created_cond renamed to sp_added_cond */
     for (i = 0; i < SORT_TAB_MAX; i++)

Index: prefs_window.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs_window.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- prefs_window.c      11 Mar 2007 18:22:34 -0000      1.193
+++ prefs_window.c      18 Mar 2007 14:27:19 -0000      1.194
@@ -1,4 +1,4 @@
-/* Time-stamp: <2007-02-24 15:17:58 jcs>
+/* Time-stamp: <2007-03-18 21:45:41 jcs>
 |
 |  Copyright (C) 2002 Corey Donohoe <atmos at atmos.org>
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
@@ -476,10 +476,6 @@
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                 prefs_get_int("update_charset"));
 
-    w = gtkpod_xml_get_widget (prefs_window_xml, "cfg_block_display");
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
-                                prefs_get_int("block_display"));
-
     w = gtkpod_xml_get_widget (prefs_window_xml, "cfg_id3_write");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                 prefs_get_int("id3_write"));
@@ -694,10 +690,6 @@
                                     prefs_get_int("group_compilations"));
     }
 
-    w = gtkpod_xml_get_widget (prefs_window_xml, "cfg_tmp_disable_sort");
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
-                                prefs_get_int("tmp_disable_sort"));
-
     w = gtkpod_xml_get_widget (prefs_window_xml, "cfg_startup_messages");
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
                                 prefs_get_int("startup_messages"));
@@ -1029,14 +1021,6 @@
 }
 
 void
- on_cfg_block_display_toggled           (GtkToggleButton *togglebutton,
-                                       gpointer         user_data)
-{
-    temp_prefs_set_int(temp_prefs, "block_display",
-                      gtk_toggle_button_get_active(togglebutton));
-}
-
-void
 on_cfg_update_existing_toggled         (GtkToggleButton *togglebutton,
                                        gpointer         user_data)
 {
@@ -1495,13 +1479,6 @@
 }
 
 void
-on_cfg_temporarily_disable_sorting     (GtkToggleButton *togglebutton,
-                                        gpointer         user_data)
-{
-    temp_prefs_set_int(temp_prefs, "tmp_disable_sort",
-                      gtk_toggle_button_get_active(togglebutton));
-}
-void
 on_cfg_startup_messages                (GtkToggleButton *togglebutton,
                                         gpointer         user_data)
 {


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to