Alright... trying this again.
Here is the said new_xml_format_plus.diff patch again (in its entirety
this time).

On 12/21/2007 00:02, Ravenlock wrote:
> Hello,
> 
> Some short while ago the forecasts module ceased to function properly.
> Seems yahoo has changed their xml output ever so slightly.  Either of
> the patches attached will fix this.
> 
> The difference between the two patches is as follows:
> 
> new_xml_format.diff: simply takes into account the new format, and gets
> the module back up on its feet.
> 
> new_xml_format_plus.diff: handles the new format AND adds a new option
> which allows a person to choose if the forecast popup is realized on a
> mouse over, or a mouse click.  (I prefer a mouse click)
> 
> I'm hoping the new_xml_format_plus.diff is allowed to go in.  I think
> others will benefit as well.  Though admittedly my motivation is selfish
> here, as I get tired of applying the patch to my own copy. :)
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
Regards,
Ravenlock

Index: e_mod_config.c
===================================================================
RCS file: /cvs/e/e_modules/forecasts/e_mod_config.c,v
retrieving revision 1.8
diff -u -r1.8 e_mod_config.c
--- e_mod_config.c	12 Nov 2007 08:14:24 -0000	1.8
+++ e_mod_config.c	21 Dec 2007 06:07:16 -0000
@@ -8,6 +8,7 @@
   int degrees;
   char *code; 
   int show_text;
+  int popup_on_hover;
 };
 
 static void *_create_data(E_Config_Dialog * cfd);
@@ -50,6 +51,7 @@
   if (ci->code)
     cfdata->code = strdup(ci->code);
   cfdata->show_text = ci->show_text;
+  cfdata->popup_on_hover = ci->popup_on_hover;
 }
 
 static void *
@@ -94,6 +96,8 @@
   e_widget_framelist_object_append(of, ob);
   ob = e_widget_check_add(evas, D_("Show Description"), &(cfdata->show_text));
   e_widget_framelist_object_append(of, ob);
+  ob = e_widget_check_add(evas, _("Popup on mouse over"), &(cfdata->popup_on_hover));
+  e_widget_framelist_object_append(of, ob);
   e_widget_list_object_append(o, of, 1, 1, 0.5);
 
   of = e_widget_framelist_add(evas, D_("Unit Settings"), 0);
@@ -142,6 +146,7 @@
   *t = toupper(*t);
   ci->code = evas_stringshare_add(t);
   ci->show_text = cfdata->show_text;
+  ci->popup_on_hover = cfdata->popup_on_hover;
 
   e_config_save_queue();
   _forecasts_config_updated(ci);
Index: e_mod_main.c
===================================================================
RCS file: /cvs/e/e_modules/forecasts/e_mod_main.c,v
retrieving revision 1.14
diff -u -r1.14 e_mod_main.c
--- e_mod_main.c	12 Nov 2007 04:15:51 -0000	1.14
+++ e_mod_main.c	21 Dec 2007 06:07:16 -0000
@@ -362,7 +362,8 @@
    ci->host = evas_stringshare_add("xml.weather.yahoo.com");
    ci->code = evas_stringshare_add("BUXX0005");
    ci->show_text = 1;
-
+   ci->popup_on_hover = 1;
+   
    forecasts_config->items = evas_list_append(forecasts_config->items, ci);
    return ci;
 }
@@ -393,6 +394,7 @@
    E_CONFIG_VAL(D, T, host, STR);
    E_CONFIG_VAL(D, T, code, STR);
    E_CONFIG_VAL(D, T, show_text, INT);
+   E_CONFIG_VAL(D, T, popup_on_hover, INT);
 
    conf_edd = E_CONFIG_DD_NEW("Forecasts_Config", Config);
 #undef T
@@ -415,6 +417,7 @@
 	ci->code = evas_stringshare_add("BUXX0005");
 	ci->id = evas_stringshare_add("0");
 	ci->show_text = 1;
+	ci->popup_on_hover = 1;
 
 	forecasts_config->items = evas_list_append(forecasts_config->items, ci);
      }
@@ -646,7 +649,7 @@
    char city[256];
    char region[256];
    char location[512];
-   int  visibility;
+   float visibility;
    int  i;
 
    inst = data;
@@ -694,7 +697,7 @@
    sscanf(needle, "\"%3[^\"]\"", inst->units.speed);
 
    /* Current conditions */
-   needle = strstr(inst->buffer, "<yweather:condition text=");
+   needle = strstr(inst->buffer, "<yweather:condition  text=");
    if (!needle) goto error;
    needle = strstr(needle, "\"");
    sscanf(needle, "\"%255[^\"]\"", inst->condition.desc);
@@ -734,8 +737,8 @@
    needle = strstr(needle, "visibility=\"");
    if (!needle) goto error;
    needle = strstr(needle, "\"");
-   sscanf(needle, "\"%d\"", &visibility);
-   inst->details.atmosphere.visibility = (float) visibility / 100;
+   sscanf(needle, "\"%f\"", &visibility);
+   inst->details.atmosphere.visibility = visibility;
    needle = strstr(needle, "pressure=\"");
    if (!needle) goto error;
    needle = strstr(needle, "\"");
@@ -1068,13 +1071,19 @@
    e_object_del(E_OBJECT(inst->popup));
 }
 
-static void 
+static void
 _cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
    Instance *inst;
    Evas_Event_Mouse_Down *ev;
 
-   inst = data;
+   if (!(inst = data)) return;
+   if (!inst->ci->popup_on_hover)
+     {
+        e_gadcon_popup_show(inst->popup);
+	return;
+     }
+
    ev = event_info;
    if (ev->button == 1)
      {
@@ -1086,17 +1095,21 @@
 _cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
    Instance *inst;
- 
+
    if (!(inst = data)) return;
+   if (!inst->ci->popup_on_hover) return;
+
    e_gadcon_popup_show(inst->popup);
 }
 
-static void 
+static void
 _cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
    Instance *inst;
-   
+
    if (!(inst = data)) return;
+
+   if (inst->popup->pinned) return;
    e_gadcon_popup_hide(inst->popup);
 }
 
Index: e_mod_main.h
===================================================================
RCS file: /cvs/e/e_modules/forecasts/e_mod_main.h,v
retrieving revision 1.6
diff -u -r1.6 e_mod_main.h
--- e_mod_main.h	1 Nov 2007 10:41:41 -0000	1.6
+++ e_mod_main.h	21 Dec 2007 06:07:16 -0000
@@ -27,6 +27,7 @@
    int degrees;
    const char *host, *code;
    int show_text;
+   int popup_on_hover;
 };
 
 EAPI extern E_Module_Api e_modapi;

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
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-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to