a5d10c26b0320708968ae6ae67e8284b5fbc4dda
[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         "Copyright &copy; 1999-2011, by the Enlightenment Development Team.<br>"
24         "<br>"
25         "We hope you enjoy using this software as much as we enjoyed "
26         "writing it.<br>"
27         "<br>"
28         "This software is provided as-is with no explicit or implied "
29         "warranty. This software is governed by licensing conditions, "
30         "so please see the COPYING and COPYING-PLAIN licence files "
31         "installed on your system.<br>"
32         "<br>"
33         "Enlightenment is under <hilight>HEAVY DEVELOPMENT</hilight> and it "
34         "is not stable. Many features are incomplete or even non-existent "
35         "yet and may have many bugs. You have been <hilight>WARNED!</hilight>"
36         )
37       );
38    
39      {
40         FILE *f;
41         char buf[4096], buf2[4096], *tbuf;
42
43         e_prefix_data_concat_static(buf, "AUTHORS");
44         f = fopen(buf, "r");
45         if (f)
46           {
47              tbuf = strdup(_("<title>The Team</title>"));
48              while (fgets(buf, sizeof(buf), f))
49                {
50                   int len;
51
52                   len = strlen(buf);
53                   if (len > 0)
54                     {  
55                        if (buf[len - 1] == '\n')
56                          {
57                             buf[len - 1] = 0;
58                             len--;
59                          }
60                        if (len > 0)
61                          {
62                             char *p;
63
64                             do
65                               {
66                                  p = strchr(buf, '<');
67                                  if (p) *p = 0;
68                               }
69                             while (p);
70                             do
71                               {
72                                  p = strchr(buf, '>');
73                                  if (p) *p = 0;
74                               }
75                             while (p);
76                             snprintf(buf2, sizeof(buf2), "%s<br>", buf);
77                             tbuf = realloc(tbuf, strlen(tbuf) + strlen(buf2) + 1);
78                             strcat(tbuf, buf2);
79                          }
80                     }
81                }
82              fclose(f);
83              if (tbuf)
84                {
85                   e_obj_dialog_obj_part_text_set
86                     (od, "e.textblock.authors", tbuf);
87                   free(tbuf);
88                }
89           }
90      }
91    return (E_About *)od;
92 }
93
94 EAPI void
95 e_about_show(E_About *about)
96 {
97    e_obj_dialog_show((E_Obj_Dialog *)about);
98    e_obj_dialog_icon_set((E_Obj_Dialog *)about, "help-about");
99 }