update for beta release
[framework/uifw/e17.git] / src / modules / wizard / page_080.c
1 /* Ibar setup */
2 #include "e.h"
3 #include "e_mod_main.h"
4
5 EAPI int
6 wizard_page_init(E_Wizard_Page *pg __UNUSED__)
7 {
8    return 1;
9 }
10
11 EAPI int
12 wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
13 {
14    return 1;
15 }
16
17 EAPI int
18 wizard_page_show(E_Wizard_Page *pg __UNUSED__)
19 {
20    FILE *f, *fin;
21    char buf[PATH_MAX];
22
23    snprintf(buf, sizeof(buf), "%s/def-ibar.txt", e_wizard_dir_get());
24    fin = fopen(buf, "r");
25    if (!fin) return 0;
26    e_user_dir_concat_static(buf, "applications/bar/default");
27    ecore_file_mkpath(buf);
28    e_user_dir_concat_static(buf, "applications/bar/default/.order");
29    f = fopen(buf, "w");
30    if (f)
31      {
32         while (fgets(buf, sizeof(buf), fin))
33           {
34              Efreet_Desktop *desk;
35              char name[PATH_MAX], buf2[PATH_MAX], *p;
36              int n;
37              
38              if (buf[0] == '#') continue;
39              p = buf;
40              while (isspace(*p)) p++;
41              for (;;)
42                {
43                   n = sscanf(p, "%s", name);
44                   if (n != 1) break;
45                   p += strlen(name);
46                   while (isspace(*p)) p++;
47                   snprintf(buf2, sizeof(buf2), "%s.desktop", name);
48                   desk = efreet_util_desktop_file_id_find(buf2);
49                   if (desk)
50                     {
51                        fprintf(f, "%s\n", buf2);
52                        efreet_desktop_free(desk);
53                        break;
54                     }
55                }
56           }
57         fclose(f);
58      }
59    return 0; /* 1 == show ui, and wait for user, 0 == just continue */
60 }
61
62 EAPI int
63 wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
64 {
65    return 1;
66 }
67
68 EAPI int
69 wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
70 {
71    return 1;
72 }