cleanups and fixes

* [parse] avoid articles marked as read to become unread if there where problems when reading the feed
 * [item] fix the "one icon for all feeds" mode, and better theme for it
 * [theme] cleanups


SVN revision: 30219
enlightenment-0.17
kiwi 16 years ago committed by kiwi
parent 9e0e80c41c
commit 454ec8cbe6
  1. 6
      TODO
  2. 12
      data/theme/Makefile.am
  3. BIN
      data/theme/images/article_background_new.png
  4. BIN
      data/theme/images/article_border.png
  5. BIN
      data/theme/images/feed_background_new.png
  6. BIN
      data/theme/images/feed_border.png
  7. BIN
      data/theme/images/feed_loading_1.png
  8. BIN
      data/theme/images/feed_loading_done.png
  9. BIN
      data/theme/images/icon_infos.png
  10. BIN
      data/theme/images/icon_viewer.png
  11. BIN
      data/theme/images/item_border.png
  12. BIN
      data/theme/images/item_feed_back.png
  13. BIN
      data/theme/images/viewer_background.png
  14. 8
      data/theme/module.edc
  15. 13
      data/theme/module_feed_programs.edc
  16. 72
      data/theme/module_feedone_parts.edc
  17. 31
      data/theme/module_feedone_programs.edc
  18. 48
      data/theme/module_icon.edc
  19. 5
      data/theme/module_item.edc
  20. 12
      data/theme/module_item_programs.edc
  21. 21
      data/theme/module_viewer.edc
  22. 49
      data/theme/module_viewer_parts.edc
  23. 10
      data/theme/module_viewer_programs.edc
  24. 62
      src/module/news_item.c
  25. 27
      src/module/news_parse.c
  26. 2
      src/module/news_viewer.c

@ -26,15 +26,15 @@ mails juan
mails ludger
politic : http://alibaba0.free.fr/blog/rss.php
?
http://www.kozlika.org/kozeries/feed/rss2
? : http://www.kozlika.org/kozeries/feed/rss2
science : http://www.eurekalert.org/rss.xml
----------------------------------------------------
NEEDED (to do more or less in this order)
----------------------------------------------------
- ? make a difference in item ui, depending on the gadon gadget inset/freee appearance ?
- debug html chars parse with test.rss

@ -23,30 +23,20 @@ module_item_programs.edc \
module_popw.edc \
module_popw_parts.edc \
module_popw_programs.edc \
module_viewer.edc \
module_viewer_parts.edc \
module_viewer_programs.edc \
fonts/VeraBd.ttf \
fonts/Vera.ttf \
images/feed_background_new.png \
images/feed_border.png \
images/feed_loading_1.png \
images/feed_loading_done.png \
images/icon_article_read.png \
images/icon_article_unread.png \
images/icon_infos.png \
images/icon_logo.png \
images/icon_setasread.png \
images/icon_update.png \
images/icon_viewer.png \
images/item_border.png \
images/item_feed_back.png \
images/popup_warn_background.png \
images/popup_warn_disable_clicked.png \
images/popup_warn_disable.png \
images/popup_warn_logo_error.png \
images/popup_warn_logo_info.png \
images/viewer_background.png
images/popup_warn_logo_info.png
e-module-news.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -2,9 +2,6 @@
images
{
image: "item_border.png" COMP;
image: "item_feed_back.png" COMP;
image: "feed_background_new.png" COMP;
image: "feed_border.png" COMP;
@ -14,11 +11,7 @@ images
image: "popup_warn_logo_error.png" COMP;
image: "popup_warn_logo_info.png" COMP;
image: "viewer_background.png" COMP;
image: "icon_logo.png" COMP;
image: "icon_infos.png" COMP;
image: "icon_viewer.png" COMP;
image: "icon_article_read.png" COMP;
image: "icon_article_unread.png" COMP;
image: "icon_update.png" COMP;
@ -39,6 +32,5 @@ collections
#include "module_feed.edc"
#include "module_feedone.edc"
#include "module_popw.edc"
#include "module_viewer.edc"
#include "module_icon.edc"
}

@ -1,16 +1,3 @@
/* Init */
program
{
name: "init";
signal: "load";
source: "";
script
{
}
}
/* Signals for new state */
program

