update for beta release
[framework/uifw/e17.git] / src / bin / e_about.c
1 #include "e.h"
2
3 /* local subsystem functions */
4
5 /* local subsystem globals */
6
7 /* externally accessible functions */
8
9 EAPI E_About *
10 e_about_new(E_Container *con)
11 {
12    E_Obj_Dialog *od;
13    
14    od = e_obj_dialog_new(con, _("About Enlightenment"), "E", "_about");
15    if (!od) return NULL;
16    e_obj_dialog_obj_theme_set(od, "base/theme/about", "e/widgets/about/main");
17    e_obj_dialog_obj_part_text_set(od, "e.text.label", _("Close"));
18    e_obj_dialog_obj_part_text_set(od, "e.text.title", _("Enlightenment"));
19    e_obj_dialog_obj_part_text_set(od, "e.text.version", VERSION);
20    e_obj_dialog_obj_part_text_set
21      (od, "e.textblock.about",
22       _(
23         "<title>Copyright &copy; 1999-2011, by the Enlightenment "
24         "Development Team</><br>"
25         "<br>"
26         "We hope you enjoy using this software as much as we enjoyed "
27         "writing it.<br>"
28         "<br>"
29         "This software is provided as-is with no explicit or implied "
30         "warranty. This software is governed by licensing conditions, "
31         "so please see the COPYING and COPYING-PLAIN licence files "
32         "installed on your system.<br>"
33         "<br>"
34         "Enlightenment is under <hilight>HEAVY DEVELOPMENT</> and it "
35         "is not stable. Many features are incomplete or even non-existent "
36         "yet and may have many bugs. You have been <hilight>WARNED!</>"
37         )
38       );
39    
40      {
41         FILE *f;
42         char buf[4096], buf2[4096], *tbuf;
43
44         e_prefix_data_concat_static(buf, "AUTHORS");
45         f = fopen(buf, "r");
46         if (f)
47           {
48              tbuf = strdup(_("<title>The Team</><br><br>"));
49              while (fgets(buf, sizeof(buf), f))
50                {
51                   int len;
52
53                   len = strlen(buf);
54                   if (len > 0)
55                     {  
56                        if (buf[len - 1] == '\n')
57                          {
58                             buf[len - 1] = 0;
59                             len--;
60                          }
61                        if (len > 0)
62                          {
63                             char *p;
64
65                             do
66                               {
67                                  p = strchr(buf, '<');
68                                  if (p) *p = 0;
69                               }
70                             while (p);
71                             do
72                               {
73                                  p = strchr(buf, '>');
74                                  if (p) *p = 0;
75                               }
76                             while (p);
77                             snprintf(buf2, sizeof(buf2), "%s<br>", buf);
78                             tbuf = realloc(tbuf, strlen(tbuf) + strlen(buf2) + 1);
79                             strcat(tbuf, buf2);
80                          }
81                     }
82                }
83              fclose(f);
84              if (tbuf)
85                {
86                   e_obj_dialog_obj_part_text_set
87                     (od, "e.textblock.authors", tbuf);
88                   free(tbuf);
89                }
90           }
91      }
92    return (E_About *)od;
93 }
94
95 EAPI void
96 e_about_show(E_About *about)
97 {
98    e_obj_dialog_show((E_Obj_Dialog *)about);
99    e_obj_dialog_icon_set((E_Obj_Dialog *)about, "help-about");
100 }