| 16 |
|
|
| 17 |
#include "section_list_display.h" |
#include "section_list_display.h" |
| 18 |
#include "section_list_loader.h" |
#include "section_list_loader.h" |
| 19 |
|
#include "article_cache.h" |
| 20 |
#include "common.h" |
#include "common.h" |
| 21 |
#include "io.h" |
#include "io.h" |
| 22 |
#include "screen.h" |
#include "screen.h" |
| 257 |
int page_count; |
int page_count; |
| 258 |
int page_id = 0; |
int page_id = 0; |
| 259 |
int selected_index = 0; |
int selected_index = 0; |
| 260 |
|
ARTICLE_CACHE article_cache; |
| 261 |
int ret; |
int ret; |
| 262 |
|
|
| 263 |
p_section = section_list_find_by_name(sname); |
p_section = section_list_find_by_name(sname); |
| 340 |
} |
} |
| 341 |
break; |
break; |
| 342 |
case VIEW_ARTICLE: |
case VIEW_ARTICLE: |
| 343 |
log_std("Debug: article %d selected\n", p_articles[selected_index]->aid); |
ret = article_cache_load(&article_cache, VAR_ARTICLE_CACHE_DIR, p_articles[selected_index]); |
| 344 |
|
if (ret < 0) |
| 345 |
|
{ |
| 346 |
|
log_error("article_cache_load(aid=%d, cid=%d)\n", p_articles[selected_index]->aid, p_articles[selected_index]->cid); |
| 347 |
|
break; |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
log_std("Debug: view article aid = %d, cid = %d\n", p_articles[selected_index]->aid, p_articles[selected_index]->cid); |
| 351 |
|
|
| 352 |
|
ret = article_cache_unload(&article_cache); |
| 353 |
|
if (ret < 0) |
| 354 |
|
{ |
| 355 |
|
log_error("article_cache_unload(aid=%d, cid=%d)\n", p_articles[selected_index]->aid, p_articles[selected_index]->cid); |
| 356 |
|
break; |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
// TODO: locate last viewed article |
| 360 |
case REFRESH_SCREEN: |
case REFRESH_SCREEN: |
| 361 |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 362 |
{ |
{ |