Tizen 2.1 release
[platform/core/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-2012, 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];
43       Eina_Strbuf *tbuf;
44
45       e_prefix_data_concat_static(buf, "AUTHORS");
46       f = fopen(buf, "r");
47       if (f)
48         {
49            tbuf = eina_strbuf_new();
50            eina_strbuf_append(tbuf, _("<title>The Team</><br><br>"));
51            while (fgets(buf, sizeof(buf), f))
52              {
53                 int len;
54
55                 len = strlen(buf);
56                 if (len > 0)
57                   {
58                      if (buf[len - 1] == '\n')
59                        {
60                           buf[len - 1] = 0;
61                           len--;
62                        }
63                      if (len > 0)
64                        {
65                           char *p;
66
67                           do
68                             {
69                                p = strchr(buf, '<');
70                                if (p) *p = 0;
71                             }
72                           while (p);
73                           do
74                             {
75                                p = strchr(buf, '>');
76                                if (p) *p = 0;
77                             }
78                           while (p);
79                           eina_strbuf_append_printf(tbuf, "%s<br>", buf);
80                        }
81                   }
82              }
83            fclose(f);
84            if (tbuf)
85              {
86                 e_obj_dialog_obj_part_text_set(od, "e.textblock.authors",
87                                                eina_strbuf_string_get(tbuf));
88                 eina_strbuf_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 }
101