forked from enlightenment/enlightenment
Small bug fix in modules config dialog.
-When enabling a module, if e_module_enable fails, set proper state and get out. Also, do not set cm->state = MOD_ENABLED unless the enable was actually successful. -When disabling a module, only set state to UNLOADED if e_module_disable worked. SVN revision: 23538
This commit is contained in:
parent
10b221a1f2
commit
1164201a9c
|
@ -190,15 +190,22 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
switch (cfdata->state)
|
||||
{
|
||||
case MOD_ENABLED:
|
||||
if (!m->enabled) e_module_enable(m);
|
||||
if (!m->enabled)
|
||||
{
|
||||
if (!e_module_enable(m))
|
||||
{
|
||||
cm->state = MOD_UNLOADED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m->enabled)
|
||||
{
|
||||
if (m->func.config)
|
||||
e_widget_disabled_set(cfdata->gui.configure, 0);
|
||||
if (m->func.about)
|
||||
e_widget_disabled_set(cfdata->gui.about, 0);
|
||||
cm->state = MOD_ENABLED;
|
||||
}
|
||||
cm->state = MOD_ENABLED;
|
||||
break;
|
||||
case MOD_UNLOADED:
|
||||
if (m)
|
||||
|
@ -210,8 +217,8 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
e_module_disable(m);
|
||||
e_object_del(E_OBJECT(m));
|
||||
e_config_save_queue();
|
||||
cm->state = MOD_UNLOADED;
|
||||
}
|
||||
cm->state = MOD_UNLOADED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue