* [viewer] dont expand the feeds list horizontaly
 * [theme] allow e theme to overwrite one or multiple groups
 * [theme] reduce size of some pictures


SVN revision: 30273
enlightenment-0.17
kiwi 15 years ago committed by kiwi
parent 006eda9e46
commit 5c6284c04e
  1. 5
      TODO
  2. BIN
      data/theme/images/icon_article_read.png
  3. BIN
      data/theme/images/icon_article_unread.png
  4. BIN
      data/theme/images/icon_logo.png
  5. 4
      src/module/e_mod_main.c
  6. 1
      src/module/e_mod_main.h
  7. 2
      src/module/news_config_dialog.c
  8. 2
      src/module/news_config_dialog_category.c
  9. 2
      src/module/news_config_dialog_feed.c
  10. 2
      src/module/news_config_dialog_feeds.c
  11. 2
      src/module/news_config_dialog_item.c
  12. 2
      src/module/news_config_dialog_item_content.c
  13. 2
      src/module/news_config_dialog_langs.c
  14. 46
      src/module/news_theme.c
  15. 7
      src/module/news_theme.h
  16. 65
      src/module/news_viewer.c

@ -34,7 +34,6 @@ 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
@ -42,6 +41,10 @@ NEEDED (to do more or less in this order)
- atom feeds
- save unread articles on shutdown
- if the shelf is hidden, show it on news
- viewer: a way to set vcontent bg color ?
- clean config_dialog_data (use sub structs ...)

Binary file not shown.

@ -43,7 +43,6 @@ e_modapi_init(E_Module *m)
DMAIN(("Initialisation ..."));
if (!news_config_init()) E_MOD_INIT_FAIL(m, _("Config init failed"));
if (!news_theme_init()) E_MOD_INIT_FAIL(m, _("Theme init failed"));
if (!news_parse_init()) E_MOD_INIT_FAIL(m, _("Parser init failed"));
if (!news_feed_init()) E_MOD_INIT_FAIL(m, _("Feeds init failed"));
if (!news_viewer_init()) E_MOD_INIT_FAIL(m, _("Viewer init failed"));
@ -80,7 +79,6 @@ e_modapi_shutdown(E_Module *m)
news_viewer_shutdown();
news_feed_shutdown();
news_parse_shutdown();
news_theme_shutdown();
news_config_shutdown();
free(news);
@ -242,6 +240,6 @@ _gc_icon(Evas *evas)
Evas_Object *o;
o = edje_object_add(evas);
edje_object_file_set(o, news->theme, "icon");
edje_object_file_set(o, news_theme_file_get(NULL), "icon");
return o;
}

@ -10,7 +10,6 @@ typedef struct _News News;
struct _News
{
E_Module *module;
char *theme;
News_Config *config;
E_Config_Dialog *config_dialog;

@ -95,7 +95,7 @@ news_config_dialog_show(void)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Main Configuration"),
"E", DIALOG_CLASS,
news->theme, 0, v, NULL);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, NULL);
return 1;
}

@ -49,7 +49,7 @@ news_config_dialog_category_show(News_Feed_Category *fcat)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Category Configuration"),
"E", "_e_mod_news_config_dialog_category",
news->theme, 0, v, fcat);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, fcat);
return 1;
}

@ -76,7 +76,7 @@ news_config_dialog_feed_show(News_Feed *feed)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Feed Configuration"),
"E", "_e_mod_news_config_dialog_feed",
news->theme, 0, v, feed);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, feed);
return 1;
}

@ -81,7 +81,7 @@ news_config_dialog_feeds_show(void)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Feeds Configuration"),
"E", DIALOG_CLASS,
news->theme, 0, v, NULL);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, NULL);
if (news->config->feed.langs_notset)
{

@ -39,7 +39,7 @@ news_config_dialog_item_show(News_Item *ni)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Gadget Configuration"),
"E", DIALOG_CLASS,
news->theme, 0, v, ni);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, ni);
return 1;
}