@ -1,28 +1,40 @@
part
{
name: "background";
name: "icon";
type: IMAGE;
mouse_events: 0;
description
{
state: "default" 0.0;
color: 255 255 255 0;
aspect: 1.0 1.0;
rel1
{
relative: 0.0 0.0;
relative: 0.1 0.1;
}
rel2
{
relative: 1.0 1.0;
}
image
{
normal: "feed_background_new.png";
relative: 0.9 0.9;
}
}
image
{
normal: "icon_logo.png";
}
}
}
part
{
name: "unread_clip";
type: RECT;
mouse_events: 0;
description
{
state: "default" 0.0;
color: 255 255 255 0;
}
description
{
state: "new" 0.0;
state: "active" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
@ -30,14 +42,13 @@ part
part
{
name: "border";
name: "unread";
type: IMAGE;
mouse_events: 0;
clip_to: "unread_clip";
description
{
state: "default" 0.0;
visible: 0;
color: 255 255 255 0;
rel1
{
relative: 0.0 0.0;
@ -48,40 +59,51 @@ part
}
image
{
normal: "feed_border.png";
normal: "feed_background_new.png";
}
}
}
part
{
name: "border_clip";
type: RECT;
mouse_events: 0;
description
{
state: "default" 0.0;
color: 255 255 255 0;
}
description
{
state: "selected" 0.0;
state: "active" 0.0;
inherit: "default" 0.0;
visible: 1;
color: 255 255 255 255;
}
}
part
{
name: "icon";
name: "border";
type: IMAGE;
mouse_events: 0;
clip_to: "border_clip";
description
{
state: "default" 0.0;
aspect: 1.0 1.0;
rel1
{
relative: 0.1 0.1;
relative: 0.0 0.0;
}
rel2
{
relative: 0.9 0.9;
relative: 1.0 1.0;
}
image
{
normal: "icon_logo.png";
}
}
image
{
normal: "feed_border.png";
}
}
}
part

@ -1,16 +1,3 @@
/* Init */
program
{
name: "init";
signal: "load";
source: "";
script
{
}
}
/* Signals for new state */
program
@ -18,9 +5,9 @@ program
name: "new_set";
signal: "e,state,new,set";
source: "e";
action: STATE_SET "new" 0.0;
target: "background";
transition: SINUSOIDAL 0.5;
action: STATE_SET "active" 0.0;
transition: SINUSOIDAL 0.7;
target: "unread_clip";
}
program
{
@ -28,8 +15,8 @@ program
signal: "e,state,new,unset";
source: "e";
action: STATE_SET "default" 0.0;
target: "background";
transition: SINUSOIDAL 0.5;
target: "unread_clip";
}
/* Mouse in/out */
@ -39,8 +26,9 @@ program
name: "mouse_in";
signal: "mouse,in";
source: "inout";
action: STATE_SET "selected" 0.0;
target: "border";
action: STATE_SET "active" 0.0;
transition: SINUSOIDAL 0.1;
target: "border_clip";
}
program
@ -49,7 +37,8 @@ program
signal: "mouse,out";
source: "inout";
action: STATE_SET "default" 0.0;
target: "border";
transition: SINUSOIDAL 0.5;
target: "border_clip";
}
program
@ -57,5 +46,5 @@ program
name: "mouse_down";
signal: "mouse,down,1";
source: "inout";
action: SIGNAL_EMIT "open" "feed";
action: SIGNAL_EMIT "e,action,open" "e";
}

@ -24,54 +24,6 @@ group
}
}
group
{
name: "modules/news/icon/infos";
parts
{
part
{
name: "icon";
type: IMAGE;
mouse_events: 0;
description
{
state: "default" 0.0;
aspect: 1.0 1.0;
image
{
normal: "icon_infos.png";
}
}
}
}
}
group
{
name: "modules/news/icon/viewer";
parts
{
part
{
name: "icon";
type: IMAGE;
mouse_events: 0;
description
{
state: "default" 0.0;
aspect: 1.0 1.0;
image
{
normal: "icon_viewer.png";
}
}
}
}
}
group
{
name: "modules/news/icon/article_read";

@ -4,11 +4,6 @@ group
{
name: "modules/news/item";
script
{
}
parts
{
#include "module_item_parts.edc"

@ -1,12 +0,0 @@
/* Init */
program
{
name: "init";
signal: "load";
source: "";
script
{
}
}

@ -1,21 +0,0 @@
/* Viewer group */
group
{
name: "modules/news/viewer";
data
{
item: "shaped" "1";
}
parts
{
#include "module_viewer_parts.edc"
}
programs
{
#include "module_viewer_programs.edc"
}
}

@ -1,49 +0,0 @@
part {
name: "border";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
offset: 0 0;
}
rel2 {
offset: -1 -1;
}
color: 0 0 0 255;
}
}
part {
name: "base";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
offset: 1 1;
to: "border";
}
rel2 {
offset: -2 -2;
to: "border";
}
color: 221 221 221 255;
}
}
part {
name: "e.swallow.content";
type: SWALLOW;
description {
state: "default" 0.0;
align: 0.5 0.5;
color: 0 0 0 0;
rel1 {
offset: 5 5;
to: "base";
}
rel2 {
offset: -6 -6;
to: "base";
}
}
}

@ -1,10 +0,0 @@
program
{
name: "click_close";
signal: "mouse,up,1";
source: "base";
script
{
emit("close", "viewer");
}
}

