msg.c (8438) | msg.c (8556) |
---|---|
1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last program in the `sysinstall' line - the next 5 * generation being essentially a complete rewrite. 6 * | 1/* 2 * The new sysinstall program. 3 * 4 * This is probably the last program in the `sysinstall' line - the next 5 * generation being essentially a complete rewrite. 6 * |
7 * $Id: msg.c,v 1.9 1995/05/08 06:06:26 jkh Exp $ | 7 * $Id: msg.c,v 1.10 1995/05/11 06:10:56 jkh Exp $ |
8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright --- 150 unchanged lines hidden (view full) --- 166 char *errstr; 167 168 errstr = (char *)safe_malloc(FILENAME_MAX); 169 va_start(args, fmt); 170 vsnprintf(errstr, FILENAME_MAX, fmt, args); 171 va_end(args); 172 use_helpline(NULL); 173 use_helpfile(NULL); | 8 * 9 * Copyright (c) 1995 10 * Jordan Hubbard. All rights reserved. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright --- 150 unchanged lines hidden (view full) --- 166 char *errstr; 167 168 errstr = (char *)safe_malloc(FILENAME_MAX); 169 va_start(args, fmt); 170 vsnprintf(errstr, FILENAME_MAX, fmt, args); 171 va_end(args); 172 use_helpline(NULL); 173 use_helpfile(NULL); |
174 dialog_mesgbox("User Attention Requested", errstr, -1, -1); | 174 dialog_notify(errstr); |
175 free(errstr); 176} 177 178/* Put up a message in a popup information box */ 179void 180msgNotify(char *fmt, ...) 181{ 182 va_list args; 183 char *errstr; | 175 free(errstr); 176} 177 178/* Put up a message in a popup information box */ 179void 180msgNotify(char *fmt, ...) 181{ 182 va_list args; 183 char *errstr; |
184 WINDOW *w; |
|
184 185 errstr = (char *)safe_malloc(FILENAME_MAX); 186 va_start(args, fmt); 187 vsnprintf(errstr, FILENAME_MAX, fmt, args); 188 va_end(args); 189 use_helpline(NULL); 190 use_helpfile(NULL); | 185 186 errstr = (char *)safe_malloc(FILENAME_MAX); 187 va_start(args, fmt); 188 vsnprintf(errstr, FILENAME_MAX, fmt, args); 189 va_end(args); 190 use_helpline(NULL); 191 use_helpfile(NULL); |
192 w = dupwin(newscr); |
|
191 dialog_msgbox("Information Dialog", errstr, -1, -1, 0); | 193 dialog_msgbox("Information Dialog", errstr, -1, -1, 0); |
194 touchwin(w); 195 wrefresh(w); 196 delwin(w); |
|
192 free(errstr); 193} 194 195/* Put up a message in a popup yes/no box and return 1 for YES, 0 for NO */ 196int 197msgYesNo(char *fmt, ...) 198{ 199 va_list args; 200 char *errstr; 201 int ret; | 197 free(errstr); 198} 199 200/* Put up a message in a popup yes/no box and return 1 for YES, 0 for NO */ 201int 202msgYesNo(char *fmt, ...) 203{ 204 va_list args; 205 char *errstr; 206 int ret; |
207 WINDOW *w; |
|
202 203 errstr = (char *)safe_malloc(FILENAME_MAX); 204 va_start(args, fmt); 205 vsnprintf(errstr, FILENAME_MAX, fmt, args); 206 va_end(args); 207 use_helpline(NULL); 208 use_helpfile(NULL); | 208 209 errstr = (char *)safe_malloc(FILENAME_MAX); 210 va_start(args, fmt); 211 vsnprintf(errstr, FILENAME_MAX, fmt, args); 212 va_end(args); 213 use_helpline(NULL); 214 use_helpfile(NULL); |
215 w = dupwin(newscr); |
|
209 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); | 216 ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1); |
217 touchwin(w); 218 wrefresh(w); 219 delwin(w); |
|
210 free(errstr); 211 return ret; 212} 213 214/* Put up a message in an input box and return the value */ 215char * 216msgGetInput(char *buf, char *fmt, ...) 217{ 218 va_list args; 219 char *errstr; 220 static char input_buffer[256]; 221 int rval; | 220 free(errstr); 221 return ret; 222} 223 224/* Put up a message in an input box and return the value */ 225char * 226msgGetInput(char *buf, char *fmt, ...) 227{ 228 va_list args; 229 char *errstr; 230 static char input_buffer[256]; 231 int rval; |
232 WINDOW *w; |
|
222 223 errstr = (char *)safe_malloc(FILENAME_MAX); 224 va_start(args, fmt); 225 vsnprintf(errstr, FILENAME_MAX, fmt, args); 226 va_end(args); 227 use_helpline(NULL); 228 use_helpfile(NULL); 229 if (buf) 230 strcpy(input_buffer, buf); 231 else 232 input_buffer[0] = '\0'; | 233 234 errstr = (char *)safe_malloc(FILENAME_MAX); 235 va_start(args, fmt); 236 vsnprintf(errstr, FILENAME_MAX, fmt, args); 237 va_end(args); 238 use_helpline(NULL); 239 use_helpfile(NULL); 240 if (buf) 241 strcpy(input_buffer, buf); 242 else 243 input_buffer[0] = '\0'; |
244 w = dupwin(newscr); |
|
233 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer); | 245 rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer); |
246 touchwin(w); 247 wrefresh(w); 248 delwin(w); |
|
234 free(errstr); 235 if (!rval) 236 return input_buffer; 237 else 238 return NULL; 239} 240 241/* Write something to the debugging port */ --- 14 unchanged lines hidden --- | 249 free(errstr); 250 if (!rval) 251 return input_buffer; 252 else 253 return NULL; 254} 255 256/* Write something to the debugging port */ --- 14 unchanged lines hidden --- |