@ -52,7 +52,7 @@ news_config_dialog_item_content_show(News_Item *ni)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Gadget Content Configuration"),
"E", DIALOG_CLASS,
news->theme, 0, v, ni);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, ni);
if (news->config->feed.langs_notset)
{

@ -44,7 +44,7 @@ news_config_dialog_langs_show(void)
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
_("News Feeds Language Configuration"),
"E", DIALOG_CLASS,
news->theme, 0, v, NULL);
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, NULL);
return 1;
}

@ -1,59 +1,39 @@
#include "News.h"
static char _theme[4096];
/*
* Public functions
*/
int
news_theme_init(void)
const char *
news_theme_file_get(char *category)
{
const char *path;
char buf[4096];
path = e_theme_edje_file_get(NEWS_THEME_IN_E, NEWS_THEME_ITEM);
if (path && path[0])
news->theme = NULL;
else
{
snprintf(buf, sizeof(buf), "%s/e-module-news.edj", e_module_dir_get(news->module));
news->theme = strdup(buf);
}
return 1;
}
void
news_theme_shutdown(void)
{
E_FREE(news->theme);
if (category && e_theme_category_find(category))
return NULL;
snprintf(_theme, sizeof(_theme), "%s/e-module-news.edj", e_module_dir_get(news->module));
return _theme;
}
void
news_theme_edje_set(Evas_Object *obj, char *key)
{
if (!news->theme)
e_theme_edje_object_set(obj, NEWS_THEME_IN_E, key);
else
edje_object_file_set(obj, news->theme, key);
if (!e_theme_edje_object_set(obj, NEWS_THEME_IN_E, key))
edje_object_file_set(obj, news_theme_file_get(NULL), key);
}
void
news_theme_icon_set(Evas_Object *ic, char *key)
{
if (!news->theme)
e_util_edje_icon_set(ic, key);
else
e_icon_file_edje_set(ic, news->theme, key);
if (!e_util_edje_icon_set(ic, key))
e_icon_file_edje_set(ic, news_theme_file_get(NULL), key);
}
void
news_theme_menu_icon_set(E_Menu_Item *mi, char *key)
{
if (!news->theme)
e_util_menu_item_edje_icon_set(mi, key);
else
e_menu_item_icon_edje_set(mi, news->theme, key);
if (!e_util_menu_item_edje_icon_set(mi, key))
e_menu_item_icon_edje_set(mi, news_theme_file_get(NULL), key);
}
/*

@ -7,6 +7,8 @@
#define NEWS_THEME_IN_E "base/theme/modules/news"
#define NEWS_THEME_CAT_ICON "modules/news/icon"
#define NEWS_THEME_ITEM "modules/news/item"
#define NEWS_THEME_FEED "modules/news/feed"
#define NEWS_THEME_FEEDONE "modules/news/feedone"
@ -21,10 +23,7 @@
#define NEWS_THEME_ICON_UPDATE "modules/news/icon/update"
#define NEWS_THEME_ICON_SETASREAD "modules/news/icon/setasread"
int news_theme_init(void);
void news_theme_shutdown(void);
const char * news_theme_file_get(char *category);
void news_theme_edje_set(Evas_Object *obj, char *key);
void news_theme_icon_set(Evas_Object *ic, char *key);
void news_theme_menu_icon_set(E_Menu_Item *mi, char *key);

@ -200,20 +200,19 @@ news_viewer_refresh(News_Viewer *nv)
/* select a feed */
if (toselect_pos != -1)
{
e_widget_ilist_selected_set(ilist, toselect_pos);
if ((nv->vfeeds.selected->doc && nv->vfeeds.selected->doc->ui_needrefresh) ||
!nv->varticles.selected)
_dialog_cb_feed_selected(nv->vfeeds.selected);
}
else if (!nv->vfeeds.selected && pos)
{
NEWS_ITEM_FEEDS_FOREACH_BEG_LIST(feed_refs);
e_widget_ilist_selected_set(ilist, 0);
_dialog_cb_feed_selected(_feed);
break;
NEWS_ITEM_FEEDS_FOREACH_END();
}
{
e_widget_ilist_selected_set(ilist, toselect_pos);
}
/* ilist size */
if (pos == -1)
e_widget_min_size_set(ilist, 100, 70);
else
{
int wmw;
e_widget_min_size_get(ilist, &wmw, NULL);
e_widget_min_size_set(ilist, wmw, 110);
}
if (nv->vfeeds.list_own)
{
@ -353,7 +352,7 @@ _dialog_geometry_update(News_Viewer *nv)
nv->dialog.x = dia_x;
nv->dialog.y = dia_y;
e_dialog_show(nv->dialog.dia);
e_dialog_border_icon_set(nv->dialog.dia, news->theme);
e_dialog_border_icon_set(nv->dialog.dia, news_theme_file_get(NEWS_THEME_CAT_ICON));
}
static int
@ -361,14 +360,15 @@ _dialog_content_create(News_Viewer *nv)
{
Evas_Textblock_Style *tb_style;
Evas *evas;
Evas_Object *o, *ob, *of, *icon;
Evas_Object *o, *o2, *ob, *of, *icon;
char buf[4096];
char buf2[1024] = "";
int w, h;
evas = evas_object_evas_get(nv->dialog.dia->bg_object);
o = e_widget_table_add(evas, 0);
o = e_widget_list_add(evas, 0, 0);
o2 = e_widget_list_add(evas, 0, 1);
nv->dialog.tab = o;
of = e_widget_frametable_add(evas, _("Feeds in this gadget"), 0);
@ -397,24 +397,13 @@ _dialog_content_create(News_Viewer *nv)
ob = e_widget_ilist_add(evas, 16, 16, NULL);
e_widget_ilist_selector_set(ob, 1);
e_widget_min_size_set(ob, 100, 70);
nv->vfeeds.ilist = ob;
news_viewer_refresh(nv);
e_widget_frametable_object_append(of, ob, 0, 2, 2, 1, 1, 1, 1, 1);
e_widget_table_object_append(o, of, 0, 0, 1, 1, 1, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Articles in selected feed"), 0);
nv->dialog.ftab_articles = of;
ob = e_widget_ilist_add(evas, 16, 16, NULL);
e_widget_ilist_selector_set(ob, 1);
e_widget_min_size_set(ob, 250, 140);
nv->varticles.ilist = ob;
e_widget_framelist_object_append(of, ob);
e_widget_table_object_append(o, of, 0, 1, 2, 1, 1, 1, 1, 1);
e_widget_list_object_append(o2, of, 1, 0, 0.0);
ob = evas_object_textblock_add(evas_object_evas_get(nv->dialog.dia->bg_object));
ob = evas_object_textblock_add(evas_object_evas_get(nv->dialog.dia->bg_object));
tb_style = evas_textblock_style_new();
if (news->config->viewer.vcontent.font_shadow)
{
@ -445,8 +434,20 @@ _dialog_content_create(News_Viewer *nv)
_vcontent_cb_mouse_down, nv);
nv->vcontent.scrollframe = ob;
e_widget_table_object_append(o, ob, 1, 0, 1, 1, 1, 1, 1, 1);
e_widget_list_object_append(o2, ob, 1, 1, 0.5);
e_widget_list_object_append(o, o2, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Articles in selected feed"), 0);
nv->dialog.ftab_articles = of;
ob = e_widget_ilist_add(evas, 16, 16, NULL);
e_widget_ilist_selector_set(ob, 1);
e_widget_min_size_set(ob, 250, 140);
nv->varticles.ilist = ob;
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 1.0);
/* apply */
e_widget_min_size_get(o, &w, &h);
e_dialog_content_set(nv->dialog.dia, o, w, h);

Loading…
Cancel
Save