Ignore:
Timestamp:
Aug 26, 2007, 12:26:06 PM (14 years ago)
Author:
Bruno Cornec
Message:

Use of conf file entries (iso_burning_*, media_device, media_size)
and adapatation of the rest of the code to that (including bkpinfo)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/newt-specific.c

    r1549 r1594  
    698698
    699699    /*@ buffers ********************************************************** */
    700     char *blurb = NULL;
    701     char *original_contents = NULL;
    702700    bool ret = TRUE;
     701    size_t n = 0;
    703702
    704703    assert_string_is_neither_NULL_nor_zerolength(title);
     
    706705    assert(output != NULL);
    707706
     707    n = strlen(output) + 1;
    708708    if (g_text_mode) {
    709709        printf
    710710            ("---promptstring---1--- %s\n---promptstring---2--- %s\n---promptstring---Q---\n-->  ",
    711711             title, b);
    712         (void) fgets(output, maxsize, stdin);
    713         if (output[strlen(output) - 1] == '\n')
     712        mr_getline(&output, &n, stdin);
     713        if ((strlen(output) > 1) && (output[strlen(output) - 1] == '\n')) {
    714714            output[strlen(output) - 1] = '\0';
     715        }
    715716        return(ret);
    716717    }
    717     mr_asprintf(&blurb, b);
    718     text = newtTextboxReflowed(2, 1, blurb, 48, 5, 5, 0);
    719     mr_asprintf(&original_contents, output);
    720     output[0] = '\0';
     718
     719    text = newtTextboxReflowed(2, 1, b, 48, 5, 5, 0);
    721720    type_here =
    722721        newtEntry(2, newtTextboxGetNumLines(text) + 2,
    723                   original_contents, 50,
    724 #ifdef __cplusplus
    725                   0, NEWT_FLAG_RETURNEXIT
    726 #else
     722                  output, 50,
    727723                  (void *) &entry_value, NEWT_FLAG_RETURNEXIT
    728 #endif
    729724        );
    730725    b_1 = newtButton(6, newtTextboxGetNumLines(text) + 4, _("  OK  "));
     
    736731    center_string(blurb, 80);
    737732    */
    738     newtPushHelpLine(blurb);
    739     mr_free(blurb);
     733    newtPushHelpLine(b);
    740734
    741735    b_res = newtRunForm(myForm);
    742     strcpy(output, entry_value);
    743736    newtPopHelpLine();
    744737    if (b_res == b_2) {
    745         strcpy(output, original_contents);
    746738        ret = FALSE;
     739    } else {
     740        mr_allocstr(output, newtEntryGetValue(entry_value));
    747741    }
    748742    newtFormDestroy(myForm);
    749743    newtPopWindow();
    750     mr_free(original_contents);
    751744    return(ret);
    752745}
Note: See TracChangeset for help on using the changeset viewer.