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

Modified Files:
        display_sorttabs.c prefs.c prefs.h 
Log Message:

Move sp_playcount_low/high to new prefs.


Index: display_sorttabs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_sorttabs.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- display_sorttabs.c  5 Jun 2006 06:41:47 -0000       1.73
+++ display_sorttabs.c  5 Jun 2006 07:00:17 -0000       1.74
@@ -562,7 +562,7 @@
        /* Add track to member list */
        st->sp_members = g_list_append (st->sp_members, track);
        /* Check if track is to be passed on to next sort tab */
-       if (st->is_go || prefs_get_sp_autodisplay (inst))
+       if (st->is_go || prefs_get_int_index("sp_autodisplay", inst))
        {   /* Check if track matches sort criteria to be displayed */
            if (sp_check_track (track, inst))
            {
@@ -573,7 +573,7 @@
     }
     if (!track && final)
     {
-       if (st->is_go || prefs_get_sp_autodisplay (inst))
+       if (st->is_go || prefs_get_int_index("sp_autodisplay", inst))
            st_add_track (NULL, final, display, inst+1);
 
     }
@@ -704,9 +704,6 @@
     /* Sanity */
     if (st->current_category != ST_CAT_SPECIAL) return;
 
-    /* check if members are already displayed */
-    /* if (st->is_go || prefs_get_sp_autodisplay (inst))  return; */
-
     /* Make sure the information typed into the entries is actually
      * being used (maybe the user 'forgot' to press enter */
     sp_store_sp_entries (inst);
@@ -815,7 +812,7 @@
 
     /* Only redisplay if data is actually being passed on to the next
        sort tab */
-    if (st->is_go || prefs_get_sp_autodisplay (inst))
+    if (st->is_go || prefs_get_int_index("sp_autodisplay", inst))
     {
        st_redisplay (inst);
     }
@@ -917,7 +914,6 @@
   
     g_free (buf);
     sp_update_date_interval_from_string (inst, item, TRUE);
-/*     if (prefs_get_sp_autodisplay (inst))  sp_go (inst); */
     sp_go (inst);
 }
 
@@ -951,7 +947,7 @@
 
     /* display data if autodisplay is turned on */
     if (state)  on_sp_go_clicked (NULL, user_data);
-    prefs_set_sp_autodisplay(inst, state);
+    prefs_set_int_index("sp_autodisplay", inst, state);
 }
 
 void
@@ -2891,7 +2887,7 @@
                        "toggled", G_CALLBACK (on_sp_go_always_toggled),
                        GINT_TO_POINTER(inst));
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
-                                  prefs_get_sp_autodisplay (inst));
+                                  prefs_get_int_index("sp_autodisplay", inst));
 
       /* Safe pointer to tooltips */
       st->sp_tooltips_data = gtk_tooltips_data_get(gtkpod_xml_get_widget 
(special_xml, "sp_modified_entry"));

Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.198
retrieving revision 1.199
diff -u -d -r1.198 -r1.199
--- prefs.c     5 Jun 2006 06:41:47 -0000       1.198
+++ prefs.c     5 Jun 2006 07:00:18 -0000       1.199
@@ -167,6 +167,7 @@
       prefs_set_string_index("sp_added_state", i, "<1d");
       prefs_set_int_index("sp_playcount_low", i, 0);
       prefs_set_int_index("sp_playcount_high", i, -1);
+      prefs_set_int_index("sp_autodisplay", i, FALSE);
     }
 }
 
@@ -1659,10 +1660,6 @@
     mycfg->md5tracks = TRUE;
     mycfg->block_display = FALSE;
     mycfg->autoimport = FALSE;
-    for (i=0; i<SORT_TAB_MAX; ++i)
-    {
-       mycfg->st[i].sp_autodisplay = FALSE;
-    }
     mycfg->mpl_autoselect = TRUE;
     mycfg->offline = FALSE;
     mycfg->write_extended_info = TRUE;
@@ -1906,11 +1903,6 @@
          {
              prefs_set_autoimport((gboolean)atoi(arg));
          }
-         else if(arg_comp (line, "sp_autodisplay", &off) == 0)
-         {
-             gint i = atoi (line+off);
-             prefs_set_sp_autodisplay (i, atoi (arg));
-         }
          else if(g_ascii_strcasecmp (line, "mpl_autoselect") == 0)
          {
              prefs_set_mpl_autoselect((gboolean)atoi(arg));
@@ -2385,10 +2377,7 @@
     fprintf(fp, _("# delete confirmation\n"));
     fprintf(fp, "autoimport=%d\n",prefs_get_autoimport());
     fprintf(fp, _("# sort tab: select 'All', last selected page 
(=category)\n"));
-    for (i=0; i<SORT_TAB_MAX; ++i)
-    {
-       fprintf(fp, "sp_autodisplay%d=%d\n", i, prefs_get_sp_autodisplay (i));
-    }
+
     fprintf(fp, _("# autoselect master playlist?\n"));
     fprintf(fp, "mpl_autoselect=%d\n", prefs_get_mpl_autoselect ());
     fprintf(fp, _("# title=0, artist, album, genre, composer\n"));
@@ -3319,24 +3308,6 @@
     cfg->info_window = val;
 }
 
-void prefs_set_sp_autodisplay (guint32 inst, gboolean state)
-{
-    if (inst < SORT_TAB_MAX)
-       cfg->st[inst].sp_autodisplay = state;
-    else
-       fprintf (stderr, "prefs_set_sp_autodisplay(): !inst=%d!\n", inst);
-}
-
-
-gboolean prefs_get_sp_autodisplay (guint32 inst)
-{
-    if (inst < SORT_TAB_MAX)
-       return cfg->st[inst].sp_autodisplay;
-    else
-       fprintf (stderr, "prefs_get_sp_autodisplay(): !inst=%d!\n", inst);
-    return FALSE;
-}
-
 gboolean prefs_get_tmp_disable_sort(void)
 {
     return(cfg->tmp_disable_sort);

Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- prefs.h     5 Jun 2006 06:41:47 -0000       1.125
+++ prefs.h     5 Jun 2006 07:00:18 -0000       1.126
@@ -103,11 +103,7 @@
   gboolean autoimport;     /* whether or not to automatically import files */
   gboolean autoimport_commandline;/* whether or not to automatically
                                   * import files as set by commandline */
-  struct
-  {
-    /* the following fields are for the "special" tab */
-    gboolean sp_autodisplay; /* display automatically? */
-  } st[SORT_TAB_MAX];
+  
   struct sortcfg
   {         /* sort type: SORT_ASCENDING, SORT_DESCENDING, SORT_NONE */
     gint pm_sort;            /* sort type for playlists           */
@@ -404,8 +400,6 @@
 void prefs_set_last_prefs_page (gint i);
 gboolean prefs_get_automount (void);
 gboolean prefs_get_info_window (void);
-void prefs_set_sp_autodisplay (guint32 inst, gboolean state);
-gboolean prefs_get_sp_autodisplay (guint32 inst);
 void prefs_set_display_tooltips_main (gboolean state);
 gboolean prefs_get_display_tooltips_main (void);
 void prefs_set_display_tooltips_prefs (gboolean state);



_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to