huge wizard commit:

* disable all dummy wizard callbacks in pages
* shutdown callbacks in pages are now actually called
* pages are no longer shown repeatedly by xdg wait callback
* first page no longer accidentally the whole second page
* scaling initially set to 1.2 so the text is actually readable
* page states added so we have some idea where the hell the pages are at
ticket #1883


SVN revision: 79879
This commit is contained in:
Mike Blumenkrantz 2012-11-30 10:46:48 +00:00
parent 6502761657
commit 4e500e5767
24 changed files with 131 additions and 91 deletions

View File

@ -53,6 +53,10 @@ e_modapi_init(E_Module *m)
wiz_module = m;
e_wizard_init();
e_config->scale.use_dpi = 0;
e_config->scale.use_custom = 1;
e_config->scale.factor = 1.2;
e_scale_update();
snprintf(buf, sizeof(buf), "%s/%s", e_module_dir_get(m), MODULE_ARCH);
files = ecore_file_ls(buf);
files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files);

View File

@ -101,13 +101,17 @@ e_wizard_go(void)
if (curpage)
{
if (curpage->init) curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
curpage->state++;
_e_wizard_next_eval();
if (_e_wizard_check_xdg())
{
if ((curpage->show) && (!curpage->show(curpage)))
{
curpage->state++;
e_wizard_next();
}
else
curpage->state++;
}
}
}
@ -116,14 +120,10 @@ EAPI void
e_wizard_apply(void)
{
Eina_List *l;
E_Wizard_Page *pg;
for (l = pages; l; l = l->next)
{
E_Wizard_Page *pg;
pg = l->data;
if (pg->apply) pg->apply(pg);
}
EINA_LIST_FOREACH(pages, l, pg)
if (pg->apply) pg->apply(pg);
}
EAPI void
@ -142,18 +142,25 @@ e_wizard_next(void)
{
if (curpage->hide)
curpage->hide(curpage);
curpage->state++;
}
curpage = eina_list_data_get(eina_list_next(l));
e_wizard_button_next_enable_set(1);
need_xdg_desktops = EINA_FALSE;
need_xdg_icons = EINA_FALSE;
if (curpage->init)
curpage->init(curpage, &need_xdg_desktops, &need_xdg_icons);
curpage->state++;
if (!_e_wizard_check_xdg())
break;
_e_wizard_next_eval();
if ((curpage->show) && (curpage->show(curpage)))
break;
{
curpage->state++;
break;
}
curpage->state++;
}
else
{
@ -219,6 +226,7 @@ e_wizard_page_del(E_Wizard_Page *pg)
// ther page seq.. we cant REALLY dlclose... not a problem as wizard runs
// once only then e restarts itself with final wizard page
// if (pg->handle) dlclose(pg->handle);
if (pg->shutdown) pg->shutdown(pg);
pages = eina_list_remove(pages, pg);
free(pg);
}
@ -391,7 +399,7 @@ _e_wizard_check_xdg(void)
{
/* Advance within 15 secs if no xdg event */
if (!next_timer)
next_timer = ecore_timer_add(15.0, _e_wizard_cb_next_page, NULL);
next_timer = ecore_timer_add(7.0, _e_wizard_cb_next_page, NULL);
next_can = 0;
_e_wizard_next_eval();
return 0;
@ -400,7 +408,7 @@ _e_wizard_check_xdg(void)
{
/* Advance within 15 secs if no xdg event */
if (!next_timer)
next_timer = ecore_timer_add(15.0, _e_wizard_cb_next_page, NULL);
next_timer = ecore_timer_add(7.0, _e_wizard_cb_next_page, NULL);
next_can = 0;
_e_wizard_next_eval();
return 0;
@ -419,8 +427,18 @@ _e_wizard_next_xdg(void)
if (next_timer) ecore_timer_del(next_timer);
next_timer = NULL;
if ((curpage->show) && (!curpage->show(curpage)))
e_wizard_next();
if (curpage->state != E_WIZARD_PAGE_STATE_SHOW)
{
if (next_ok) return; // waiting for user
e_wizard_next();
}
else if ((curpage->show) && (!curpage->show(curpage)))
{
curpage->state++;
e_wizard_next();
}
else
curpage->state++;
}
static Eina_Bool

View File

@ -6,6 +6,14 @@ typedef struct _E_Wizard_Page E_Wizard_Page;
#ifndef E_WIZARD_H
#define E_WIZARD_H
typedef enum
{
E_WIZARD_PAGE_STATE_INIT,
E_WIZARD_PAGE_STATE_SHOW,
E_WIZARD_PAGE_STATE_HIDE,
E_WIZARD_PAGE_STATE_SHUTDOWN
} E_Wizard_Page_State;
struct _E_Wizard_Page
{
void *handle;
@ -15,6 +23,7 @@ struct _E_Wizard_Page
int (*show) (E_Wizard_Page *pg);
int (*hide) (E_Wizard_Page *pg);
int (*apply) (E_Wizard_Page *pg);
E_Wizard_Page_State state;
};
EAPI int e_wizard_init(void);

View File

@ -5,6 +5,7 @@
static Ecore_Timer *_next_timer = NULL;
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -14,11 +15,9 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UN
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
if (_next_timer) ecore_timer_del(_next_timer);
_next_timer = NULL;
return 1;
}
*/
static Eina_Bool
_next_page(void *data __UNUSED__)
{
@ -40,19 +39,22 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
e_wizard_page_show(o);
/* advance in 1 sec */
_next_timer = ecore_timer_add(1.0, _next_page, NULL);
if (!_next_timer)
_next_timer = ecore_timer_add(1.0, _next_page, NULL);
return 1;
}
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
if (_next_timer) ecore_timer_del(_next_timer);
_next_timer = NULL;
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -139,14 +139,14 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UN
}
return 1;
}
/*
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
// FIXME: free blang_list
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -193,6 +193,10 @@ wizard_page_show(E_Wizard_Page *pg)
e_widget_ilist_selected_set(ob, sel);
e_widget_ilist_nth_show(ob, sel, 0);
}
else if (e_widget_ilist_count(ob) == 2) // default and one other
e_widget_ilist_selected_set(ob, 1);
else
e_widget_ilist_selected_set(ob, 0);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);

View File

@ -117,13 +117,13 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UN
parse_rules();
return 1;
}
/*
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{

View File

@ -27,7 +27,7 @@ _profile_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
// enable next once you choose a profile
e_wizard_button_next_enable_set(1);
}
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -39,7 +39,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -142,10 +142,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
e_config_save();
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -1,7 +1,7 @@
/* Menu setup */
#include "e.h"
#include "e_mod_main.h"
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -13,7 +13,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -24,7 +24,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
e_config->default_system_menu = eina_stringshare_add(buf);
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -36,4 +36,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -10,15 +10,13 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops, Ein
*need_xdg_desktops = EINA_TRUE;
return 1;
}
/*
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
if (_next_timer) ecore_timer_del(_next_timer);
_next_timer = NULL;
return 1;
}
*/
static Eina_Bool
_next_page(void *data __UNUSED__)
{
@ -116,12 +114,14 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
if (_next_timer) ecore_timer_del(_next_timer);
_next_timer = NULL;
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -4,7 +4,7 @@
static double scale = 1.0;
static Eina_List *obs = NULL;
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -16,7 +16,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
static void
_scale_preview_sel_set(Evas_Object *ob, int sel)
{
@ -184,10 +184,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
e_scale_update();
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -3,7 +3,7 @@
#include "e_mod_main.h"
static int focus_mode = 1;
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -15,7 +15,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -74,10 +74,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
// evas_object_del(pg->data);
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -8,13 +8,13 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UN
*need_xdg_icons = EINA_TRUE;
return 1;
}
/*
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -56,7 +56,7 @@ done:
eina_list_free(themes);
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -68,3 +68,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -8,13 +8,13 @@ wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops, Ein
*need_xdg_desktops = EINA_TRUE;
return 1;
}
/*
EAPI int
wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -62,7 +62,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
fclose(fin);
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -74,3 +74,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -31,7 +31,7 @@ read_file(const char *file)
fclose(f);
return strdup(buf);
}
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -43,7 +43,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -116,7 +116,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
}
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -128,4 +128,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -30,7 +30,7 @@ read_file(const char *file)
return strdup(buf);
}
#endif
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -42,7 +42,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -92,7 +92,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
}
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -104,4 +104,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -96,7 +96,7 @@ _check_connman_owner(void *data, DBusMessage *msg,
e_wizard_next();
}
#endif
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -108,7 +108,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -176,10 +176,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -30,7 +30,7 @@
return strdup(buf);
}
*/
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -42,7 +42,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -73,7 +73,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
}
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -85,4 +85,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -1,7 +1,7 @@
/* Setup if we need backlight? */
#include "e.h"
#include "e_mod_main.h"
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -13,7 +13,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -41,7 +41,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
}
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -53,4 +53,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -1,7 +1,7 @@
/* Setup if we need mixer? */
#include "e.h"
#include "e_mod_main.h"
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -13,7 +13,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -42,7 +42,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
}
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -54,4 +54,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -46,7 +46,7 @@ match_xorg_log(const char *globbing)
}
return 0;
}
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -58,7 +58,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -205,10 +205,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
// if (pg->data) evas_object_del(pg->data);
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -1,7 +1,7 @@
/* Setup favorites and desktop links */
#include "e.h"
#include "e_mod_main.h"
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -13,7 +13,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg __UNUSED__)
{
@ -37,7 +37,7 @@ wizard_page_show(E_Wizard_Page *pg __UNUSED__)
return 0; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
@ -49,4 +49,4 @@ wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -3,7 +3,7 @@
#include "e_mod_main.h"
static int do_up = 1;
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -15,7 +15,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -69,10 +69,10 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
e_config_save_queue();
return 1;
}
/*
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/

View File

@ -3,7 +3,7 @@
#include "e_mod_main.h"
static int do_tasks = 1;
/*
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -15,7 +15,7 @@ wizard_page_shutdown(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_show(E_Wizard_Page *pg)
{
@ -46,13 +46,13 @@ wizard_page_show(E_Wizard_Page *pg)
e_wizard_page_show(o);
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
}
/*
EAPI int
wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
*/
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{

View File

@ -2,6 +2,7 @@
#include "e.h"
#include "e_mod_main.h"
#if 0
EAPI int
wizard_page_init(E_Wizard_Page *pg __UNUSED__, Eina_Bool *need_xdg_desktops __UNUSED__, Eina_Bool *need_xdg_icons __UNUSED__)
{
@ -25,7 +26,7 @@ wizard_page_hide(E_Wizard_Page *pg __UNUSED__)
{
return 1;
}
#endif
EAPI int
wizard_page_apply(E_Wizard_Page *pg __UNUSED__)
{