Update of /cvsroot/gtkpod/gtkpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv12622/src
Modified Files:
display.c prefs.c prefs.h
Log Message:
Move size_gtkpod to new prefs
Index: display.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/display.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- display.c 7 Jun 2006 05:03:42 -0000 1.138
+++ display.c 8 Jun 2006 23:15:46 -0000 1.139
@@ -60,7 +60,8 @@
g_return_if_fail (gtkpod_window);
/* x,y-size */
- prefs_get_size_gtkpod (&defx, &defy);
+ defx = prefs_get_int("size_gtkpod.x");
+ defy = prefs_get_int("size_gtkpod.y");
gtk_window_set_default_size (GTK_WINDOW (gtkpod_window), defx, defy);
/* we need to use the following line if the main window is already
displayed */
@@ -430,8 +431,9 @@
/* x,y size of main window */
if (gtkpod_window)
{
- gtk_window_get_size (GTK_WINDOW (gtkpod_window), &x, &y);
- prefs_set_size_gtkpod (x, y);
+ gtk_window_get_size (GTK_WINDOW (gtkpod_window), &x,
&y);
+ prefs_set_int("size_gtkpod.x", x);
+ prefs_set_int("size_gtkpod.y", y);
}
tm_update_default_sizes ();
st_update_default_sizes ();
Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.206
retrieving revision 1.207
diff -u -d -r1.206 -r1.207
--- prefs.c 8 Jun 2006 06:10:46 -0000 1.206
+++ prefs.c 8 Jun 2006 23:15:46 -0000 1.207
@@ -191,12 +191,16 @@
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);
-
- /* Set pane positions--Let gtk worry about position */
- for (i = 0; i < PANED_NUM; i++)
- prefs_set_int_index("paned_pos_", i, -1);
- prefs_set_int("mpl_autoselect", TRUE);
+ /* Set pane positions--Let gtk worry about position */
+ for (i = 0; i < PANED_NUM; i++)
+ prefs_set_int_index("paned_pos_", i, -1);
+
+ prefs_set_int("mpl_autoselect", TRUE);
+
+ /* Set window sizes */
+ prefs_set_int("size_gtkpod.x", 600);
+ prefs_set_int("size_gtkpod.y", 500);
}
/* Initialize default variable-length list entries */
@@ -855,17 +859,20 @@
/* set statusbar paned to a decent value if unset */
if (prefs_get_int_index("paned_pos_", PANED_STATUS1) == -1)
{
- prefs_get_size_gtkpod (&x, &y);
- /* set to about 2/3 of the window width */
- if (x>0) prefs_set_int_index("paned_pos_", PANED_STATUS1, 20*x/30);
+ x = prefs_get_int("size_gtkpod.x");
+ /* set to about 2/3 of the window width */
+ if (x>0)
+ prefs_set_int_index("paned_pos_", PANED_STATUS1,
20*x/30);
}
if (prefs_get_int_index("paned_pos_", PANED_STATUS2) == -1)
{
- prefs_get_size_gtkpod (&x, &y);
- p = prefs_get_int_index("paned_pos_", PANED_STATUS1);
- /* set to about half of the remaining window */
- if (x>0) prefs_set_int_index("paned_pos_", PANED_STATUS2, (x-p)/2 );
+ x = prefs_get_int("size_gtkpod.x");
+ y = prefs_get_int("size_gtkpod.y");
+ p = prefs_get_int_index("paned_pos_", PANED_STATUS1);
+ /* set to about half of the remaining window */
+ if (x>0)
+ prefs_set_int_index("paned_pos_", PANED_STATUS2,
(x-p)/2 );
}
prefs_set_string ("version", VERSION);
@@ -1740,8 +1747,6 @@
mycfg->autoimport = FALSE;
mycfg->offline = FALSE;
mycfg->write_extended_info = TRUE;
- mycfg->size_gtkpod.x = 600;
- mycfg->size_gtkpod.y = 500;
mycfg->size_cal.x = 500;
mycfg->size_cal.y = 350;
mycfg->size_conf_sw.x = 300;
@@ -2094,14 +2099,6 @@
{
/* ignore option -- has been deleted with 0.53 */
}
- else if(g_ascii_strcasecmp (line, "size_gtkpod.x") == 0)
- {
- prefs_set_size_gtkpod (atoi (arg), -2);
- }
- else if(g_ascii_strcasecmp (line, "size_gtkpod.y") == 0)
- {
- prefs_set_size_gtkpod (-2, atoi (arg));
- }
else if(g_ascii_strcasecmp (line, "size_cal.x") == 0)
{
prefs_set_size_cal (atoi (arg), -2);
@@ -2114,14 +2111,6 @@
{
prefs_set_size_conf_sw (atoi (arg), -2);
}
- else if(g_ascii_strcasecmp (line, "size_conf_sw.y") == 0)
- {
- prefs_set_size_conf_sw (-2, atoi (arg));
- }
- else if(g_ascii_strcasecmp (line, "size_conf.x") == 0)
- {
- prefs_set_size_conf (atoi (arg), -2);
- }
else if(g_ascii_strcasecmp (line, "size_conf.y") == 0)
{
prefs_set_size_conf (-2, atoi (arg));
@@ -2389,8 +2378,6 @@
fprintf(fp, "add_recursively=%d\n",prefs_get_add_recursively());
fprintf(fp, "case_sensitive=%d\n",prefs_get_case_sensitive());
fprintf(fp, _("# window sizes: main window, confirmation scrolled,\n#
confirmation non-scrolled, dirbrowser, prefs\n"));
- fprintf (fp, "size_gtkpod.x=%d\n", cfg->size_gtkpod.x);
- fprintf (fp, "size_gtkpod.y=%d\n", cfg->size_gtkpod.y);
fprintf (fp, "size_cal.x=%d\n", cfg->size_cal.x);
fprintf (fp, "size_cal.y=%d\n", cfg->size_cal.y);
fprintf (fp, "size_conf_sw.x=%d\n", cfg->size_conf_sw.x);
@@ -2630,14 +2617,6 @@
return cfgdir;
}
-/* Sets the default size for the gtkpod window. -2 means: don't change
- * the current size */
-void prefs_set_size_gtkpod (gint x, gint y)
-{
- if (x != -2) cfg->size_gtkpod.x = x;
- if (y != -2) cfg->size_gtkpod.y = y;
-}
-
/* Sets the default size for the calendar window. -2 means: don't change
* the current size */
void prefs_set_size_cal (gint x, gint y)
@@ -2688,14 +2667,6 @@
/* Writes the current default size for the gtkpod window in "x" and
"y" */
-void prefs_get_size_gtkpod (gint *x, gint *y)
-{
- *x = cfg->size_gtkpod.x;
- *y = cfg->size_gtkpod.y;
-}
-
-/* Writes the current default size for the gtkpod window in "x" and
- "y" */
void prefs_get_size_cal (gint *x, gint *y)
{
*x = cfg->size_cal.x;
Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- prefs.h 8 Jun 2006 06:10:46 -0000 1.133
+++ prefs.h 8 Jun 2006 23:15:47 -0000 1.134
@@ -124,7 +124,6 @@
{
gboolean track, ipod_file, local_file, database;
} deletion;
- struct win_size size_gtkpod; /* last size of gtkpod main window */
struct win_size size_cal; /* last size of calendar window */
struct win_size size_conf_sw; /* last size of conf window (scrolled) */
struct win_size size_conf; /* last size of conf window */
@@ -329,7 +328,6 @@
const gchar *prefs_get_coverart_template (void);
void prefs_set_charset (gchar *charset);
void prefs_cfg_set_charset (struct cfg *cfg, gchar *charset);
-void prefs_set_size_gtkpod (gint x, gint y);
void prefs_set_size_cal (gint x, gint y);
void prefs_set_size_conf_sw (gint x, gint y);
void prefs_set_size_conf (gint x, gint y);
@@ -350,7 +348,6 @@
gboolean prefs_get_write_extended_info(void);
gboolean prefs_get_autoimport(void);
gchar * prefs_get_charset (void);
-void prefs_get_size_gtkpod (gint *x, gint *y);
void prefs_get_size_cal (gint *x, gint *y);
void prefs_get_size_conf_sw (gint *x, gint *y);
void prefs_get_size_conf (gint *x, gint *y);
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2