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

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

Move size_prefs to new prefs


Index: prefs.c
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -d -r1.210 -r1.211
--- prefs.c     9 Jun 2006 01:22:29 -0000       1.210
+++ prefs.c     9 Jun 2006 01:45:01 -0000       1.211
@@ -209,6 +209,8 @@
        prefs_set_int("size_conf.y", -1);
        prefs_set_int("size_dirbr.x", 300);
        prefs_set_int("size_dirbr.y", 400);
+  prefs_set_int("size_prefs.x", -1);
+  prefs_set_int("size_prefs.y", 480);
 }
 
 /* Initialize default variable-length list entries */
@@ -1755,8 +1757,6 @@
     mycfg->autoimport = FALSE;
     mycfg->offline = FALSE;
     mycfg->write_extended_info = TRUE;
-    mycfg->size_prefs.x = -1;
-    mycfg->size_prefs.y = 480;
     mycfg->size_info.x = 510;
     mycfg->size_info.y = 300;
     mycfg->readtags = TRUE;
@@ -2099,14 +2099,6 @@
          {
              /* ignore option -- has been deleted with 0.53 */
          }
-         else if(g_ascii_strcasecmp (line, "size_prefs.x") == 0)
-         {
-             prefs_set_size_prefs (atoi (arg), -2);
-         }
-         else if(g_ascii_strcasecmp (line, "size_prefs.y") == 0)
-         {
-             prefs_set_size_prefs (-2, atoi (arg));
-         }
          else if(g_ascii_strcasecmp (line, "size_info.x") == 0)
          {
              /* changed layout of info window between 0.72 and 0.73 */
@@ -2354,8 +2346,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_prefs.x=%d\n", cfg->size_prefs.x);
-    fprintf (fp, "size_prefs.y=%d\n", cfg->size_prefs.y);
     fprintf (fp, "size_info.x=%d\n", cfg->size_info.x);
     fprintf (fp, "size_info.y=%d\n", cfg->size_info.y);
     fprintf (fp, "automount=%d\n", cfg->automount);
@@ -2585,14 +2575,6 @@
   return cfgdir;
 }
 
-/* Sets the default size for the prefs window. -2 means:
- * don't change the current size */
-void prefs_set_size_prefs (gint x, gint y)
-{
-    if (x != -2) cfg->size_prefs.x = x;
-    if (y != -2) cfg->size_prefs.y = y;
-}
-
 /* Sets the default size for the info window. -2 means:
  * don't change the current size */
 void prefs_set_size_info (gint x, gint y)
@@ -2603,14 +2585,6 @@
 
 /* Writes the current default size for the info window in
    "x" and "y" */
-void prefs_get_size_prefs (gint *x, gint *y)
-{
-    *x = cfg->size_prefs.x;
-    *y = cfg->size_prefs.y;
-}
-
-/* Writes the current default size for the info window in
-   "x" and "y" */
 void prefs_get_size_info (gint *x, gint *y)
 {
     *x = cfg->size_info.x;

Index: prefs.h
===================================================================
RCS file: /cvsroot/gtkpod/gtkpod/src/prefs.h,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- prefs.h     9 Jun 2006 01:22:29 -0000       1.137
+++ prefs.h     9 Jun 2006 01:45:01 -0000       1.138
@@ -124,7 +124,6 @@
   {
       gboolean track, ipod_file, local_file, database;
   } deletion;
-  struct win_size size_prefs;   /* last size of prefs window */
   struct win_size size_info;    /* last size of info window */
   gboolean readtags;            /* Read tags from file contents? */
   gboolean parsetags;           /* Get tags by parsing filename? */
@@ -324,7 +323,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_prefs (gint x, gint y);
 void prefs_set_size_info (gint x, gint y);
 void prefs_set_statusbar_timeout (guint32 val);
 void prefs_set_automount(gboolean val);
@@ -340,7 +338,6 @@
 gboolean prefs_get_write_extended_info(void);
 gboolean prefs_get_autoimport(void);
 gchar * prefs_get_charset (void);
-void prefs_get_size_prefs (gint *x, gint *y);
 void prefs_get_size_info (gint *x, gint *y);
 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.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- prefs_window.c      8 Jun 2006 06:10:46 -0000       1.135
+++ prefs_window.c      9 Jun 2006 01:45:01 -0000       1.136
@@ -334,7 +334,8 @@
     tt = tooltipsdata->tooltips;
     g_return_if_fail (tt);
 
-    prefs_get_size_prefs (&defx, &defy);
+    defx = prefs_get_int("size_prefs.x");
+    defy = prefs_get_int("size_prefs.y");
     gtk_window_set_default_size (GTK_WINDOW (prefs_window), defx, defy);
 
     /* Code to add subscriptions list box */
@@ -754,7 +755,8 @@
     {
        gint defx, defy;
        gtk_window_get_size (GTK_WINDOW (prefs_window), &defx, &defy);
-       prefs_set_size_prefs (defx, defy);
+       prefs_set_int("size_prefs.x", defx);
+  prefs_set_int("size_prefs.y", defy);
     }
 }
 
@@ -815,7 +817,8 @@
 
     /* save current window size */
     gtk_window_get_size (GTK_WINDOW (prefs_window), &defx, &defy);
-    prefs_set_size_prefs (defx, defy);
+         prefs_set_int("size_prefs.x", defx);
+    prefs_set_int("size_prefs.y", defy);
 
     /* close the window */
     if(prefs_window)
@@ -851,7 +854,8 @@
 
     /* save current window size */
     gtk_window_get_size (GTK_WINDOW (prefs_window), &defx, &defy);
-    prefs_set_size_prefs (defx, defy);
+    prefs_set_int("size_prefs.x", defx);
+    prefs_set_int("size_prefs.y", defy);
 
     /* close the window */
     if(prefs_window)
@@ -887,7 +891,8 @@
 
     /* save current window size */
     gtk_window_get_size (GTK_WINDOW (prefs_window), &defx, &defy);
-    prefs_set_size_prefs (defx, defy);
+    prefs_set_int("size_prefs.x", defx);
+    prefs_set_int("size_prefs.y", defy);
 }
 
 



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

Reply via email to