summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.c
diff options
context:
space:
mode:
authorFrancesco Cosoleto2011-02-20 08:36:16 +0100
committerKarel Zak2011-02-21 17:04:16 +0100
commit87672e98ec8696c4c078461cc0dfeb1cae1338a7 (patch)
tree46c212b13dbddf5c3ba8a865253658914b4687e5 /fdisk/cfdisk.c
parentscriptreplay: bug in argument check (diff)
downloadkernel-qcow2-util-linux-87672e98ec8696c4c078461cc0dfeb1cae1338a7.tar.gz
kernel-qcow2-util-linux-87672e98ec8696c4c078461cc0dfeb1cae1338a7.tar.xz
kernel-qcow2-util-linux-87672e98ec8696c4c078461cc0dfeb1cae1338a7.zip
cfdisk: remove unused vertical menu direction code
It isn't used and doesn't seem very important, as well as requires more work to run properly. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Diffstat (limited to 'fdisk/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c56
1 files changed, 5 insertions, 51 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 7faa44a37..d4a1b337a 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -1006,8 +1006,6 @@ find_logical(int i) {
*/
/* Constants for menuType parameter of menuSelect function */
-#define MENU_HORIZ 1
-#define MENU_VERT 2
#define MENU_ACCEPT_OTHERS 4
#define MENU_BUTTON 8
/* Miscellenous constants */
@@ -1085,18 +1083,6 @@ menuUpdate( int y, int x, struct MenuItem *menuItems, int itemLength,
if( current == i ) /*attroff( A_REVERSE )*/ standend ();
/* Calculate position for the next item */
- if( menuType & MENU_VERT )
- {
- y += 1;
- if( y >= WARNING_START )
- {
- y = ymargin;
- x += itemLength + MENU_SPACING;
- if( menuType & MENU_BUTTON ) x += 2;
- }
- }
- else
- {
x += itemLength + MENU_SPACING;
if( menuType & MENU_BUTTON ) x += 2;
if( x > COLUMNS - lmargin - 12 )
@@ -1104,7 +1090,6 @@ menuUpdate( int y, int x, struct MenuItem *menuItems, int itemLength,
x = lmargin;
y ++ ;
}
- }
}
/* Print the description of selected item */
@@ -1121,11 +1106,6 @@ menuSelect( int y, int x, struct MenuItem *menuItems, int itemLength,
char *available, int menuType, int menuDefault ) {
int i, ylast = y, key = 0, current = menuDefault;
- if( !( menuType & ( MENU_HORIZ | MENU_VERT ) ) ) {
- print_warning(_("Menu without direction. Defaulting to horizontal."));
- menuType |= MENU_HORIZ;
- }
-
/* Make sure that the current is one of the available items */
while( !strchr(available, menuItems[current].key) ) {
current ++ ;
@@ -1201,41 +1181,16 @@ menuSelect( int y, int x, struct MenuItem *menuItems, int itemLength,
if (key == DOWNKEY || key == DOWNKEYVI) /* ^N or j */
key = MENU_DOWN;
- if (key == MENU_UP) {
- if( menuType & MENU_VERT ) {
- do {
- current -- ;
- if( current < 0 )
- while( menuItems[current+1].key )
- current ++ ;
- } while( !strchr( available, menuItems[current].key ));
- key = 0;
- }
- }
-
- if (key == MENU_DOWN) {
- if( menuType & MENU_VERT ) {
- do {
- current ++ ;
- if( !menuItems[current].key ) current = 0 ;
- } while( !strchr( available, menuItems[current].key ));
- key = 0;
- }
- }
-
if (key == MENU_RIGHT) {
- if( menuType & MENU_HORIZ ) {
do {
current ++ ;
if( !menuItems[current].key )
current = 0 ;
} while( !strchr( available, menuItems[current].key ));
key = 0;
- }
}
if (key == MENU_LEFT) {
- if( menuType & MENU_HORIZ ) {
do {
current -- ;
if( current < 0 ) {
@@ -1244,7 +1199,6 @@ menuSelect( int y, int x, struct MenuItem *menuItems, int itemLength,
}
} while( !strchr( available, menuItems[current].key ));
key = 0;
- }
}
/* Should all keys to be accepted? */
@@ -1286,7 +1240,7 @@ menuContinue(void) {
};
menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X,
- menuContinueBtn, 0, "c", MENU_HORIZ | MENU_ACCEPT_OTHERS, 0 );
+ menuContinueBtn, 0, "c", MENU_ACCEPT_OTHERS, 0 );
}
/* Function menuSelect takes way too many parameters *
@@ -1305,7 +1259,7 @@ menuSimple(struct MenuItem *menuItems, int menuDefault) {
}
available[i] = 0;
return menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuItems, itemLength,
- available, MENU_HORIZ | MENU_BUTTON, menuDefault);
+ available, MENU_BUTTON, menuDefault);
}
/* End of command menu support code */
@@ -2688,15 +2642,15 @@ do_curses_fdisk(void) {
if (p_info[cur_part].id == FREE_SPACE) {
s = ((opentype == O_RDWR) ? "hnpquW" : "hnpqu");
command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
- s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 5);
+ s, MENU_BUTTON | MENU_ACCEPT_OTHERS, 5);
} else if (p_info[cur_part].id > 0) {
s = ((opentype == O_RDWR) ? "bdhmpqtuW" : "bdhmpqtu");
command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
- s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, is_first_run ? 7 : 0);
+ s, MENU_BUTTON | MENU_ACCEPT_OTHERS, is_first_run ? 7 : 0);
} else {
s = ((opentype == O_RDWR) ? "hpquW" : "hpqu");
command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
- s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
+ s, MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
}
is_first_run = FALSE;
switch ( command ) {