Commit a4c8418c authored by Christoffer Ackelman's avatar Christoffer Ackelman

Changed yes/no prompts in wb to match the one in rt_ini.

parent 7ead3dc2
...@@ -2835,15 +2835,15 @@ int utl_show_object(ldh_tSesContext ldhses, char* windowstring, ...@@ -2835,15 +2835,15 @@ int utl_show_object(ldh_tSesContext ldhses, char* windowstring,
int utl_revert(ldh_tSesContext ldhses, int confirm) int utl_revert(ldh_tSesContext ldhses, int confirm)
{ {
static char yes_or_no[200]; char ans;
int sts; int sts;
if (confirm) { if (confirm) {
// TODO // TODO
printf("(Y/N: "); printf("[Y/n]: ");
sts = scanf("%s", yes_or_no); scanf("%c", &ans);
if (!((yes_or_no[0] == 'Y') || (yes_or_no[0] == 'y'))) if (!(ans == 'Y' || ans == 'y'))
return FOE__SUCCESS; return FOE__SUCCESS;
} }
...@@ -4906,7 +4906,6 @@ static int utl_set_parameter(pwr_sAttrRef* arp, ldh_tSesContext ldhses, ...@@ -4906,7 +4906,6 @@ static int utl_set_parameter(pwr_sAttrRef* arp, ldh_tSesContext ldhses,
char* parameter, char* invaluestr, int element, utl_ctx utlctx) char* parameter, char* invaluestr, int element, utl_ctx utlctx)
{ {
char* valuestr; char* valuestr;
static char yes_or_no[200];
int sts, size, k; int sts, size, k;
int parsize; int parsize;
char* object_par = NULL; char* object_par = NULL;
...@@ -5229,13 +5228,14 @@ static int utl_set_parameter(pwr_sAttrRef* arp, ldh_tSesContext ldhses, ...@@ -5229,13 +5228,14 @@ static int utl_set_parameter(pwr_sAttrRef* arp, ldh_tSesContext ldhses,
if (utlctx->confirm) { if (utlctx->confirm) {
printf("%s ", logstr); printf("%s ", logstr);
// TODO // TODO
printf("(Y/N/Q/A): "); printf("[Y/n/q/a]: ");
sts = scanf("%s", yes_or_no); char ans;
if (((yes_or_no[0] == 'Q') || (yes_or_no[0] == 'q'))) sts = scanf("%c", &ans);
if ((ans == 'Q' || ans == 'q'))
return FOE__ABORTSEARCH; return FOE__ABORTSEARCH;
else if (((yes_or_no[0] == 'A') || (yes_or_no[0] == 'a'))) else if ((ans == 'A' || ans == 'a'))
utlctx->confirm = 0; utlctx->confirm = 0;
else if (!((yes_or_no[0] == 'Y') || (yes_or_no[0] == 'y'))) else if (!(ans == 'Y' || ans == 'y'))
continue; continue;
} }
if (utlctx->log) if (utlctx->log)
...@@ -8809,7 +8809,6 @@ int utl_disconnect(ldh_tSesContext ldhses, char* object_name) ...@@ -8809,7 +8809,6 @@ int utl_disconnect(ldh_tSesContext ldhses, char* object_name)
static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses, static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses,
utl_ctx utlctx, unsigned long dum1, unsigned long dum2, unsigned long dum3) utl_ctx utlctx, unsigned long dum1, unsigned long dum2, unsigned long dum3)
{ {
static char yes_or_no[200];
pwr_tOName hier_name; pwr_tOName hier_name;
int sts, size; int sts, size;
...@@ -8821,13 +8820,14 @@ static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses, ...@@ -8821,13 +8820,14 @@ static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses,
if (utlctx->confirm) { if (utlctx->confirm) {
printf("Delete object %s ", hier_name); printf("Delete object %s ", hier_name);
// TODO // TODO
printf("(Y/N/Q/A): "); printf("[Y/n/q/a]: ");
sts = scanf("%s", yes_or_no); char ans;
if (((yes_or_no[0] == 'Q') || (yes_or_no[0] == 'q'))) scanf("%c", &ans);
if ((ans == 'Q' || ans == 'q'))
return FOE__ABORTSEARCH; return FOE__ABORTSEARCH;
else if (((yes_or_no[0] == 'A') || (yes_or_no[0] == 'a'))) else if ((ans == 'A' || ans == 'a'))
utlctx->confirm = 0; utlctx->confirm = 0;
else if (!((yes_or_no[0] == 'Y') || (yes_or_no[0] == 'y'))) else if (!(ans == 'Y' || ans == 'y'))
return FOE__SUCCESS; return FOE__SUCCESS;
} }
...@@ -8863,7 +8863,6 @@ static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses, ...@@ -8863,7 +8863,6 @@ static int utl_object_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses,
static int utl_tree_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses, static int utl_tree_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses,
utl_ctx utlctx, unsigned long dum1, unsigned long dum2, unsigned long dum3) utl_ctx utlctx, unsigned long dum1, unsigned long dum2, unsigned long dum3)
{ {
static char yes_or_no[200];
pwr_tOName hier_name; pwr_tOName hier_name;
int sts, size; int sts, size;
...@@ -8875,9 +8874,10 @@ static int utl_tree_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses, ...@@ -8875,9 +8874,10 @@ static int utl_tree_delete(pwr_tObjid Objdid, ldh_tSesContext ldhses,
if (utlctx->confirm) { if (utlctx->confirm) {
printf("Delete tree %s ", hier_name); printf("Delete tree %s ", hier_name);
// TODO // TODO
printf("(Y/N/Q): "); printf("[Y/n]: ");
sts = scanf("%s", yes_or_no); char ans;
if (!((yes_or_no[0] == 'Y') || (yes_or_no[0] == 'y'))) scanf("%c", &ans);
if (!(ans == 'Y' || ans == 'y'))
return FOE__SUCCESS; return FOE__SUCCESS;
} }
...@@ -9077,7 +9077,6 @@ int utl_delete_volume(ldh_tWBContext ldhwb, char* name, int confirm, int log) ...@@ -9077,7 +9077,6 @@ int utl_delete_volume(ldh_tWBContext ldhwb, char* name, int confirm, int log)
{ {
utl_ctx utlctx; utl_ctx utlctx;
int sts; int sts;
static char yes_or_no[200];
pwr_tVolumeId volid; pwr_tVolumeId volid;
/* Get volid for the volume */ /* Get volid for the volume */
...@@ -9092,9 +9091,10 @@ int utl_delete_volume(ldh_tWBContext ldhwb, char* name, int confirm, int log) ...@@ -9092,9 +9091,10 @@ int utl_delete_volume(ldh_tWBContext ldhwb, char* name, int confirm, int log)
if (utlctx->confirm) { if (utlctx->confirm) {
printf("Delete volume %s ", name); printf("Delete volume %s ", name);
// TODO // TODO
printf("(Y/N/Q): "); printf("[Y/n]: ");
sts = scanf("%s", yes_or_no); char ans;
if (!((yes_or_no[0] == 'Y') || (yes_or_no[0] == 'y'))) scanf("%c", &ans);
if (!(ans == 'Y' || ans == 'y'))
return FOE__SUCCESS; return FOE__SUCCESS;
} }
......
...@@ -6037,7 +6037,6 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list, ...@@ -6037,7 +6037,6 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list,
ccm_sArg *arg_p2, *arg_p3; ccm_sArg *arg_p2, *arg_p3;
int sts; int sts;
int cancel; int cancel;
char str[80];
if (!(arg_count == 2 || arg_count == 3)) if (!(arg_count == 2 || arg_count == 3))
return CCM__ARGMISM; return CCM__ARGMISM;
...@@ -6056,13 +6055,13 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list, ...@@ -6056,13 +6055,13 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list,
wnav_get_stored_wnav(&wnav); wnav_get_stored_wnav(&wnav);
if (wnav->window_type == wnav_eWindowType_No) { if (wnav->window_type == wnav_eWindowType_No) {
printf("%s", arg_p2->value_string); printf("%s", arg_p2->value_string);
printf(" (y/n/q) : "); printf(" [Y/n/q]: ");
scanf("%s", str); char ans;
if (streq(str, "Y") || streq(str, "y") scanf("%c", &ans);
|| streq(str, "")) { if (ans == 'Y' || ans == 'y' || ans == '\n') {
sts = 1; sts = 1;
cancel = 0; cancel = 0;
} else if (streq(str, "Q") || streq(str, "q")) { } else if (ans == 'Q' || ans == 'q') {
sts = 0; sts = 0;
cancel = 1; cancel = 1;
} else { } else {
...@@ -6078,10 +6077,10 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list, ...@@ -6078,10 +6077,10 @@ static int wnav_confirmdialog_func(void* filectx, ccm_sArg* arg_list,
wnav_get_stored_wnav(&wnav); wnav_get_stored_wnav(&wnav);
if (wnav->window_type == wnav_eWindowType_No) { if (wnav->window_type == wnav_eWindowType_No) {
printf("%s", arg_p2->value_string); printf("%s", arg_p2->value_string);
printf(" (y/n) : "); printf(" [Y/n]: ");
scanf("%s", str); char ans;
if (streq(str, "Y") || streq(str, "y") scanf("%c", &ans);
|| streq(str, "")) { if (ans == 'Y' || ans == 'y' || ans == '\n') {
sts = 1; sts = 1;
cancel = 0; cancel = 0;
} else { } else {
...@@ -6106,7 +6105,6 @@ static int wnav_continuedialog_func(void* filectx, ccm_sArg* arg_list, ...@@ -6106,7 +6105,6 @@ static int wnav_continuedialog_func(void* filectx, ccm_sArg* arg_list,
WNav* wnav; WNav* wnav;
ccm_sArg* arg_p2; ccm_sArg* arg_p2;
int sts; int sts;
char str[80];
if (arg_count != 2) if (arg_count != 2)
return CCM__ARGMISM; return CCM__ARGMISM;
...@@ -6120,9 +6118,10 @@ static int wnav_continuedialog_func(void* filectx, ccm_sArg* arg_list, ...@@ -6120,9 +6118,10 @@ static int wnav_continuedialog_func(void* filectx, ccm_sArg* arg_list,
wnav_get_stored_wnav(&wnav); wnav_get_stored_wnav(&wnav);
if (wnav->window_type == wnav_eWindowType_No) { if (wnav->window_type == wnav_eWindowType_No) {
printf("%s", arg_p2->value_string); printf("%s", arg_p2->value_string);
printf("\nDo you want to continue ? (y/n) : "); printf("\nDo you want to continue ? [Y/n]: ");
scanf("%s", str); char ans;
if (streq(str, "Y") || streq(str, "y") || streq(str, "")) scanf("%c", &ans);
if (ans == 'Y' || ans == 'y' || ans == '\n')
sts = 1; sts = 1;
else else
sts = 0; sts = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment