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

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

Move tm_col_width to new prefs.


Index: display_songs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_songs.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- display_songs.c     20 May 2006 16:16:07 -0000      1.99
+++ display_songs.c     6 Jun 2006 04:24:13 -0000       1.100
@@ -1979,7 +1979,7 @@
 /*     gtk_tree_view_column_set_clickable(column, TRUE); */
   gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
   gtk_tree_view_column_set_fixed_width (col,
-                                       prefs_get_tm_col_width (tm_item));
+                                       prefs_get_int_index("tm_col_width", 
tm_item));
   gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (model), tm_item,
                                   tm_data_compare_func, NULL, NULL);
   gtk_tree_view_column_set_reorderable (col, TRUE);
@@ -2213,6 +2213,7 @@
 {
     gint i;
     GtkTreeViewColumn *col;
+    gint col_width;
 
     /* column widths */
     for (i=0; i<TM_NUM_COLUMNS; ++i)
@@ -2220,8 +2221,13 @@
        col = tm_columns [i];
        if (col)
        {
-           prefs_set_tm_col_width (i,
-                                   gtk_tree_view_column_get_width (col));
+    col_width = gtk_tree_view_column_get_width (col);
+    
+    if (col_width > 0)
+           prefs_set_int_index ("tm_col_width", i, col_width);
+    else
+      prefs_set_int_index ("tm_col_width", i, 80);
+   
        }
     }
 }

Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- prefs.c     5 Jun 2006 07:00:18 -0000       1.199
+++ prefs.c     6 Jun 2006 04:24:13 -0000       1.200
@@ -169,6 +169,12 @@
       prefs_set_int_index("sp_playcount_high", i, -1);
       prefs_set_int_index("sp_autodisplay", i, FALSE);
     }
+    
+    /* Set colum prefrences */
+    for (i = 0; i < TM_NUM_COLUMNS; i++)
+    {
+      prefs_set_int_index("tm_col_width", i, 80);
+    }
 }
 
 /* Initialize default variable-length list entries */
@@ -802,6 +808,13 @@
       prefs_set_int_index("sp_added_state", i, int_buf);
   }
   
+  /* sm_col_width renamed to tm_col_width */
+  for (i = 0; i < TM_NUM_COLUMNS; i++)
+  {
+    if (prefs_get_int_value_index("sm_col_width", i, &int_buf))
+      prefs_set_int_index("tm_col_width", i, int_buf);
+  }
+  
   prefs_set_string ("version", VERSION);
 }
 
@@ -1679,7 +1692,6 @@
     mycfg->size_info.y = 300;
     for (i=0; i<TM_NUM_COLUMNS; ++i)
     {
-       mycfg->tm_col_width[i] = 80;
        mycfg->col_visible[i] = FALSE;
        mycfg->col_order[i] = i;
     }
@@ -1907,12 +1919,6 @@
          {
              prefs_set_mpl_autoselect((gboolean)atoi(arg));
          }
-         else if((arg_comp (line, "tm_col_width", &off) == 0) ||
-                 (g_ascii_strncasecmp (line, "sm_col_width", 12) == 0))
-         {
-             gint i = atoi (line+off);
-             prefs_set_tm_col_width (i, atoi (arg));
-         }
          else if(arg_comp (line, "tag_autoset", &off) == 0)
          {
              gint i = atoi (line+off);
@@ -2385,7 +2391,6 @@
     fprintf(fp, _("# autoset: set empty tag to filename?\n"));
     for (i=0; i<TM_NUM_COLUMNS; ++i)
     {
-       fprintf(fp, "tm_col_width%d=%d\n", i, prefs_get_tm_col_width (i));
        fprintf(fp, "col_visible%d=%d\n",  i, prefs_get_col_visible (i));
        fprintf(fp, "col_order%d=%d\n",  i, prefs_get_col_order (i));
        if (i < TM_NUM_TAGS_PREFS)
@@ -2653,25 +2658,6 @@
     cfg->mpl_autoselect = autoselect;
 }
 
-/* retrieve the width of the track display columns. "col": one of the
-   TM_COLUMN_... */
-gint prefs_get_tm_col_width (gint col)
-{
-    if (col < TM_NUM_COLUMNS && (cfg->tm_col_width[col] > 0))
-       return cfg->tm_col_width[col];
-    return 80;  /* default -- col should be smaller than
-                  TM_NUM_COLUMNS) */
-}
-
-/* set the width of the track display columns. "col": one of the
-   TM_COLUMN_..., "width": current width */
-void prefs_set_tm_col_width (gint col, gint width)
-{
-    if (col < TM_NUM_COLUMNS && width > 0)
-       cfg->tm_col_width[col] = width;
-}
-
-
 /* Returns "$HOME/.gtkpod" and tries to create it if it does not
    exist. */
 gchar *prefs_get_cfgdir (void)

Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- prefs.h     5 Jun 2006 07:00:18 -0000       1.126
+++ prefs.h     6 Jun 2006 04:24:13 -0000       1.127
@@ -132,7 +132,6 @@
   struct win_size size_dirbr;   /* last size of dirbrowser window */
   struct win_size size_prefs;   /* last size of prefs window */
   struct win_size size_info;    /* last size of info window */
-  gint tm_col_width[TM_NUM_COLUMNS];    /* width colums in track model */
   gboolean col_visible[TM_NUM_COLUMNS]; /* displayed track model colums */
   TM_item col_order[TM_NUM_COLUMNS];    /* order of columns */
   gboolean readtags;            /* Read tags from file contents? */
@@ -346,7 +345,6 @@
 void prefs_set_size_dirbr (gint x, gint y);
 void prefs_set_size_prefs (gint x, gint y);
 void prefs_set_size_info (gint x, gint y);
-void prefs_set_tm_col_width (gint col, gint width);
 void prefs_set_col_visible (TM_item tm_item, gboolean visible);
 void prefs_set_col_order (gint pos, TM_item col);
 void prefs_set_paned_pos (gint i, gint pos);
@@ -372,7 +370,6 @@
 void prefs_get_size_dirbr (gint *x, gint *y);
 void prefs_get_size_prefs (gint *x, gint *y);
 void prefs_get_size_info (gint *x, gint *y);
-gint prefs_get_tm_col_width (gint col);
 gboolean prefs_get_col_visible (TM_item tm_item);
 TM_item prefs_get_col_order (gint pos);
 gboolean prefs_get_md5tracks(void);



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

Reply via email to