@ -4,6 +4,7 @@ static void _item_refresh_mode_one(News_Item *ni, int changed_order, int c
static void _item_refresh_mode_feed(News_Item *ni, int important_only, int unread_only, int changed_order, int changed_content, int changed_state);
static void _cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _cb_item_open(void *data, Evas_Object *obj, const char *emission, const char *source);
/*
@ -194,6 +195,8 @@ _item_refresh_mode_one(News_Item *ni, int changed_order, int changed_state)
{
obj = edje_object_add(ni->gcc->gadcon->evas);
news_theme_edje_set(obj, NEWS_THEME_FEEDONE);
edje_object_signal_callback_add(obj, "e,action,open", "e",
_cb_item_open, ni);
}
if (!ni->view.obj_mode_one || changed_order)
@ -286,33 +289,6 @@ _cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
int cx, cy, cw, ch;
case 1:
switch (ni->config->openmethod)
{
case NEWS_ITEM_OPENMETHOD_VIEWER:
if (!ni->viewer)
news_viewer_create(ni);
else
news_viewer_destroy(ni->viewer);
break;
case NEWS_ITEM_OPENMETHOD_BROWSER:
/* if we are not in view mode one,
we assume its an error click */
if (ni->config->view_mode != NEWS_ITEM_VIEW_MODE_ONE)
break;
news_menu_browser_show(ni);
e_gadcon_canvas_zone_geometry_get(ni->gcc->gadcon,
&cx, &cy, &cw, &ch);
e_menu_activate_mouse(ni->menu_browser,
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(ni->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
break;
}
break;
case 3:
if (ni->menu) break;
news_menu_item_show(ni);
@ -340,3 +316,35 @@ _cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
DITEM(("Mouse out"));
}
static void
_cb_item_open(void *data, Evas_Object *obj, const char *emission, const char *source)
{
News_Item *ni;
E_Manager *man;
E_Zone *zone;
int cx, cy;
ni = data;
switch (ni->config->openmethod)
{
case NEWS_ITEM_OPENMETHOD_VIEWER:
if (!ni->viewer)
news_viewer_create(ni);
else
news_viewer_destroy(ni->viewer);
break;
case NEWS_ITEM_OPENMETHOD_BROWSER:
news_menu_browser_show(ni);
man = e_manager_current_get();
zone = e_util_zone_current_get(man);
ecore_x_pointer_xy_get(man->root, &cx, &cy);
e_menu_activate_mouse(ni->menu_browser, zone,
cx, cy, 1, 1,
E_MENU_POP_DIRECTION_DOWN,
ecore_x_current_time_get());
e_util_container_fake_mouse_up_all_later(zone->container);
break;
}
}

@ -1075,18 +1075,22 @@ _update_doc(News_Parse *parser)
evas_list_free(parser->articles);
parser->articles = NULL;
/* remove old articles,
/* remove old articles
* except unread articles, we keep them */
pos = evas_list_count(parser->doc->articles) - 1;
while ((fa = evas_list_nth(parser->doc->articles, pos)))
if ((parser->error != NEWS_PARSE_ERROR_BROKEN_FEED) ||
(parser->doc->unread_count > NEWS_FEED_UNREAD_COUNT_MAX))
{
if (!fa->unread ||
(parser->doc->unread_count > NEWS_FEED_UNREAD_COUNT_MAX))
pos = evas_list_count(parser->doc->articles) - 1;
while ((fa = evas_list_nth(parser->doc->articles, pos)))
{
news_feed_article_del(fa);
parser->changes = 1;
/* if unread count max reached, remove even if unread */
if (!fa->unread || (parser->doc->unread_count > NEWS_FEED_UNREAD_COUNT_MAX))
{
news_feed_article_del(fa);
parser->changes = 1;
}
pos--;
}
pos--;
}
/* append the old articles list to the new one */
@ -1100,6 +1104,7 @@ _update_doc(News_Parse *parser)
parser->doc->articles = list;
/* DEBUG : list the articles */
#ifdef DPARSE
DPARSE(("-- New articles list for feed %s", parser->doc->feed->name));
for (l=parser->doc->articles; l; l=evas_list_next(l))
{
@ -1107,11 +1112,7 @@ _update_doc(News_Parse *parser)
DPARSE(("- %s", fa->title));
}
DPARSE(("---------"));
/*
FIXME:
if sorting, no need to KEEP THE ORDER upper, so can optimize
*/
#endif
}
static void

@ -604,7 +604,7 @@ _dialog_cb_article_selected(void *data)
(art->title && art->title[0]) ? art->title : "No title",
buf_date,
(art->description && art->description[0])? art->description : "No description text",
(art->url) ? "||click here to open article in a browser||" : "");
(art->url) ? "||click on the text to open article in a browser||" : "");
_vcontent_text_set(nv, buf);
if (art->unread)

Loading…
Cancel
Save