Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 2 additions & 48 deletions src/out_curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,36 +305,6 @@ static void draw_details(void)
mvaddch(row, (i * DETAILS_COLS - 1), ACS_VLINE);
}

static void print_message(const char *text)
{
int i, y = (rows/2) - 2;
int len = strlen(text);
int x = (cols/2) - (len / 2);

attrset(A_STANDOUT);
mvaddch(y - 2, x - 1, ACS_ULCORNER);
mvaddch(y + 2, x - 1, ACS_LLCORNER);
mvaddch(y - 2, x + len, ACS_URCORNER);
mvaddch(y + 2, x + len, ACS_LRCORNER);

for (i = 0; i < 3; i++) {
mvaddch(y - 1 + i, x + len, ACS_VLINE);
mvaddch(y - 1 + i, x - 1 ,ACS_VLINE);
}

for (i = 0; i < len; i++) {
mvaddch(y - 2, x + i, ACS_HLINE);
mvaddch(y - 1, x + i, ' ');
mvaddch(y + 1, x + i, ' ');
mvaddch(y + 2, x + i, ACS_HLINE);
}

mvaddstr(y, x, text);
attroff(A_STANDOUT);

row = y + 2;
}

static void draw_help(void)
{
#define HW 46
Expand Down Expand Up @@ -1081,9 +1051,7 @@ static void curses_draw(void)

draw_statusbar();

if (quit_mode)
print_message(" Really Quit? (y/n) ");
else if (print_help) {
if (print_help) {
if (help_page == 0)
draw_help();
#if 0
Expand Down Expand Up @@ -1112,27 +1080,13 @@ static int handle_input(int ch)
switch (ch)
{
case 'q':
if (print_help)
print_help = 0;
else
quit_mode = quit_mode ? 0 : 1;
return 1;
exit(0);

case 0x1b:
quit_mode = 0;
print_help = 0;
return 1;

case 'y':
if (quit_mode)
exit(0);
break;

case 'n':
if (quit_mode)
quit_mode = 0;
return 1;

case 12:
case KEY_CLEAR:
#ifdef HAVE_REDRAWWIN
Expand Down