2011-08-15 02:21:12 -07:00
|
|
|
/* Ibar setup */
|
2012-11-30 06:38:34 -08:00
|
|
|
#include "e_wizard.h"
|
2009-01-05 18:10:45 -08:00
|
|
|
|
|
|
|
EAPI int
|
2012-11-26 04:40:31 -08:00
|
|
|
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops, Eina_Bool *need_xdg_icons __UNUSED__)
|
2009-01-05 18:10:45 -08:00
|
|
|
{
|
2012-11-26 04:40:31 -08:00
|
|
|
*need_xdg_desktops = EINA_TRUE;
|
2009-01-05 18:10:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
2012-11-30 02:46:48 -08:00
|
|
|
/*
|
2009-01-05 18:10:45 -08:00
|
|
|
EAPI int
|
2010-08-19 09:52:09 -07:00
|
|
|
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
|
2009-01-05 18:10:45 -08:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
2012-11-30 02:46:48 -08:00
|
|
|
*/
|
2009-01-05 18:10:45 -08:00
|
|
|
EAPI int
|
2010-08-19 09:52:09 -07:00
|
|
|
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
|
2009-01-05 18:10:45 -08:00
|
|
|
{
|
2011-08-15 02:21:12 -07:00
|
|
|
FILE *f, *fin;
|
2009-01-05 18:10:45 -08:00
|
|
|
char buf[PATH_MAX];
|
2009-04-13 07:56:38 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/def-ibar.txt", e_wizard_dir_get());
|
|
|
|
fin = fopen(buf, "r");
|
|
|
|
if (!fin) return 0;
|
2009-04-13 07:56:38 -07:00
|
|
|
e_user_dir_concat_static(buf, "applications/bar/default");
|
2009-01-05 18:10:45 -08:00
|
|
|
ecore_file_mkpath(buf);
|
2009-04-13 07:56:38 -07:00
|
|
|
e_user_dir_concat_static(buf, "applications/bar/default/.order");
|
2009-01-05 18:10:45 -08:00
|
|
|
f = fopen(buf, "w");
|
|
|
|
if (f)
|
|
|
|
{
|
2011-08-15 02:21:12 -07:00
|
|
|
while (fgets(buf, sizeof(buf), fin))
|
2009-01-05 18:10:45 -08:00
|
|
|
{
|
2011-08-15 02:21:12 -07:00
|
|
|
Efreet_Desktop *desk;
|
2012-08-22 00:32:12 -07:00
|
|
|
char name[4096], buf2[PATH_MAX], *p;
|
2011-08-15 02:21:12 -07:00
|
|
|
int n;
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
if (buf[0] == '#') continue;
|
|
|
|
p = buf;
|
2012-06-28 06:12:13 -07:00
|
|
|
while (isspace(*p))
|
|
|
|
p++;
|
|
|
|
for (;; )
|
2009-01-05 18:10:45 -08:00
|
|
|
{
|
2011-08-15 02:21:12 -07:00
|
|
|
n = sscanf(p, "%s", name);
|
|
|
|
if (n != 1) break;
|
|
|
|
p += strlen(name);
|
2012-06-28 06:12:13 -07:00
|
|
|
while (isspace(*p))
|
|
|
|
p++;
|
2011-08-15 02:21:12 -07:00
|
|
|
snprintf(buf2, sizeof(buf2), "%s.desktop", name);
|
|
|
|
desk = efreet_util_desktop_file_id_find(buf2);
|
|
|
|
if (desk)
|
|
|
|
{
|
|
|
|
fprintf(f, "%s\n", buf2);
|
|
|
|
efreet_desktop_free(desk);
|
|
|
|
break;
|
|
|
|
}
|
2009-01-05 18:10:45 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(f);
|
|
|
|
}
|
2012-07-28 07:29:26 -07:00
|
|
|
fclose(fin);
|
2011-08-15 02:21:12 -07:00
|
|
|
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
|
|
|
|
}
|
2012-11-30 02:46:48 -08:00
|
|
|
/*
|
2011-08-15 02:21:12 -07:00
|
|
|
EAPI int
|
|
|
|
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
|
|
|
|
{
|
2009-01-05 18:10:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
2012-11-30 02:46:48 -08:00
|
|
|
*/
|