summaryrefslogtreecommitdiffstats
path: root/src/chgtype.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-04-14 20:34:19 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-04-14 20:34:19 +0200
commit6cad72ff7653b283b1a7d78244053b40e3d9b5a3 (patch)
treea2632576f0baaa458dcfafae5f1d7d821674a373 /src/chgtype.c
parent9f85b6533c4793105ccaa86294e290e347f94836 (diff)
Allow left, right and enter key while selecting a partition type
Diffstat (limited to 'src/chgtype.c')
-rw-r--r--src/chgtype.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/chgtype.c b/src/chgtype.c
index 17722ef..af7e998 100644
--- a/src/chgtype.c
+++ b/src/chgtype.c
@@ -211,6 +211,13 @@ static void change_part_type_ncurses2(const disk_t *disk_car, partition_t *parti
offset++;
break;
case KEY_LEFT:
+ if(current_element_num > INTER_CHGTYPE)
+ current_element_num-=INTER_CHGTYPE;
+ else
+ current_element_num=0;
+ if(current_element_num < offset)
+ offset=current_element_num;
+ break;
case KEY_PPAGE:
if(current_element_num > 3*INTER_CHGTYPE-1)
current_element_num-=3*INTER_CHGTYPE-1;
@@ -220,16 +227,27 @@ static void change_part_type_ncurses2(const disk_t *disk_car, partition_t *parti
offset=current_element_num;
break;
case KEY_RIGHT:
+ if(current_element_num+INTER_CHGTYPE < intr_nbr_line-1)
+ current_element_num+=INTER_CHGTYPE;
+ else
+ current_element_num=intr_nbr_line-1;
+ if(current_element_num >= offset+3*INTER_CHGTYPE)
+ offset=current_element_num-3*INTER_CHGTYPE+1;
+ break;
case KEY_NPAGE:
if(current_element_num+3*INTER_CHGTYPE-1 < intr_nbr_line-1)
current_element_num+=3*INTER_CHGTYPE-1;
else
current_element_num=intr_nbr_line-1;
if(current_element_num >= offset+3*INTER_CHGTYPE)
- offset=current_element_num-1*INTER_CHGTYPE+1;
+ offset=current_element_num-3*INTER_CHGTYPE+1;
break;
case 'Q':
case 'q':
+ case key_CR:
+#ifdef PADENTER
+ case PADENTER:
+#endif
partition->arch->set_part_type(partition, part_name[current_element_num].index);
return;
}