Config settings for popup

SVN revision: 31561
This commit is contained in:
Sebastian Dransfeld 2007-08-27 21:59:05 +00:00
parent cfbec6fac5
commit 9af7807dbc
3 changed files with 33 additions and 3 deletions

View File

@ -6,6 +6,8 @@ struct _E_Config_Dialog_Data
{
int show_label;
double check_time;
int show_popup;
int show_popup_empty;
Evas_List *boxes;
/* Evas Object References */
@ -57,6 +59,8 @@ _fill_data (Config_Item * ci, E_Config_Dialog_Data * cfdata)
{
cfdata->show_label = ci->show_label;
cfdata->check_time = ci->check_time;
cfdata->show_popup = ci->show_popup;
cfdata->show_popup_empty = ci->show_popup_empty;
cfdata->boxes = ci->boxes;
}
@ -93,6 +97,12 @@ _basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
ob =
e_widget_check_add (evas, D_("Always Show Labels"), &(cfdata->show_label));
e_widget_framelist_object_append (of, ob);
ob =
e_widget_check_add (evas, D_("Show Mailbox Popup"), &(cfdata->show_popup));
e_widget_framelist_object_append (of, ob);
ob =
e_widget_check_add (evas, D_("Show All Boxes In Popup"), &(cfdata->show_popup_empty));
e_widget_framelist_object_append (of, ob);
ob = e_widget_label_add (evas, D_("Check Interval"));
e_widget_framelist_object_append (of, ob);
ob =
@ -141,6 +151,8 @@ _basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
ci = cfd->data;
ci->show_label = cfdata->show_label;
ci->check_time = cfdata->check_time;
ci->show_popup = cfdata->show_popup;
ci->show_popup_empty = cfdata->show_popup_empty;
e_config_save_queue ();
_mail_config_updated (ci->id);
return 1;

View File

@ -295,7 +295,7 @@ _mail_cb_mouse_in (void *data, Evas * e, Evas_Object * obj, void *event_info)
if (inst->popup) return;
ci = _mail_config_item_get (inst->gcc->id);
if (!ci->boxes) return;
if ((!ci->show_popup) || (!ci->boxes)) return;
inst->popup = e_gadcon_popup_new (inst->gcc, _mail_popup_resize);
snprintf (path, sizeof (path), "%s/mail.edj",
@ -307,12 +307,21 @@ _mail_cb_mouse_in (void *data, Evas * e, Evas_Object * obj, void *event_info)
cb = l->data;
if (!cb) continue;
if ((!ci->show_popup_empty) && (!cb->num_new)) continue;
snprintf (buf, sizeof (buf), "%s: %d/%d", cb->name, cb->num_new,
cb->num_total);
e_tlist_append (list, buf, NULL, NULL, NULL, NULL);
}
e_gadcon_popup_content_set (inst->popup, list);
e_gadcon_popup_show (inst->popup);
if (e_tlist_count (list))
{
e_gadcon_popup_content_set (inst->popup, list);
e_gadcon_popup_show (inst->popup);
}
else
{
e_object_del (E_OBJECT (inst->popup));
inst->popup = NULL;
}
}
static void
@ -374,6 +383,8 @@ _mail_config_item_get (const char *id)
ci->id = evas_stringshare_add (id);
ci->show_label = 1;
ci->check_time = 15.0;
ci->show_popup = 1;
ci->show_popup_empty = 0;
ci->boxes = NULL;
mail_config->items = evas_list_append (mail_config->items, ci);
@ -418,6 +429,8 @@ e_modapi_init (E_Module * m)
E_CONFIG_VAL (D, T, id, STR);
E_CONFIG_VAL (D, T, show_label, UCHAR);
E_CONFIG_VAL (D, T, check_time, DOUBLE);
E_CONFIG_VAL (D, T, show_popup, UCHAR);
E_CONFIG_VAL (D, T, show_popup_empty, UCHAR);
E_CONFIG_LIST (D, T, boxes, conf_box_edd);
conf_edd = E_CONFIG_DD_NEW ("Mail_Config", Config);
@ -438,6 +451,8 @@ e_modapi_init (E_Module * m)
ci->id = evas_stringshare_add ("0");
ci->show_label = 1;
ci->check_time = 15.0;
ci->show_popup = 1;
ci->show_popup_empty = 0;
ci->boxes = NULL;
mail_config->items = evas_list_append (mail_config->items, ci);

View File

@ -54,6 +54,9 @@ struct _Config_Item
unsigned char show_label;
double check_time;
unsigned char show_popup;
unsigned char show_popup_empty;
Evas_List *boxes;
};