| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
| 17 |
#include "article_cache.h" |
#include "article_cache.h" |
| 18 |
|
#include "article_op.h" |
| 19 |
#include "article_post.h" |
#include "article_post.h" |
| 20 |
#include "article_view_log.h" |
#include "article_view_log.h" |
| 21 |
#include "article_del.h" |
#include "article_del.h" |
| 39 |
enum select_cmd_t |
enum select_cmd_t |
| 40 |
{ |
{ |
| 41 |
EXIT_SECTION = 0, |
EXIT_SECTION = 0, |
| 42 |
VIEW_ARTICLE = 1, |
VIEW_ARTICLE, |
| 43 |
CHANGE_PAGE = 2, |
CHANGE_PAGE, |
| 44 |
SHOW_HELP = 3, |
SHOW_HELP, |
| 45 |
CHANGE_NAME_DISPLAY = 4, |
CHANGE_NAME_DISPLAY, |
| 46 |
POST_ARTICLE = 5, |
POST_ARTICLE, |
| 47 |
EDIT_ARTICLE = 6, |
EDIT_ARTICLE, |
| 48 |
DELETE_ARTICLE = 7, |
DELETE_ARTICLE, |
| 49 |
FIRST_TOPIC_ARTICLE = 8, |
QUERY_ARTICLE, |
| 50 |
LAST_TOPIC_ARTICLE = 9, |
FIRST_TOPIC_ARTICLE, |
| 51 |
VIEW_EX_DIR = 10, |
LAST_TOPIC_ARTICLE, |
| 52 |
|
VIEW_EX_DIR, |
| 53 |
}; |
}; |
| 54 |
|
|
| 55 |
static int section_list_draw_items(int page_id, ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
static int section_list_draw_items(int page_id, ARTICLE *p_articles[], int article_count, int display_nickname, int ontop_start_offset) |
| 240 |
case Ctrl('P'): |
case Ctrl('P'): |
| 241 |
return POST_ARTICLE; |
return POST_ARTICLE; |
| 242 |
case 'E': |
case 'E': |
| 243 |
return EDIT_ARTICLE; |
if (item_count > 0) |
| 244 |
|
{ |
| 245 |
|
return EDIT_ARTICLE; |
| 246 |
|
} |
| 247 |
|
break; |
| 248 |
case 'd': |
case 'd': |
| 249 |
return DELETE_ARTICLE; |
if (item_count > 0) |
| 250 |
|
{ |
| 251 |
|
return DELETE_ARTICLE; |
| 252 |
|
} |
| 253 |
|
break; |
| 254 |
|
case Ctrl('Q'): |
| 255 |
|
if (item_count > 0) |
| 256 |
|
{ |
| 257 |
|
return QUERY_ARTICLE; |
| 258 |
|
} |
| 259 |
|
break; |
| 260 |
case KEY_HOME: |
case KEY_HOME: |
| 261 |
*p_page_id = 0; |
*p_page_id = 0; |
| 262 |
case 'P': |
case 'P': |
| 309 |
} |
} |
| 310 |
break; |
break; |
| 311 |
case '=': |
case '=': |
| 312 |
return FIRST_TOPIC_ARTICLE; |
if (item_count > 0) |
| 313 |
|
{ |
| 314 |
|
return FIRST_TOPIC_ARTICLE; |
| 315 |
|
} |
| 316 |
|
break; |
| 317 |
case '\\': |
case '\\': |
| 318 |
return LAST_TOPIC_ARTICLE; |
if (item_count > 0) |
| 319 |
|
{ |
| 320 |
|
return LAST_TOPIC_ARTICLE; |
| 321 |
|
} |
| 322 |
|
break; |
| 323 |
case 'h': |
case 'h': |
| 324 |
return SHOW_HELP; |
return SHOW_HELP; |
| 325 |
case 'x': |
case 'x': |
| 794 |
} |
} |
| 795 |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 796 |
{ |
{ |
| 797 |
|
log_error("section_list_draw_screen() error\n"); |
| 798 |
|
return -2; |
| 799 |
|
} |
| 800 |
|
break; |
| 801 |
|
case QUERY_ARTICLE: |
| 802 |
|
if ((ret = display_article_meta(p_articles[selected_index]->aid)) < 0) |
| 803 |
|
{ |
| 804 |
|
log_error("display_article_meta(aid=%d) error\n", p_articles[selected_index]->aid); |
| 805 |
|
} |
| 806 |
|
if (section_list_draw_screen(sname, stitle, master_list, display_nickname) < 0) |
| 807 |
|
{ |
| 808 |
log_error("section_list_draw_screen() error\n"); |
log_error("section_list_draw_screen() error\n"); |
| 809 |
return -2; |
return -2; |
| 810 |
} |
} |