Changeset 2771 in MondoRescue
- Timestamp:
- Apr 22, 2011, 1:49:03 AM (14 years ago)
- Location:
- branches/2.2.9/mondo/src/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-devices.c
r2769 r2771 35 35 /*@unused@*/ 36 36 //static char cvsid[] = "$Id$"; 37 // 38 39 extern char *which_compression_type(); 37 40 38 41 extern int g_current_media_number; … … 2166 2169 char *sz_size; 2167 2170 char *command; 2171 char *compression_type = NULL; 2168 2172 char *comment; 2169 2173 char *prompt; … … 2223 2227 bkpinfo->manual_cd_tray = TRUE; 2224 2228 } 2229 } 2230 if ((compression_type = which_compression_type()) == NULL) { 2231 log_to_screen("User has chosen not to backup the PC"); 2232 finish(1); 2225 2233 } 2226 2234 if ((bkpinfo->compression_level = … … 2410 2418 } 2411 2419 if (archiving_to_media) { 2420 if ((compression_type = which_compression_type()) == NULL) { 2421 log_to_screen("User has chosen not to backup the PC"); 2422 finish(1); 2423 } 2412 2424 if ((bkpinfo->compression_level = 2413 2425 which_compression_level()) == -1) { … … 2444 2456 } 2445 2457 if (!bkpinfo->restore_data) { 2458 if ((compression_type = which_compression_type()) == NULL) { 2459 log_to_screen("User has chosen not to backup the PC"); 2460 finish(1); 2461 } 2446 2462 if ((bkpinfo->compression_level = 2447 2463 which_compression_level()) == -1) { … … 2575 2591 } 2576 2592 if (archiving_to_media) { 2593 if ((compression_type = which_compression_type()) == NULL) { 2594 log_to_screen("User has chosen not to backup the PC"); 2595 finish(1); 2596 } 2577 2597 if ((bkpinfo->compression_level = 2578 2598 which_compression_level()) == -1) { … … 2732 2752 #endif 2733 2753 bkpinfo->backup_data = TRUE; 2754 if (strcmp(compression_type,"lzo") == 0) { 2755 strcpy(bkpinfo->zip_exe, "lzop"); 2756 strcpy(bkpinfo->zip_suffix, "lzo"); 2757 } else if (strcmp(compression_type,"gzip") == 0) { 2758 strcpy(bkpinfo->zip_exe, "gzip"); 2759 strcpy(bkpinfo->zip_suffix, "gz"); 2760 //} else if (strcmp(compression_type,"lzma") == 0) { 2761 //strcpy(bkpinfo->zip_exe, "xy"); 2762 //strcpy(bkpinfo->zip_suffix, "xy"); 2763 } else if (strcmp(compression_type,"bzip2") == 0) { 2764 strcpy(bkpinfo->zip_exe, "bzip2"); 2765 strcpy(bkpinfo->zip_suffix, "bz2"); 2766 } else { 2767 bkpinfo->zip_exe[0] = bkpinfo->zip_suffix[0] = '\0'; 2768 } 2734 2769 bkpinfo->verify_data = 2735 2770 ask_me_yes_or_no -
branches/2.2.9/mondo/src/common/newt-specific.c
r2769 r2771 1361 1361 1362 1362 1363 1364 1365 /** 1366 * Ask the user which compression type they would like to use. 1367 * The choices are "bzip2", "gzip", "lzo". NULL for exit 1368 */ 1369 char *which_compression_type() { 1370 1371 /*@ char ************************************************************ */ 1372 char *output = NULL; 1373 1374 1375 /*@ newt ************************************************************ */ 1376 1377 newtComponent b1; 1378 newtComponent b2; 1379 newtComponent b3; 1380 //newtComponent b4; 1381 newtComponent b5; 1382 newtComponent b_res; 1383 newtComponent myForm; 1384 1385 newtDrawRootText(18, 0, WELCOME_STRING); 1386 newtPushHelpLine 1387 (" Please specify the type of compression that you want."); 1388 newtCenteredWindow(34, 13, "Type of compression?"); 1389 b1 = newtButton(4, 1, "bzip2"); 1390 b2 = newtButton(18, 1, "gzip"); 1391 b3 = newtButton(4, 5, "lzo"); 1392 //b4 = newtButton(18, 5, "lzma"); 1393 b5 = newtButton(4, 9, " Exit "); 1394 myForm = newtForm(NULL, NULL, 0); 1395 newtFormAddComponents(myForm, b1, b3, b2, b5, NULL); 1396 b_res = newtRunForm(myForm); 1397 newtFormDestroy(myForm); 1398 newtPopWindow(); 1399 if (b_res == b1) { 1400 mr_asprintf(&output, "%s", "bzip2"); 1401 } else if (b_res == b2) { 1402 mr_asprintf(&output, "%s", "gzip"); 1403 } else if (b_res == b3) { 1404 mr_asprintf(&output, "%s", "lzo"); 1405 //} else if (b_res == b4) { 1406 //mr_asprintf(&output, "%s", "lzma"); 1407 } 1408 newtPopHelpLine(); 1409 return(output); 1410 } 1363 1411 1364 1412
Note:
See TracChangeset
for help on using the changeset viewer.