extract komens usage message to function
This commit is contained in:
parent
a78f4536b2
commit
05c406ed6a
@ -28,13 +28,19 @@ std::vector<allocation> komens_allocated;
|
|||||||
void insert_content(WINDOW *content_win, WINDOW *attachment_win,
|
void insert_content(WINDOW *content_win, WINDOW *attachment_win,
|
||||||
json &resp_from_api);
|
json &resp_from_api);
|
||||||
|
|
||||||
|
void komens_print_usage_message() {
|
||||||
|
attron(COLOR_PAIR(COLOR_BLUE));
|
||||||
|
mvprintw(LINES - 2, 0,
|
||||||
|
"Use PageUp and PageDown to scoll down or up a page of items");
|
||||||
|
mvprintw(LINES - 1, 0, "Arrow Keys to navigate (F1 to Exit)");
|
||||||
|
attroff(COLOR_PAIR(COLOR_BLUE));
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
void komens_page(koment_type type) {
|
void komens_page(koment_type type) {
|
||||||
current_allocated = &komens_allocated;
|
current_allocated = &komens_allocated;
|
||||||
json resp_from_api;
|
json resp_from_api;
|
||||||
{
|
{
|
||||||
/*std::ifstream f("test-data/komens.json");
|
|
||||||
resp_from_api = json::parse(f);
|
|
||||||
f.close();*/
|
|
||||||
const char *types[] = {"/api/3/komens/messages/received",
|
const char *types[] = {"/api/3/komens/messages/received",
|
||||||
"/api/3/komens/messages/sent",
|
"/api/3/komens/messages/sent",
|
||||||
"/api/3/komens/messages/noticeboard"};
|
"/api/3/komens/messages/noticeboard"};
|
||||||
@ -148,12 +154,7 @@ void komens_page(koment_type type) {
|
|||||||
resp_from_api["Messages"][item_index(
|
resp_from_api["Messages"][item_index(
|
||||||
current_item(komens_choise_menu.menu))]);
|
current_item(komens_choise_menu.menu))]);
|
||||||
|
|
||||||
attron(COLOR_PAIR(COLOR_BLUE));
|
komens_print_usage_message();
|
||||||
mvprintw(LINES - 2, 0,
|
|
||||||
"Use PageUp and PageDown to scoll down or up a page of items");
|
|
||||||
mvprintw(LINES - 1, 0, "Arrow Keys to navigate (F1 to Exit)");
|
|
||||||
attroff(COLOR_PAIR(COLOR_BLUE));
|
|
||||||
refresh();
|
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while ((c = getch()) != KEY_F(1)) {
|
while ((c = getch()) != KEY_F(1)) {
|
||||||
@ -204,6 +205,7 @@ void komens_page(koment_type type) {
|
|||||||
komens_choise_menu.menu))]["Attachments"][index]["Id"]
|
komens_choise_menu.menu))]["Attachments"][index]["Id"]
|
||||||
.get<std::string>(),
|
.get<std::string>(),
|
||||||
path);
|
path);
|
||||||
|
komens_print_usage_message();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user