Enlightenment CVS committal

Author  : titan
Project : e17
Module  : proto

Dir     : e17/proto/ephoto/src


Modified Files:
        ephoto_slideshow.c 


Log Message:
More slideshow config tie in.. setting the length now works correctly.

===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_slideshow.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ephoto_slideshow.c  16 Sep 2006 03:36:49 -0000      1.9
+++ ephoto_slideshow.c  18 Sep 2006 01:03:52 -0000      1.10
@@ -120,7 +120,34 @@
  ewl_widget_show(image);
 
  sc->image = image;
- timer = ecore_timer_add(4, change_picture, sc);
+ timer = ecore_timer_add(sc->length, change_picture, sc);
+}
+
+void initial_config()
+{
+ FILE *file;
+ char temp[PATH_MAX];
+ char path[PATH_MAX];
+
+ snprintf(temp, PATH_MAX, "%s/.ephoto", getenv("HOME"));
+ snprintf(path, PATH_MAX, "%s/slideshow_config", temp);
+ if (!ecore_file_exists(temp)) ecore_file_mkdir(temp);
+
+ file = fopen(path, "w");
+ if (file != NULL)
+ {
+  fprintf(file, "Fullscreen=1\n");
+  fprintf(file, "Custom=0\n");
+  fprintf(file, "Width=640\n");
+  fprintf(file, "Height=480\n");
+  fprintf(file, "Random=0\n");
+  fprintf(file, "Loop=0\n");
+  fprintf(file, "Zoom=1\n");
+  fprintf(file, "Aspect=0\n");
+  fprintf(file, "Length=3\n");
+  fprintf(file, "FileName=0\n");
+  fclose(file);
+ }
 }
 
 Slide_Config *parse_slideshow_config()
@@ -134,7 +161,7 @@
  sc = calloc(1, sizeof(Slide_Config));
  snprintf(path, PATH_MAX, "%s/.ephoto/slideshow_config", getenv("HOME"));
 
- if (!ecore_file_exists(path)) return;
+ if (!ecore_file_exists(path)) initial_config();
  
  file = fopen(path, "r");
 
@@ -235,40 +262,13 @@
          ewl_checkbutton_is_checked(EWL_CHECKBUTTON(sc->zoom_image)));
   fprintf(file, "Aspect=%d\n",
          ewl_checkbutton_is_checked(EWL_CHECKBUTTON(sc->aspect_image)));
-  fprintf(file, "Length=%d\n", ewl_range_value_get(EWL_RANGE(sc->spinner)));
+  fprintf(file, "Length=%d\n", 
(int)ewl_range_value_get(EWL_RANGE(sc->spinner)));
   fprintf(file, "FileName=%d\n", 
          ewl_checkbutton_is_checked(EWL_CHECKBUTTON(sc->show_name)));
   fclose(file);
  }
  ewl_widget_destroy(sc->win);
 }
-
-void initial_config(Ewl_Widget *w, void *event, void *data)
-{
- FILE *file;
- char temp[PATH_MAX];
- char path[PATH_MAX];
-
- snprintf(temp, PATH_MAX, "%s/.ephoto", getenv("HOME"));
- snprintf(path, PATH_MAX, "%s/slideshow_config", temp);
- if (!ecore_file_exists(temp)) ecore_file_mkdir(temp);
-
- file = fopen(path, "w");
- if (file != NULL)
- {
-  fprintf(file, "Fullscreen=1\n");
-  fprintf(file, "Custom=0\n");
-  fprintf(file, "Width=640\n");
-  fprintf(file, "Height=480\n");
-  fprintf(file, "Random=0\n");
-  fprintf(file, "Loop=0\n");
-  fprintf(file, "Zoom=1\n");
-  fprintf(file, "Aspect=0\n");
-  fprintf(file, "Length=3\n");
-  fprintf(file, "FileName=0\n");
-  fclose(file);
- }
-}
  
 void create_slideshow_config(Ewl_Widget *w, void *event, void *data)
 {
@@ -419,10 +419,10 @@
  
  sc->spinner = ewl_spinner_new();
  ewl_spinner_digits_set(EWL_SPINNER(sc->spinner), 0);
+ ewl_range_minimum_value_set(EWL_RANGE(sc->spinner), 1);
+ ewl_range_maximum_value_set(EWL_RANGE(sc->spinner), 1000);
  ewl_range_value_set(EWL_RANGE(sc->spinner), sc->length);
  ewl_range_step_set(EWL_RANGE(sc->spinner), 1);
- ewl_range_minimum_value_set(EWL_RANGE(sc->spinner), 1.0);
- ewl_range_maximum_value_set(EWL_RANGE(sc->spinner), 1000);
  ewl_container_child_append(EWL_CONTAINER(border), sc->spinner);
  ewl_object_alignment_set(EWL_OBJECT(sc->spinner), EWL_FLAG_ALIGN_CENTER);
  ewl_object_maximum_size_set(EWL_OBJECT(sc->spinner), 70, 25);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to