Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/wizard


Modified Files:
        e_mod_main.c e_wizard.c 


Log Message:


mo wiz work. has page infra now and can "run" the pages.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/wizard/e_mod_main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_mod_main.c        13 Sep 2007 13:56:36 -0000      1.2
+++ e_mod_main.c        14 Sep 2007 13:58:18 -0000      1.3
@@ -29,15 +29,34 @@
 };
 
 
-static int t_init     (E_Wizard_Page *pg){
+static int t0_init     (E_Wizard_Page *pg){
    return 1;
 }
-static int t_shutdown (E_Wizard_Page *pg){
+static int t0_shutdown (E_Wizard_Page *pg){
    return 1;
 }
-static int t_show     (E_Wizard_Page *pg){
+static int t0_show     (E_Wizard_Page *pg){
+   printf("t0\n");
+   return 0; /* 1 == show ui, and wait for user, 0 == just continue */
+}
+static int t0_hide     (E_Wizard_Page *pg){
+   return 1;
+}
+static int t0_apply    (E_Wizard_Page *pg){
+   printf("a0\n");
+   return 1;
+}
+
+static int t1_init     (E_Wizard_Page *pg){
+   return 1;
+}
+static int t1_shutdown (E_Wizard_Page *pg){
+   return 1;
+}
+static int t1_show     (E_Wizard_Page *pg){
    Evas_Object *ob, *o;
    
+   printf("t1\n");
    ob = e_widget_list_add(pg->evas, 1, 0);
    o = e_widget_button_add(pg->evas,
                            "Hello World", NULL, 
@@ -46,13 +65,14 @@
    evas_object_show(o);
    e_wizard_page_show(ob);
    pg->data = ob;
-   return 0;
+   return 1; /* 1 == show ui, and wait for user, 0 == just continue */
 }
-static int t_hide     (E_Wizard_Page *pg){
+static int t1_hide     (E_Wizard_Page *pg){
    evas_object_del(pg->data);
    return 1;
 }
-static int t_apply    (E_Wizard_Page *pg){
+static int t1_apply    (E_Wizard_Page *pg){
+   printf("a1\n");
    return 1;
 }
 
@@ -65,6 +85,7 @@
 static int t2_show     (E_Wizard_Page *pg){
    Evas_Object *ob, *o;
    
+   printf("t2\n");
    ob = e_widget_list_add(pg->evas, 1, 0);
    o = e_widget_button_add(pg->evas,
                            "Hello to Another World", NULL, 
@@ -73,13 +94,14 @@
    evas_object_show(o);
    e_wizard_page_show(ob);
    pg->data = ob;
-   return 0;
+   return 1;
 }
 static int t2_hide     (E_Wizard_Page *pg){
    evas_object_del(pg->data);
    return 1;
 }
 static int t2_apply    (E_Wizard_Page *pg){
+   printf("a2\n");
    return 1;
 }
 
@@ -90,7 +112,8 @@
    conf_module = m;
    e_wizard_init();
    
-   e_wizard_page_add(t_init, t_shutdown, t_show, t_hide, t_apply);
+   e_wizard_page_add(t0_init, t0_shutdown, t0_show, t0_hide, t0_apply);
+   e_wizard_page_add(t1_init, t1_shutdown, t1_show, t1_hide, t1_apply);
    e_wizard_page_add(t2_init, t2_shutdown, t2_show, t2_hide, t2_apply);
    
    e_wizard_go();
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/wizard/e_wizard.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_wizard.c  13 Sep 2007 13:56:36 -0000      1.4
+++ e_wizard.c  14 Sep 2007 13:58:18 -0000      1.5
@@ -62,6 +62,7 @@
        e_object_del(E_OBJECT(pops->data));
        pops = evas_list_remove_list(pops, pops);
      }
+   /* FIXME: remove wizard module */
    return 1;
 }
 
@@ -74,8 +75,25 @@
      }
    if (curpage)
      {
-       if (!curpage->data) curpage->init(curpage);
-       curpage->show(curpage);
+       if ((!curpage->data) && (curpage->init)) curpage->init(curpage);
+       if ((curpage->show) && (!curpage->show(curpage)))
+         {
+            e_wizard_next();
+         }
+     }
+}
+
+EAPI void
+e_wizard_apply(void)
+{
+   Evas_List *l;
+   
+   for (l = pages; l; l = l->next)
+     {  
+       E_Wizard_Page *pg;
+       
+       pg = l->data;
+       if (pg->apply) pg->apply(pg);
      }
 }
 
@@ -92,14 +110,16 @@
               {
                  if (curpage)
                    {
-                      curpage->hide(curpage);
+                      if (curpage->hide)
+                        curpage->hide(curpage);
                    }
                  curpage = l->next->data;
                  if (!curpage->data)
                    {
-                      curpage->init(curpage);
+                       if (curpage->init)
+                        curpage->init(curpage);
                    }
-                 if (curpage->show(curpage))
+                 if ((curpage->show) && (curpage->show(curpage)))
                    {
                       break;
                    }
@@ -107,7 +127,9 @@
             else
               {
                  /* FINISH */
-                 break;
+                 e_wizard_apply();
+                 e_wizard_shutdown();
+                 return;
               }
          }
      }
@@ -126,14 +148,16 @@
               {
                  if (curpage)
                    {
-                      curpage->hide(curpage);
+                       if (curpage->hide)
+                        curpage->hide(curpage);
                    }
                  curpage = l->prev->data;
                  if (!curpage->data)
                    {
-                      curpage->init(curpage);
+                       if (curpage->init)
+                        curpage->init(curpage);
                    }
-                 if (curpage->show(curpage))
+                  if ((curpage->show) && (curpage->show(curpage)))
                    {
                       break;
                    }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to