Enlightenment CVS committal
Author : englebass
Project : e_modules
Module : tclock
Dir : e_modules/tclock
Modified Files:
e_mod_config.c e_mod_main.c e_mod_main.h
Log Message:
Fix for gadcon update. Not added new gadcon functions.
===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_config.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- e_mod_config.c 15 Mar 2007 13:40:57 -0000 1.32
+++ e_mod_config.c 16 Sep 2007 01:46:51 -0000 1.33
@@ -132,7 +132,7 @@
e_config_save_queue ();
- _tclock_config_updated (ci->id);
+ _tclock_config_updated (ci);
return 1;
}
===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_main.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- e_mod_main.c 25 Mar 2007 01:25:42 -0000 1.48
+++ e_mod_main.c 16 Sep 2007 01:46:51 -0000 1.49
@@ -43,6 +43,7 @@
{
E_Gadcon_Client *gcc;
Evas_Object *tclock;
+ Config_Item *ci;
};
static E_Gadcon_Client *
@@ -52,13 +53,12 @@
E_Gadcon_Client *gcc;
Instance *inst;
char buf[4096];
- Config_Item *ci;
inst = E_NEW (Instance, 1);
- ci = _tclock_config_item_get (id);
- if (!ci->id)
- ci->id = evas_stringshare_add (id);
+ inst->ci = _tclock_config_item_get (id);
+ if (!inst->ci->id)
+ inst->ci->id = evas_stringshare_add (id);
o = edje_object_add (gc->evas);
snprintf (buf, sizeof (buf), "%s/tclock.edj",
@@ -192,47 +192,37 @@
_tclock_menu_cb_configure (void *data, E_Menu * m, E_Menu_Item * mi)
{
Instance *inst;
- Config_Item *ci;
inst = data;
- ci = _tclock_config_item_get (inst->gcc->id);
- _config_tclock_module (ci);
+ _config_tclock_module (inst->ci);
}
void
-_tclock_config_updated (const char *id)
+_tclock_config_updated (Config_Item *ci)
{
Evas_List *l;
- Config_Item *ci;
if (!tclock_config)
return;
- ci = _tclock_config_item_get (id);
for (l = tclock_config->instances; l; l = l->next)
{
Instance *inst;
inst = l->data;
- if (!inst->gcc->id)
- continue;
- if (!strcmp (inst->gcc->id, ci->id))
- {
- if (!ci->show_time)
- edje_object_signal_emit (inst->tclock, "time_hidden", "");
- else
- edje_object_signal_emit (inst->tclock, "time_visible", "");
- edje_object_message_signal_process (inst->tclock);
-
- if (!ci->show_date)
- edje_object_signal_emit (inst->tclock, "date_hidden", "");
- else
- edje_object_signal_emit (inst->tclock, "date_visible", "");
- edje_object_message_signal_process (inst->tclock);
+ if (inst->ci != ci) continue;
+ if (!inst->ci->show_time)
+ edje_object_signal_emit (inst->tclock, "time_hidden", "");
+ else
+ edje_object_signal_emit (inst->tclock, "time_visible", "");
+ edje_object_message_signal_process (inst->tclock);
+
+ if (!inst->ci->show_date)
+ edje_object_signal_emit (inst->tclock, "date_hidden", "");
+ else
+ edje_object_signal_emit (inst->tclock, "date_visible", "");
+ edje_object_message_signal_process (inst->tclock);
- _tclock_cb_check (inst);
-
- break;
- }
+ _tclock_cb_check (inst);
}
}
@@ -240,7 +230,6 @@
_tclock_cb_check (void *data)
{
Instance *inst;
- Config_Item *ci;
Evas_List *l;
time_t current_time;
struct tm *local_time;
@@ -251,15 +240,14 @@
for (l = tclock_config->instances; l; l = l->next)
{
inst = l->data;
- ci = _tclock_config_item_get (inst->gcc->id);
- if (!ci->show_time)
+ if (!inst->ci->show_time)
edje_object_signal_emit (inst->tclock, "time_hidden", "");
else
edje_object_signal_emit (inst->tclock, "time_visible", "");
edje_object_message_signal_process (inst->tclock);
- if (!ci->show_date)
+ if (!inst->ci->show_date)
edje_object_signal_emit (inst->tclock, "date_hidden", "");
else
edje_object_signal_emit (inst->tclock, "date_visible", "");
@@ -267,14 +255,14 @@
memset (buf, 0, sizeof (buf));
- if (ci->time_format)
+ if (inst->ci->time_format)
{
- strftime (buf, 1024, ci->time_format, local_time);
+ strftime (buf, 1024, inst->ci->time_format, local_time);
edje_object_part_text_set (inst->tclock, "tclock_time", buf);
}
- if (ci->date_format)
+ if (inst->ci->date_format)
{
- strftime (buf, 1024, ci->date_format, local_time);
+ strftime (buf, 1024, inst->ci->date_format, local_time);
edje_object_part_text_set (inst->tclock, "tclock_date", buf);
}
}
@@ -401,19 +389,6 @@
EAPI int
e_modapi_save (E_Module * m)
{
- Evas_List *l;
-
- for (l = tclock_config->instances; l; l = l->next)
- {
- Instance *inst;
- Config_Item *ci;
-
- inst = l->data;
- ci = _tclock_config_item_get (inst->gcc->id);
- if (ci->id)
- evas_stringshare_del (ci->id);
- ci->id = evas_stringshare_add (inst->gcc->id);
- }
e_config_domain_save ("module.tclock", conf_edd, tclock_config);
return 1;
}
===================================================================
RCS file: /cvs/e/e_modules/tclock/e_mod_main.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- e_mod_main.h 3 Jul 2006 07:37:33 -0000 1.19
+++ e_mod_main.h 16 Sep 2007 01:46:51 -0000 1.20
@@ -37,7 +37,7 @@
EAPI int e_modapi_about(E_Module *m);
void _config_tclock_module(Config_Item *ci);
-void _tclock_config_updated(const char *id);
+void _tclock_config_updated(Config_Item *ci);
extern Config *tclock_config;
#endif
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs