use current values for start/size/bsize/fsize as defaults when editing

disklabel partitions.
This commit is contained in:
grant 2002-08-12 02:45:17 +00:00
parent dbf388bc4f
commit 6b0d856a30
3 changed files with 33 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.en,v 1.60 2002/08/12 02:22:52 grant Exp $ */
/* $NetBSD: menus.mi.en,v 1.61 2002/08/12 02:45:17 grant Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -155,8 +155,10 @@ menu edfspart, title "Change what?", exit, y=14;
option "Start/size", action
{ int start, size;
msg_display_add(MSG_defaultunit, multname);
start = getpartoff(MSG_start, 0);
size = getpartsize(MSG_size, start, 0);
start = getpartoff(MSG_start,
bsdlabel[editpart].pi_offset);
size = getpartsize(MSG_size, start,
bsdlabel[editpart].pi_size);
if (size == -1)
size = dlsize - start;
bsdlabel[editpart].pi_offset = start;
@ -170,10 +172,14 @@ menu edfspart, title "Change what?", exit, y=14;
process_menu (MENU_ok);
return FALSE;
}
msg_prompt_add (MSG_bsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_bsize);
msg_prompt_add (MSG_bsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_bsize = i;
msg_prompt_add (MSG_fsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_fsize);
msg_prompt_add (MSG_fsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_fsize = i;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.fr,v 1.40 2002/08/12 02:22:52 grant Exp $ */
/* $NetBSD: menus.mi.fr,v 1.41 2002/08/12 02:45:18 grant Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -145,8 +145,10 @@ menu edfspart, title "Changer quoi?", exit, y=14;
option "Offset/taille", action
{ int start, size;
msg_display_add(MSG_defaultunit, multname);
start = getpartoff(MSG_start, 0);
size = getpartsize(MSG_size, start, 0);
start = getpartoff(MSG_start,
bsdlabel[editpart].pi_offset);
size = getpartsize(MSG_size, start,
bsdlabel[editpart].pi_size);
if (size == -1)
size = dlsize - start;
bsdlabel[editpart].pi_offset = start;
@ -160,10 +162,14 @@ menu edfspart, title "Changer quoi?", exit, y=14;
process_menu (MENU_ok);
return FALSE;
}
msg_prompt_add (MSG_bsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_bsize);
msg_prompt_add (MSG_bsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_bsize = i;
msg_prompt_add (MSG_fsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_fsize);
msg_prompt_add (MSG_fsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_fsize = i;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.pl,v 1.11 2002/08/12 02:22:52 grant Exp $ */
/* $NetBSD: menus.mi.pl,v 1.12 2002/08/12 02:45:18 grant Exp $ */
/* Based on english version: */
/* NetBSD: menus.mi.en,v 1.49 2002/04/04 14:26:44 ad Exp */
@ -157,8 +157,10 @@ menu edfspart, title "Co zmienic?", exit, y=14;
option "Przesuniecie/rozmiar", action
{ int start, size;
msg_display_add(MSG_defaultunit, multname);
start = getpartoff(MSG_start, 0);
size = getpartsize(MSG_size, start, 0);
start = getpartoff(MSG_start,
bsdlabel[editpart].pi_offset);
size = getpartsize(MSG_size, start,
bsdlabel[editpart].pi_size);
if (size == -1)
size = dlsize - start;
bsdlabel[editpart].pi_offset = start;
@ -172,10 +174,14 @@ menu edfspart, title "Co zmienic?", exit, y=14;
process_menu (MENU_ok);
return FALSE;
}
msg_prompt_add (MSG_bsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_bsize);
msg_prompt_add (MSG_bsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_bsize = i;
msg_prompt_add (MSG_fsize, NULL, buf, 40);
snprintf(buf, sizeof(buf), "%d",
bsdlabel[editpart].pi_fsize);
msg_prompt_add (MSG_fsize, buf, buf, 40);
i = atoi(buf);
bsdlabel[editpart].pi_fsize = i;
};