diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-12 19:55:00 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-12 19:55:00 +0800 |
commit | 728e27e6f357fa2e00177f949ffed0d830fd004d (patch) | |
tree | 527bde4005feb7ab777751f1626f082447a88fed /mbbsd | |
parent | 0c4c72121c0afc0cca3a4cac6ac70b120cd235c3 (diff) | |
download | pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.gz pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.bz2 pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.lz pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.xz pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.tar.zst pttbbs-728e27e6f357fa2e00177f949ffed0d830fd004d.zip |
- (internal) use new visio/vfooter() API to display footers
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4146 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 8 | ||||
-rw-r--r-- | mbbsd/announce.c | 34 | ||||
-rw-r--r-- | mbbsd/board.c | 16 | ||||
-rw-r--r-- | mbbsd/mail.c | 68 | ||||
-rw-r--r-- | mbbsd/read.c | 6 |
5 files changed, 38 insertions, 94 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index 66f415e1..c813b0e3 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -779,7 +779,7 @@ x_file(void) const int rows = t_lines-2; // display. - clear(); stand_title("編輯系統檔案"); + clear(); showtitle("系統檔案", "編輯系統檔案"); for (i = page*rows; i < min(centries, (page+1)*rows); i++) { // parse entry @@ -796,10 +796,8 @@ x_file(void) ANSI_RESET "\n", i+1, v, fn); } - move(b_lines, 0); - outs(ANSI_COLOR(31;47)); - prints("%-*s " ANSI_RESET, t_columns-2, - " ★請按方向鍵或數字鍵選擇,[ENTER/→]編輯,[q/←] 跳出: "); + vfooter(" 編輯系統檔案 ", + " 請按方向鍵或數字鍵選擇 (Enter/→)編輯\t(q/←)跳出"); cursor_show(1+sel-page*rows, 0); switch((i = vkey())) { diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 7f92a37a..21eccf21 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -256,37 +256,21 @@ a_showmenu(menu_t * pm) move(b_lines, 0); if(copyqueue_querysize() > 0) { // something in queue - prints( - ANSI_COLOR(37;44) "【已標記(複製) %d 項】" - ANSI_COLOR(31;47) " (c)" ANSI_COLOR(30) "標記/複製 " - , copyqueue_querysize()); - - if(pm->level == 0) - outs(" - 無管理權限,無法貼上 " ANSI_RESET); - else - outs( ANSI_COLOR(31) "(p)" ANSI_COLOR(30) "貼上/取消/重設標記 " - ANSI_COLOR(31) "(a)" ANSI_COLOR(30) "附加至文章後 " - ANSI_RESET); + char buf[STRLEN]; + snprintf(buf, sizeof(buf), "【已標記(複製) %d 項】", copyqueue_querysize()); + vfooter(buf, pm->level == 0 ? + " (c)標記/複製 - 無管理權限,無法貼上 " : + " (c)標記/複製 (p)貼上/取消/重設標記 (a)附加至文章後\t(q/←)離開 (h)說明"); } else if(pm->level) { // BM - outs( - ANSI_COLOR(34;46) " 【板 主】 " - ANSI_COLOR(31;47) " (h)" ANSI_COLOR(30) "說明 " - ANSI_COLOR(31) "(q/←)" ANSI_COLOR(30) "離開 " - ANSI_COLOR(31) "(n)" ANSI_COLOR(30) "新增文章 " - ANSI_COLOR(31) "(g)" ANSI_COLOR(30) "新增目錄 " - ANSI_COLOR(31) "(e)" ANSI_COLOR(30) "編輯檔案 " ANSI_RESET - ); + vfooter(" 【板 主】 ", + " (n)新增文章 (g)新增目錄 (e)編輯檔案\t(q/←)離開 (h)說明"); } else { // normal user - outs( - ANSI_COLOR(34;46) " 【功\能鍵】 " - ANSI_COLOR(31;47) " (h)" ANSI_COLOR(30) "說明 " - ANSI_COLOR(31) "(q/←)" ANSI_COLOR(30) "離開 " - ANSI_COLOR(31) "(k↑j↓)" ANSI_COLOR(30) "移動游標 " - ANSI_COLOR(31) "(enter/→)" ANSI_COLOR(30) "讀取資料 " ANSI_RESET); + vfooter(" 【功\能鍵】 ", + " (k↑j↓)移動游標 (enter/→)讀取資料\t(q/←)離開 (h)說明"); } return 1; } diff --git a/mbbsd/board.c b/mbbsd/board.c index 5f344f88..1f6c34de 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -1058,18 +1058,10 @@ get_fav_type(boardstat_t *ptr) static void brdlist_foot(void) { - outs( ANSI_COLOR(34;46) " 選擇看板 " - ANSI_COLOR(31;47) " (c)" ANSI_COLOR(30) "新文章模式 " - ANSI_COLOR(31) "(v/V)" ANSI_COLOR(30) "標為已讀/未讀 " - ANSI_COLOR(31) "(y)" ANSI_COLOR(30)); - if(IS_LISTING_FAV()) - outs("列出全部"); - else if (IS_LISTING_BRD()) - outs("篩選列表"); - else outs("篩選列表"); // never reach here? - - outslr(" " ANSI_COLOR(31) "(m)" ANSI_COLOR(30) "切換最愛", - 73, ANSI_RESET, 0); + vfooter(" 選擇看板 ", + IS_LISTING_FAV() ? + " (c)新文章模式 (v/V)標為已讀/未讀 (y)列出全部 (m)切換最愛" : + " (c)新文章模式 (v/V)標為已讀/未讀 (y)篩選列表 (m)切換最愛"); } diff --git a/mbbsd/mail.c b/mbbsd/mail.c index b81b1e3a..6edb68db 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -903,7 +903,8 @@ read_new_mail(void * voidfptr, void *optarg) return more_result; } - outmsglr(MSG_MAILER, MSG_MAILER_LEN, "", 0); + vfooter(" 信件處理 ", + " (R)回信 (x)站內轉寄 (y)回群組信 (d/D)刪信"); switch (igetch()) { case 'r': @@ -1141,70 +1142,37 @@ int b_call_in(int ent, const fileheader_t * fhdr, const char *direct); static int mail_read(int ent, fileheader_t * fhdr, const char *direct) { - char buf[PATHLEN]; - char done, delete_it, replied; + char buf[PATHLEN]; + int done; - clear(); + // in current design, mail_read is ok for single entry. setdirpath(buf, direct, fhdr->filename); strlcpy(currtitle, subject(fhdr->title), sizeof(currtitle)); - done = delete_it = replied = NA; - while (!done) { - int more_result = more(buf, YEA); - /* whether success or not, update flag. - * or users may bug about "black-hole" mails - * and blinking notification */ - if( !(fhdr->filemode & FILE_READ)) - { - fhdr->filemode |= FILE_READ; - substitute_ref_record(direct, fhdr, ent); - } - switch (more_result) { + /* whether success or not, update flag. + * or users may bug about "black-hole" mails + * and blinking notification */ + if( !(fhdr->filemode & FILE_READ)) + { + fhdr->filemode |= FILE_READ; + substitute_ref_record(direct, fhdr, ent); + } + done = more(buf, YEA); + // quick control + switch (done) { case -1: /* no such file */ clear(); vmsg("此封信無內容。"); return FULLUPDATE; - case RET_DOREPLY: + case RET_DOREPLY: mail_reply(ent, fhdr, direct); return FULLUPDATE; case RET_DOREPLYALL: multi_reply(ent, fhdr, direct); return FULLUPDATE; - case RET_DORECOMMEND: // we don't accept this. - return FULLUPDATE; - case 0: - break; - default: - return more_result; - } - outmsglr(MSG_MAILER, MSG_MAILER_LEN, "", 0); - - switch (igetch()) { - case 'r': - case 'R': - replied = YEA; - mail_reply(ent, fhdr, direct); - break; - case 'y': - multi_reply(ent, fhdr, direct); - break; - case 'x': - m_forward(ent, fhdr, direct); - break; - case 'd': - delete_it = YEA; - default: - done = YEA; - } } - if (delete_it) - mail_del(ent, fhdr, direct); - else { - fhdr->filemode |= FILE_READ; - substitute_ref_record(direct, fhdr, ent); - } - return FULLUPDATE; + return done; } static int diff --git a/mbbsd/read.c b/mbbsd/read.c index c39a9381..ec321314 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -1354,9 +1354,11 @@ i_read(int cmdmode, const char *direct, void (*dotitle) (), outmsglr(ANSI_COLOR(44) " 私人收藏 " ANSI_COLOR(30;47), 10, " 繼續? ", 7); else if (curredit & EDIT_MAIL) - outmsglr(MSG_MAILER, MSG_MAILER_LEN, "", 0); + vfooter(" 鴻雁往返 ", + " (R)回信 (x)站內轉寄 (y)回群組信 (d/D)刪信 (m)保留標記\t(←/q)離開"); else - outmsglr(MSG_POSTER, MSG_POSTER_LEN, "", 0); + vfooter(" 文章選讀 ", + " (y)回應 (X)推文 (x)轉錄 (=[]<>)相關主題 (/?a)搜尋標題/作者\t(b)進板畫面"); break; case TITLE_REDRAW: |