| 106 | #ifdef HAVE_NCURSES |
| 107 | #define INTER_STRUCTURE (LINES-12) |
| 108 | static list_part_t *ask_structure_ncurses(disk_t *disk_car,list_part_t *list_part, const int verbose) |
| 109 | { |
| 110 | int offset=0; |
| 111 | int pos_num=0; |
| 112 | list_part_t *pos=list_part; |
| 113 | int rewrite=1; |
| 114 | int old_LINES=LINES; |
| 115 | while(1) |
| 116 | { |
| 117 | int i; |
| 118 | int command; |
| 119 | list_part_t *parts; |
| 120 | int structure_status; |
| 121 | if(old_LINES!=LINES) |
| 122 | { |
| 123 | rewrite=1; |
| 124 | old_LINES=LINES; |
| 125 | } |
| 126 | if(rewrite) |
| 127 | { |
| 128 | aff_copy(stdscr); |
| 129 | wmove(stdscr,4,0); |
| 130 | wprintw(stdscr,"%s",disk_car->description(disk_car)); |
| 131 | mvwaddstr(stdscr,5,0,msg_PART_HEADER); |
| 132 | rewrite=0; |
| 133 | } |
| 134 | structure_status=disk_car->arch->test_structure(list_part); |
| 135 | for(i=0,parts=list_part; |
| 136 | parts!=NULL && i<offset+INTER_STRUCTURE; |
| 137 | i++, parts=parts->next) |
| 138 | { |
| 139 | if(i<offset) |
| 140 | continue; |
| 141 | wmove(stdscr,6+i-offset,0); |
| 142 | wclrtoeol(stdscr); /* before addstr for BSD compatibility */ |
| 143 | if(parts==pos) |
| 144 | wattrset(stdscr, A_REVERSE); |
| 145 | if(structure_status==0 && parts->part->status!=STATUS_DELETED && has_colors()) |
| 146 | wbkgdset(stdscr,' ' | COLOR_PAIR(2)); |
| 147 | if(parts==pos) |
| 148 | waddstr(stdscr, ">"); |
| 149 | else |
| 150 | waddstr(stdscr, " "); |
| 151 | aff_part(stdscr, AFF_PART_STATUS, disk_car, parts->part); |
| 152 | if(structure_status==0 && parts->part->status!=STATUS_DELETED && has_colors()) |
| 153 | wbkgdset(stdscr,' ' | COLOR_PAIR(0)); |
| 154 | if(parts==pos) |
| 155 | { |
| 156 | char buffer_part_size[100]; |
| 157 | wattroff(stdscr, A_REVERSE); |
| 158 | wmove(stdscr,LINES-1,0); |
| 159 | wclrtoeol(stdscr); /* before addstr for BSD compatibility */ |
| 160 | if(parts->part->info[0]!='\0') |
| 161 | { |
| 162 | wprintw(stdscr,"%s, ",parts->part->info); |
| 163 | } |
| 164 | size_to_unit(parts->part->part_size, buffer_part_size); |
| 165 | wprintw(stdscr,"%s", buffer_part_size); |
no test coverage detected