Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv11395/src
Modified Files:
display_songs.c prefs.c prefs.h prefs_window.c
Log Message:
Move tm_col_visible to new prefs.
Index: display_songs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display_songs.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- display_songs.c 6 Jun 2006 04:24:13 -0000 1.100
+++ display_songs.c 6 Jun 2006 07:55:25 -0000 1.101
@@ -1989,7 +1989,7 @@
if (pos != -1)
{
gtk_tree_view_column_set_visible (col,
- prefs_get_col_visible (tm_item));
+ prefs_get_int_index("col_visible",
tm_item));
}
if (get_tm_tooltip (tm_item))
gtk_tooltips_set_tip (tt, col->button,
@@ -2200,7 +2200,7 @@
for (i=0; i<TM_NUM_COLUMNS; ++i)
{
tvc = gtk_tree_view_get_column (track_treeview, i);
- visible = prefs_get_col_visible (prefs_get_col_order (i));
+ visible = prefs_get_int_index("col_visible", prefs_get_col_order (i));
gtk_tree_view_column_set_visible (tvc, visible);
}
}
Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -d -r1.200 -r1.201
--- prefs.c 6 Jun 2006 04:24:13 -0000 1.200
+++ prefs.c 6 Jun 2006 07:55:26 -0000 1.201
@@ -174,7 +174,15 @@
for (i = 0; i < TM_NUM_COLUMNS; i++)
{
prefs_set_int_index("tm_col_width", i, 80);
+ prefs_set_int_index("col_visible", i, FALSE);
}
+
+ prefs_set_int_index("col_visible", TM_COLUMN_ARTIST, TRUE);
+ prefs_set_int_index("col_visible", TM_COLUMN_ALBUM, TRUE);
+ prefs_set_int_index("col_visible", TM_COLUMN_TITLE, TRUE);
+ prefs_set_int_index("col_visible", TM_COLUMN_GENRE, TRUE);
+ prefs_set_int_index("col_visible", TM_COLUMN_PLAYCOUNT, TRUE);
+ prefs_set_int_index("col_visible", TM_COLUMN_RATING, TRUE);
}
/* Initialize default variable-length list entries */
@@ -1692,15 +1700,8 @@
mycfg->size_info.y = 300;
for (i=0; i<TM_NUM_COLUMNS; ++i)
{
- mycfg->col_visible[i] = FALSE;
mycfg->col_order[i] = i;
}
- mycfg->col_visible[TM_COLUMN_ARTIST] = TRUE;
- mycfg->col_visible[TM_COLUMN_ALBUM] = TRUE;
- mycfg->col_visible[TM_COLUMN_TITLE] = TRUE;
- mycfg->col_visible[TM_COLUMN_GENRE] = TRUE;
- mycfg->col_visible[TM_COLUMN_PLAYCOUNT] = TRUE;
- mycfg->col_visible[TM_COLUMN_RATING] = TRUE;
for (i=0; i<TM_NUM_TAGS_PREFS; ++i)
{
mycfg->autosettags[i] = FALSE;
@@ -1948,11 +1949,6 @@
{
prefs_set_coverart_template(strdup(arg));
}
- else if(arg_comp (line, "col_visible", &off) == 0)
- {
- gint i = atoi (line+off);
- prefs_set_col_visible (i, atoi (arg));
- }
else if(arg_comp (line, "col_order", &off) == 0)
{
gint i = atoi (line+off);
@@ -2391,7 +2387,6 @@
fprintf(fp, _("# autoset: set empty tag to filename?\n"));
for (i=0; i<TM_NUM_COLUMNS; ++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)
fprintf(fp, "tag_autoset%d=%d\n", i, prefs_get_autosettags (i));
@@ -2885,22 +2880,6 @@
}
}
-/* Display column tm_item @visible: new value */
-void prefs_set_col_visible (TM_item tm_item, gboolean visible)
-{
- if (tm_item < TM_NUM_COLUMNS)
- cfg->col_visible[tm_item] = visible;
-}
-
-
-/* Display column tm_item? */
-gboolean prefs_get_col_visible (TM_item tm_item)
-{
- if (tm_item < TM_NUM_COLUMNS)
- return cfg->col_visible[tm_item];
- return FALSE;
-}
-
/* Display which column at nr @pos? */
void prefs_set_col_order (gint pos, TM_item tm_item)
{
Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -d -r1.127 -r1.128
--- prefs.h 6 Jun 2006 04:24:13 -0000 1.127
+++ prefs.h 6 Jun 2006 07:55:26 -0000 1.128
@@ -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 */
- 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? */
gboolean parsetags; /* Get tags by parsing filename? */
@@ -345,7 +344,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_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);
void prefs_set_statusbar_timeout (guint32 val);
@@ -370,7 +368,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);
-gboolean prefs_get_col_visible (TM_item tm_item);
TM_item prefs_get_col_order (gint pos);
gboolean prefs_get_md5tracks(void);
gboolean prefs_get_block_display(void);
Index: prefs_window.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs_window.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -d -r1.129 -r1.130
--- prefs_window.c 1 Jun 2006 06:46:56 -0000 1.129
+++ prefs_window.c 6 Jun 2006 07:55:26 -0000 1.130
@@ -598,7 +598,7 @@
gtk_button_set_label (GTK_BUTTON (w),
gettext (get_tm_string (i)));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w),
- tmpcfg->col_visible[i]);
+ prefs_get_int_index("col_visible", i));
/* set tooltip if available */
if (get_tm_tooltip (i))
{
@@ -714,10 +714,6 @@
prefs_set_parsetags_template(tmpcfg->parsetags_template);
prefs_set_coverart(tmpcfg->coverart);
prefs_set_coverart_template(tmpcfg->coverart_template);
- for (i=0; i<TM_NUM_COLUMNS; ++i)
- {
- prefs_set_col_visible (i, tmpcfg->col_visible[i]);
- }
prefs_set_mpl_autoselect (tmpcfg->mpl_autoselect);
prefs_set_write_extended_info(tmpcfg->write_extended_info);
@@ -1206,7 +1202,7 @@
void prefs_window_set_col_visible (gint column, gboolean visible)
{
if (column < TM_NUM_COLUMNS)
- tmpcfg->col_visible[column] = visible;
+ temp_prefs_set_int_index(temp_prefs, "col_visible", column,
visible);
}
void
@@ -1619,7 +1615,7 @@
TM_item col = prefs_get_col_order (i);
if (col != -1)
{
- if (prefs_get_col_visible (col))
+ if (prefs_get_int_index("col_visible", col))
collist = g_list_append (collist,
gettext (get_tm_string (col)));
}
@@ -1629,7 +1625,7 @@
TM_item col = prefs_get_col_order (i);
if (col != -1)
{
- if (!prefs_get_col_visible (col))
+ if (!prefs_get_int_index("col_visible", col))
collist = g_list_append (collist,
gettext (get_tm_string (col)));
}
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2