Changeset 8359

Show
Ignore:
Timestamp:
03/02/12 16:44:38 (4 months ago)
Author:
westram
Message:
  • added 'Never ask again' switch to most modal question dialogs. This is a workaround to make it possible to work with macros where modal questions are used. See also #179
    • added unique IDs to all calls to aw_question / AW_repeated_question::get_answer
    • replaced most calls to aw_popup_ok with aw_message (most of them only worked-around the non-standard way of EDIT4 to show aw_message)
  • added 'Reactivate questions' to all properties menus
  • hardcoded unused default-params from aw_ask_sure, aw_popup_ok + aw_popup_exit
Location:
trunk
Files:
42 modified

Legend:

Unmodified
Added
Removed
  • trunk/ARB_GDE/GDE_event.cxx

    r8356 r8359  
    332332 
    333333                    enum ReplaceMode { REPLACE_SPEC = 0, REIMPORT_SEQ = 1, SKIP_IMPORT  = 2, } 
    334                     replace_mode = (ReplaceMode)overwrite_question.get_answer(question, "Overwrite species,Overwrite sequence only,Skip entry", "all", false); 
     334                    replace_mode = (ReplaceMode)overwrite_question.get_answer("GDE_overwrite", question, "Overwrite species,Overwrite sequence only,Skip entry", "all", false); 
    335335 
    336336                    switch (replace_mode) { 
     
    373373                                    ACCEPT_CHANGE = 0, 
    374374                                    REJECT_CHANGE = 1, 
    375                                 } change_mode = (ChangeMode)checksum_change_question.get_answer(question, "Accept change,Reject", "all", false); 
     375                                } change_mode = (ChangeMode)checksum_change_question.get_answer("GDE_accept", question, "Accept change,Reject", "all", false); 
    376376                                 
    377377                                if (change_mode == REJECT_CHANGE) writeSequence = false; 
  • trunk/AWT/AWT_asciiprint.cxx

    r8355 r8359  
    146146    if (f) { 
    147147        fclose(f); 
    148         if (aw_question(GBS_global_string("File '%s' already exist", filename), "Overwrite,Cancel")) { 
     148        if (aw_question("overwrite_file", GBS_global_string("File '%s' already exist", filename), "Overwrite,Cancel")) { 
    149149            return; 
    150150        } 
  • trunk/AWT/AWT_input_mask.cxx

    r8355 r8359  
    22472247 
    22482248    if (stat(maskfullname.c_str(), &st) == 0) { // file exists 
    2249         int answer = aw_question("File does already exist", "Open mask,Cancel"); 
     2249        int answer = aw_question("overwrite_mask", "File does already exist", "Open mask,Cancel"); 
    22502250        switch (answer) { 
    22512251            case 0: 
  • trunk/AWTI/AWTI_import.cxx

    r8355 r8359  
    747747                                                "    or a long comment in a sequence\n", file, line); 
    748748 
    749                 switch (aw_question(msg, "Continue Reading,Continue Reading (Never ask again),Abort")) { 
     749                switch (aw_question("import_long_lines", msg, "Continue Reading,Continue Reading (Never ask again),Abort")) { 
    750750                    case 0: 
    751751                        max_line *= 2; 
     
    11251125 
    11261126        if (ask_generate_names) { 
    1127             if (aw_question("You may generate short names using the full_name and accession entry of the species", 
     1127            if (aw_question("generate_short_names", 
     1128                            "You may generate short names using the full_name and accession entry of the species", 
    11281129                            "Generate new short names (recommended),Use found names")==0) 
    11291130            { 
  • trunk/EDIT4/ED4_ProteinViewer.cxx

    r8309 r8359  
    464464                                e4_assert(ASKtoOverWriteData); 
    465465                                question = GBS_global_string_copy("\"%s\" contain data in the alignment \"%s\"!", spName, newAlignmentName); 
    466                                 skip_sp  = ASKtoOverWriteData->get_answer(question, "Overwrite, Skip Species", "all", false); 
     466                                skip_sp  = ASKtoOverWriteData->get_answer("overwrite_translated", question, "Overwrite, Skip Species", "all", false); 
    467467                            } 
    468468                            if (skip_sp) { 
     
    539539        if (giNewAlignments>0) { 
    540540            char *msg = GBS_global_string_copy("Protein data saved to NEW alignments.\n%d new alignments were created and named ali_prot_ProtView_XXXX", giNewAlignments); 
    541  
    542             aw_popup_ok(msg, false); 
    543541            aw_message(msg); 
    544  
    545542            free(msg); 
    546543 
  • trunk/EDIT4/ED4_base.cxx

    r8355 r8359  
    302302#if defined(DEBUG) && 1 
    303303            printf("# of species in species-container changed from %i to %i\n", ED4_elements_in_species_container, nsons); 
    304             aw_popup_ok("Species container changed!"); 
    305304#endif 
    306305            GBDATA *gb_lastSon = GB_search_last_son(gb_species_data); 
  • trunk/EDIT4/ED4_edit_string.cxx

    r8355 r8359  
    10741074        if (write_fault) { 
    10751075            e4_assert(info->mode==AD_NOWRITE); 
    1076  
    1077             if (is_remapped_sequence) { 
    1078                 int check = aw_question("Please check 'Preferences/Options/OSC/Show all gaps' in order to edit remarks", "Ok,Check it for me"); 
    1079                 if (check) { 
    1080                     ED4_ROOT->aw_root->awar(ED4_AWAR_COMPRESS_SEQUENCE_TYPE)->write_int(ED4_RM_NONE); 
    1081                 } 
    1082             } 
    1083             else { 
    1084                 aw_message("This terminal is write-protected!"); 
    1085             } 
     1076            aw_message(is_remapped_sequence 
     1077                       ? "Check 'Show all gaps' when editing remarks" 
     1078                       : "This terminal is write-protected!"); 
    10861079        } 
    10871080    } 
  • trunk/EDIT4/ED4_search.cxx

    r8355 r8359  
    9898                complement = 0; 
    9999                root->awar(awarList->complement)->write_int(0); 
    100                 aw_question(GBS_global_string("Search for complement is not supported for this alignment type"), "Disable"); 
     100                aw_message("Search for complement is not supported for this alignment type (has been disabled)"); 
    101101            } 
    102102        } 
     
    992992    ++result_counter; 
    993993    if (result_counter >= max_allowed_results) { 
    994         if (aw_question(GBS_global_string("More than %i results found!", result_counter), "Allow more,That's enough") == 0) { 
     994        if (aw_question("many_search_results",  
     995                        GBS_global_string("More than %i results found!", result_counter), "Allow more,That's enough") == 0) { 
    995996            max_allowed_results = max_allowed_results*2; 
    996997        } 
     
    15361537 
    15371538            char *question = GBS_global_string_copy("'%s' already exists", filename); 
    1538             if (aw_question(question, "Overwrite,Cancel") != 0) { 
     1539            if (aw_question("overwrite_search_params", question, "Overwrite,Cancel") != 0) { 
    15391540                error = "Wont overwrite existing file"; 
    15401541            } 
     
    15851586    } 
    15861587 
    1587     if (error) aw_popup_ok(error); 
     1588    if (error) aw_message(error); 
    15881589    else AW_POPDOWN(aw); 
    15891590 
     
    16481649    } 
    16491650 
    1650     if (error) aw_popup_ok(error); 
     1651    if (error) aw_message(error); 
    16511652    else AW_POPDOWN(aw); 
    16521653     
  • trunk/EDIT4/ED4_terminal.cxx

    r8355 r8359  
    226226 
    227227        if (old_checksum != new_checksum) { 
    228             if (aw_question("Checksum changed!", "Allow, Reject") == 1) { 
     228            if (aw_question(NULL, "Checksum changed!", "Allow, Reject") == 1) { 
    229229                allow_write_data = false; 
    230230            } 
     
    13751375#endif 
    13761376    if (!update_likelihood()) { 
    1377         aw_popup_ok("Can't calculate likelihood."); 
     1377        aw_message("Can't calculate likelihood."); 
    13781378        return ED4_R_IMPOSSIBLE; 
    13791379    } 
  • trunk/EDIT4/ED4_visualizeSAI.cxx

    r8355 r8359  
    477477 
    478478static void deleteColorTranslationTable(AW_window *aws) { 
    479     bool delete_table = aw_ask_sure("Are you sure you want to delete the selected COLOR TRANSLATION TABLE?"); 
     479    bool delete_table = aw_ask_sure("del_color_table", "Are you sure you want to delete the selected COLOR TRANSLATION TABLE?"); 
    480480    if (delete_table) { 
    481481        AW_root *aw_root = aws->get_root(); 
  • trunk/GENOM/EXP_interface.cxx

    r8355 r8359  
    274274 
    275275static void experiment_delete_cb(AW_window *aww, AW_CL cl_gb_main) { 
    276     if (aw_ask_sure("Are you sure to delete the experiment")) { 
     276    if (aw_ask_sure("experiment_delete", "Are you sure to delete the experiment")) { 
    277277        GBDATA         *gb_main       = (GBDATA*)cl_gb_main; 
    278278        GB_transaction  ta(gb_main); 
  • trunk/GENOM/GEN_interface.cxx

    r8355 r8359  
    910910 
    911911static void gene_delete_cb(AW_window *aww, AW_CL cl_gb_main) { 
    912     if (aw_ask_sure("Are you sure to delete the gene?")) { 
     912    if (aw_ask_sure("gene_delete", "Are you sure to delete the gene?")) { 
    913913        GBDATA         *gb_main = (GBDATA*)cl_gb_main; 
    914914        GB_transaction  ta(gb_main); 
  • trunk/GENOM/GEN_map.cxx

    r8358 r8359  
    753753 
    754754            char *question = GBS_global_string_copy("Already have a gene-species for %s/%s ('%s')", species_name, gene_name, existing_name); 
    755             int   answer   = ask_about_existing_gene_species->get_answer(question, "Overwrite species,Insert new alignment,Skip,Create new", "all", true); 
     755            int   answer   = ask_about_existing_gene_species->get_answer("existing_pseudo_species", question, "Overwrite species,Insert new alignment,Skip,Create new", "all", true); 
    756756 
    757757            create_new_gene_species = false; 
     
    768768                    if (gb_ali) { // the alignment already exists 
    769769                        char *question2        = GBS_global_string_copy("Gene-species '%s' already has data in '%s'", existing_name, ali); 
    770                         int   overwrite_answer = ask_to_overwrite_alignment->get_answer(question2, "Overwrite data,Skip", "all", true); 
     770                        int   overwrite_answer = ask_to_overwrite_alignment->get_answer("overwrite_gene_data", question2, "Overwrite data,Skip", "all", true); 
    771771 
    772772                        if (overwrite_answer == 1) error      = GBS_global_string("Skipped gene-species '%s' (already had data in alignment)", existing_name); // Skip 
  • trunk/GENOM/GEN_translations.cxx

    r7341 r8359  
    198198                                AW_repeated_question* q = ok_to_ignore_wrong_start_codon; 
    199199 
    200                                 if (q->get_answer("Translation differs only in start codon", 
     200                                if (q->get_answer("only_start_codon_differs", 
     201                                                  "Translation differs only in start codon", 
    201202                                                  "Ignore and remove,Keep translation", "all", false) == 0) { 
    202203                                    retry++; 
  • trunk/MERGE/MG_alignment.cxx

    r8355 r8359  
    139139static void MG_ad_al_delete_cb(AW_window *aww, AW_CL db_nr) 
    140140{ 
    141     if (aw_ask_sure("Are you sure to delete all data belonging to this alignment?")) { 
     141    if (aw_ask_sure("merge_delete_ali", "Are you sure to delete all data belonging to this alignment?")) { 
    142142        char     buffer[256]; 
    143143        sprintf(buffer, "tmp/merge%li/alignment_name", db_nr); 
  • trunk/MERGE/MG_main.cxx

    r8358 r8359  
    197197        if (dest_is_new) { 
    198198            if (merge_is_genome) { 
    199                 dest_genome = aw_question("Enter destination DB-type", "Normal,Genome"); 
     199                dest_genome = aw_question("select_dest_dbtype", "Enter destination DB-type", "Normal,Genome"); 
    200200            } 
    201201            else { 
  • trunk/MERGE/MG_species.cxx

    r8355 r8359  
    688688 
    689689                    b = GBS_strclose(str); 
    690                     aliid = aw_question("There are more than one possible alignment targets\n" 
     690                    aliid = aw_question(NULL, 
     691                                        "There are more than one possible alignment targets\n" 
    691692                                        "Choose one destination alignment or ABORT", b); 
    692693                    free(b); 
     
    773774            } 
    774775            else { 
    775                 switch (aw_question(GBS_global_string("Warning:  There is a name conflict for species '%s'\n" 
     776                switch (aw_question("merge_existing_species", 
     777                                    GBS_global_string("Warning:  There is a name conflict for species '%s'\n" 
    776778                                                      "  You may:\n" 
    777779                                                      "  - Overwrite existing species\n" 
  • trunk/NTREE/NT_cb.cxx

    r8355 r8359  
    3333 
    3434void NT_delete_mark_all_cb(void *, AWT_canvas *ntw) { 
    35     if (aw_ask_sure("Are you sure to delete species ??\n" 
     35    if (aw_ask_sure("delete_marked_species", 
     36                    "Are you sure to delete species ??\n" 
    3637                    "This will destroy primary data !!!")) 
    3738    { 
  • trunk/NTREE/NT_concatenate.cxx

    r8309 r8359  
    300300 
    301301        if (gb_alignment_exists) {    // check wheather new alignment exists or not, if yes prompt user to overwrite the existing alignment; if no create an empty alignment 
    302             bool overwrite = aw_ask_sure(GBS_global_string("Existing data in alignment \"%s\" may be overwritten. Do you want to continue?", new_ali_name)); 
     302            bool overwrite = aw_ask_sure("concat_ali_overwrite", GBS_global_string("Existing data in alignment \"%s\" may be overwritten. Do you want to continue?", new_ali_name)); 
    303303            if (!overwrite) { 
    304304                error = "Alignment exists! Quitting function..."; 
     
    341341                        char *speciesName = GB_read_string(GB_entry(gb_species, "full_name")); 
    342342                        char *question    = GBS_global_string_copy("\"%s\" alignment doesn't exist in \"%s\"!", const_ali_name, speciesName); 
    343                         int skip_ali      = ask_about_missing_alignment.get_answer(question, "Insert Gaps for Missing Alignment,Skip Missing Alignment", "all", true); 
     343                        int skip_ali      = ask_about_missing_alignment.get_answer("insert_gaps_for_missing_ali", question, "Insert Gaps for Missing Alignment,Skip Missing Alignment", "all", true); 
    344344                        if (!skip_ali) { 
    345345                            ali_len = GBT_get_alignment_len(GLOBAL_gb_main, const_ali_name); 
     
    655655    if (error) { 
    656656        gb_new_species = 0; 
    657         aw_popup_ok(error); 
     657        aw_message(error); 
    658658    } 
    659659 
     
    671671        error = GBT_add_new_changekey(gb_main, new_field_name, GB_STRING); 
    672672        if (error) { 
    673             bool overwrite = aw_ask_sure(GBS_global_string("\"%s\" field exists! Do you want to overwrite the existing field?", new_field_name)); 
     673            bool overwrite = aw_ask_sure("merge_similar_overwrite_field", 
     674                                         GBS_global_string("\"%s\" field exists! Do you want to overwrite the existing field?", new_field_name)); 
    674675            if (!overwrite) return error; 
    675676        } 
  • trunk/NTREE/NT_extern.cxx

    r8358 r8359  
    251251#endif // DEBUG 
    252252 
     253                const char *quit_buttons = "Quit ARB,Do NOT quit"; 
    253254                if (secs) { 
    254255                    secs = GB_time_of_day() - secs; 
    255256                    if (secs>10) { 
    256257                        char *question = GBS_global_string_copy("You last saved your data %li:%li minutes ago\nSure to quit ?", secs/60, secs%60); 
    257                         int   dontQuit = aw_question(question, "QUIT ARB,DO NOT QUIT"); 
     258                        int   dontQuit = aw_question("quit_arb", question, quit_buttons); 
    258259                        free(question); 
    259260                        if (dontQuit) return; 
     
    261262                } 
    262263                else { 
    263                     if (aw_question("You never saved any data\nSure to quit ???", "QUIT ARB,DO NOT QUIT")) return; 
     264                    if (aw_question("quit_arb", "You never saved any data\nSure to quit ???", quit_buttons)) return; 
    264265                } 
    265266            } 
  • trunk/NTREE/NT_main.cxx

    r8246 r8359  
    109109                        default: { 
    110110                            char *qtext  = GBS_global_string_copy("Alignment '%s' is not formatted. Format?", ali_name); 
    111                             int   answer = question.get_answer(qtext, "Format,Skip,Always format,Always skip", "all", false); 
     111                            int   answer = question.get_answer("format_alignments", qtext, "Format,Skip,Always format,Always skip", "all", false); 
    112112 
    113113                            switch (answer) { 
     
    244244 
    245245    if (strlen(db_server)) { 
    246         if (aw_ask_sure(GBS_global_string("Are you sure to delete database %s\nNote: there is no way to undelete it afterwards", db_server))) { 
     246        if (aw_ask_sure(NULL, GBS_global_string("Are you sure to delete database %s\nNote: there is no way to undelete it afterwards", db_server))) { 
    247247            GB_ERROR error = 0; 
    248248            error = GB_delete_database(db_server); 
     
    479479                                                            full_path, load_file_err); 
    480480 
    481                         int ans = aw_question(msg, "Browser,Exit"); 
     481                        int ans = aw_question(NULL, msg, "Browser,Exit"); 
    482482                        action  = ans ? EXIT : BROWSE_DB; 
    483483                    } 
    484484                    else { 
    485485                        const char *msg = GBS_global_string("Your file is not an original arb file\n(%s)", load_file_err); 
    486                         action          = (Action)aw_question(msg, "Continue (dangerous),Start Converter,Browser,Exit"); 
     486                        action          = (Action)aw_question(NULL, msg, "Continue (dangerous),Start Converter,Browser,Exit"); 
    487487                    } 
    488488                } 
  • trunk/NTREE/ad_ali.cxx

    r8355 r8359  
    8080 
    8181static void ad_al_delete_cb(AW_window *aww) { 
    82     if (aw_ask_sure("Are you sure to delete all data belonging to this alignment")) { 
     82    if (aw_ask_sure("delete_ali_data", "Are you sure to delete all data belonging to this alignment")) { 
    8383        char           *source = aww->get_root()->awar("presets/use")->read_string(); 
    8484        GB_transaction  ta(GLOBAL_gb_main); 
  • trunk/NTREE/ad_transpro.cxx

    r8355 r8359  
    5555                const char *msg = GBS_global_string("You have not selected a destination alignment\n" 
    5656                                                    "Shall I create one ('%s_pro') for you?", ali_source); 
    57                 if (!aw_ask_sure(msg)) { 
     57                if (!aw_ask_sure("create_protein_ali", msg)) { 
    5858                    error = "Cancelled by user"; 
    5959                } 
     
    694694 
    695695        if (!error && neededLength>0) { 
    696             if (retrying || !aw_ask_sure(GBS_global_string("Increase length of '%s' to %li?", ali_dest, neededLength))) { 
     696            if (retrying || !aw_ask_sure("increase_ali_length", GBS_global_string("Increase length of '%s' to %li?", ali_dest, neededLength))) { 
    697697                error = GBS_global_string("Missing %li columns in alignment '%s'", neededLength, ali_dest); 
    698698            } 
  • trunk/PARSIMONY/PARS_main.cxx

    r8358 r8359  
    12141214    long tree_size = GBT_size_of_tree(GLOBAL_gb_main, tree_name); 
    12151215    if (tree_size == -1) { 
    1216         error = GB_export_error("Please select an existing tree"); 
     1216        error = "Please select an existing tree"; 
    12171217    } 
    12181218    else { 
    1219         if ((unsigned long)(ali_len * tree_size * 4 / 1000) > GB_get_physical_memory()) { 
    1220             error  = GB_export_error("Very big tree"); 
     1219        unsigned long expected_memuse = (ali_len * tree_size * 4 / 1000); 
     1220        if (expected_memuse > GB_get_physical_memory()) { 
     1221            error  = GBS_global_string("Estimated memory usage (%s) exceeds physical memory (will swap)\n" 
     1222                                       "(did you specify a filter?)", 
     1223                                       GBS_readable_size(expected_memuse, "b")); 
    12211224        } 
    12221225    } 
     
    12411244    GB_begin_transaction(GLOBAL_gb_main); 
    12421245    { 
    1243         GB_ERROR error = pars_check_size(awr); 
    1244         if (error) { 
    1245             if (!aw_ask_sure("This program will need a lot of computer memory\n" 
    1246                              "    (Hint: the use of a filter often helps)\n" 
    1247                              "Do you want to continue?")) { 
     1246        GB_ERROR warning = pars_check_size(awr); 
     1247        if (warning) { 
     1248            char *question = GBS_global_string_copy("%s\nDo you want to continue?", warning); 
     1249            bool  cont     = aw_ask_sure("swap_warning", question); 
     1250            free(question); 
     1251 
     1252            if (!cont) { 
    12481253                GB_commit_transaction(GLOBAL_gb_main); 
    12491254                return; 
  • trunk/PRIMER_DESIGN/primer_design.cxx

    r8355 r8359  
    128128 
    129129    if ((get_estimated_memory(root)/1024.0) > GB_get_physical_memory()) { 
    130         if (aw_question("ARB may crash due to memory problems.", "Continue, Abort") == 1) { 
     130        if (aw_question(NULL, "ARB may crash due to memory problems.", "Continue, Abort") == 1) { 
    131131            return; 
    132132        } 
  • trunk/PROBE_DESIGN/probe_design.cxx

    r8355 r8359  
    499499            abort = true; 
    500500        } 
    501         else if (aw_question(GBS_global_string("Your PT server is not up to date or wrongly chosen\n" 
     501        else if (aw_question("ptserver_add_unknown", 
     502                             GBS_global_string("Your PT server is not up to date or wrongly chosen\n" 
    502503                                               "  The following names are new to it:\n" 
    503504                                               "  %s\n" 
     
    14081409            } 
    14091410 
    1410             int cont = 1; 
    1411             if (resolutions>5000) { 
    1412                 const char *warning = GBS_global_string("Resolution of this string will result in %i single strings", resolutions); 
    1413                 cont = aw_question(warning, "Abort,Continue"); 
    1414             } 
    1415  
    1416             if (cont) { // continue with resolution? 
     1411            {  
    14171412                int *resolution_idx = new int[bases_to_resolve]; 
    14181413                int *resolution_max_idx = new int[bases_to_resolve]; 
     
    16581653static void pd_kill_pt_server(AW_window *aww, AW_CL kill_all) 
    16591654{ 
    1660     if (aw_ask_sure(GBS_global_string("Are you sure to stop %s", 
    1661                                       kill_all ? "all servers" : "that server"))) 
    1662     { 
     1655    if (aw_ask_sure("kill_ptserver", 
     1656                    GBS_global_string("Are you sure to stop %s", kill_all ? "all servers" : "that server"))) { 
    16631657        long min = 0; 
    16641658        long max = 0; 
     
    17471741 
    17481742    if (!error && 
    1749         aw_question("This function will send your currently loaded data as the new data to the pt_server !!!\n" 
    1750                     "The server will need a long time (up to several hours) to analyse the data.\n" 
     1743        aw_question("update_ptserver", 
     1744                    "This function will send your loaded database to the pt_server,\n" 
     1745                    "which will need a long time (up to several hours) to analyse the data.\n" 
    17511746                    "Until the new server has analyzed all data, no server functions are available.\n\n" 
    17521747                    "Note 1: You must have the write permissions to do that ($ARBHOME/lib/pts/xxx))\n" 
  • trunk/SECEDIT/SEC_graphic.cxx

    r8355 r8359  
    114114 
    115115            sec_assert(error); 
    116             aw_popup_ok(error); 
     116            aw_message(error); 
    117117 
    118118            char *retry = aw_input(question, answer); 
  • trunk/SECEDIT/SEC_main.cxx

    r8355 r8359  
    311311 
    312312    free(filename); 
    313     if (error) aw_popup_ok(error); 
     313    if (error) aw_message(error); 
    314314} 
    315315 
     
    430430        free(filename); 
    431431    } 
    432     if (error) aw_popup_ok(error); 
     432    if (error) aw_message(error); 
    433433} 
    434434 
     
    498498    bool     done  = false; 
    499499 
    500     switch (aw_question("Create new structure?", "Default bone,Copy current,Abort")) { 
     500    switch (aw_question(NULL, "Create new structure?", "Default bone,Copy current,Abort")) { 
    501501        case 0:                 // default bone 
    502502            error = structure->copyTo("Default"); 
     
    529529 
    530530    if (structure->getCount()>1) { 
    531         if (aw_ask_sure(GBS_global_string("Are you sure to delete structure '%s'?", structure->name()))) { 
     531        if (aw_ask_sure("delete_sec_structure", GBS_global_string("Are you sure to delete structure '%s'?", structure->name()))) { 
    532532            GB_ERROR error = structure->remove(); 
    533533            if (error) aw_message(error); 
  • trunk/SL/DB_QUERY/db_query.cxx

    r8356 r8359  
    527527    } 
    528528 
    529     if (!cnt || !aw_ask_sure(GBS_global_string("Are you sure to delete %li %s", cnt, selector.items_name))) { 
     529    if (!cnt || !aw_ask_sure("delete_queried_species", GBS_global_string("Are you sure to delete %li %s", cnt, selector.items_name))) { 
    530530        GB_abort_transaction(query->gb_main); 
    531531        return; 
     
    15601560        switch (selector.type) { 
    15611561            case QUERY_ITEM_SPECIES: { 
    1562                 if (aw_question("WARNING WARNING WARNING!!! You now try to rename the species\n" 
     1562                if (aw_question("corrupt_species_names", 
     1563                                "WARNING WARNING WARNING!!! You now try to rename the species\n" 
    15631564                                "    The name is used to link database entries and trees\n" 
    15641565                                "    ->  ALL TREES WILL BE LOST\n" 
     
    15691570            } 
    15701571            case QUERY_ITEM_GENES: { 
    1571                 if (aw_question("WARNING! You now try to rename the gene\n" 
     1572                if (aw_question("corrupt_gene_names", 
     1573                                "WARNING! You now try to rename the gene\n" 
    15721574                                "    ->  Pseudo-species will loose their link to the gene" 
    15731575                                "    ->  The new name MUST be UNIQUE" 
     
    15771579            } 
    15781580            case QUERY_ITEM_EXPERIMENTS: { 
    1579                 if (aw_question("WARNING! You now try to rename the experiment\n" 
     1581                if (aw_question("corrupt_experiment_names",  
     1582                                "WARNING! You now try to rename the experiment\n" 
    15801583                                "    ->  The new name MUST be UNIQUE" 
    15811584                                "        if not you will corrupt the database!", 
     
    16051608            while (!error && !(gb_key_name = GB_find_string(gb_key_data, CHANGEKEY_NAME, key, GB_IGNORE_CASE, SEARCH_GRANDCHILD))) { 
    16061609                const char *question = GBS_global_string("The destination field '%s' does not exists", key); 
    1607                 if (aw_question(question, "Create Field (Type STRING),Cancel")) { 
     1610                if (aw_question("create_dest_field_from_mod_queried", question, "Create Field (Type STRING),Cancel")) { 
    16081611                    error = "Aborted by user"; 
    16091612                } 
     
    16211624            else { 
    16221625                if (GB_read_int(gb_key_type)!=GB_STRING && 
    1623                     aw_question("Writing to a non-STRING database field may lead to conversion problems.", "Abort,Continue")==0) 
     1626                    aw_question("write_non_string_field", "Writing to a non-STRING database field may lead to conversion problems.", "Abort,Continue")==0) 
    16241627                { 
    16251628                    error = "Aborted by user"; 
  • trunk/SL/DB_UI/ui_species.cxx

    r8355 r8359  
    234234            } 
    235235            if (!error) { 
    236                 if (aw_ask_sure("Do you want to re-create the 'name' field?")) { 
     236                if (aw_ask_sure("recreate_name_field", "Do you want to re-create the 'name' field?")) { 
    237237                    arb_progress progress("Recreating species name", 1); 
    238238                    error = AWTC_recreate_name(gb_species); 
     
    259259        error = "Please select a species first"; 
    260260    } 
    261     else if (aw_ask_sure(GBS_global_string("Are you sure to delete the species '%s'?", name))) { 
     261    else if (aw_ask_sure("info_delete_species", GBS_global_string("Are you sure to delete the species '%s'?", name))) { 
    262262        GB_transaction ta(gb_main); 
    263263        error = GB_delete(gb_species); 
     
    968968 
    969969    if (strcmp(dest_field, "name")==0) { 
    970         int answer = aw_question("CAUTION! This will destroy all name-fields of the listed species.\n", 
     970        int answer = aw_question(NULL, "CAUTION! This will destroy all name-fields of the listed species.\n", 
    971971                                 "Continue and destroy all name-fields,Abort"); 
    972972 
  • trunk/SL/FAST_ALIGNER/fast_aligner.cxx

    r8355 r8359  
    15801580                                                        toAlignSequence->name(), long(bestScore+.5), long(bestMirroredScore+.5)); 
    15811581                        } 
    1582                         turnIt = aw_question(message, "Turn sequence,Leave sequence alone")==0; 
     1582                        turnIt = aw_question("fastali_turn_sequence", message, "Turn sequence,Leave sequence alone")==0; 
    15831583                    } 
    15841584                    else { 
  • trunk/SL/TREEDISP/TreeDisplay.cxx

    r8355 r8359  
    613613            const char *msg = GBS_global_string("What to do with group '%s'?", gname); 
    614614 
    615             switch (aw_question(msg, "Rename,Destroy,Cancel")) { 
     615            switch (aw_question(NULL, msg, "Rename,Destroy,Cancel")) { 
    616616                case 0: {                                                    // rename 
    617617                    char *new_gname = aw_input("Rename group", "Change group name:", at->name); 
  • trunk/WINDOW/AW_advice.cxx

    r8358 r8359  
    141141    AW_awar *awar_disabled = get_disabled_advices(); 
    142142 
    143     char *disabled = awar_disabled->read_string(); 
    144     char *nosemi   = GBS_string_eval(disabled, ";=", NULL); 
    145     int   entries  = strlen(disabled)-strlen(nosemi); 
     143    char       *disabled = awar_disabled->read_string(); 
     144    char       *nosemi   = GBS_string_eval(disabled, ";=", NULL); 
     145    int         entries  = strlen(disabled)-strlen(nosemi); 
     146    const char *msg      = "No advices were disabled yet."; 
    146147 
    147148    if (entries>0) { 
    148149        aw_assert(entries>1); 
    149150        entries--; 
    150         aw_message(GBS_global_string("Enabled %i advices", entries)); 
    151     } 
    152     else { 
    153         aw_message("No advices were disabled yet."); 
    154     } 
     151        msg = GBS_global_string("Reactivated %i advices (for this session)\n" 
     152                                "To reactivate them for future sessions, save properties.", 
     153                                entries); 
     154    } 
     155    aw_message(msg); 
    155156 
    156157    free(nosemi); 
  • trunk/WINDOW/AW_button.cxx

    r8355 r8359  
    19911991                if (selection_list->value_equal_display) { // here no comma should occur 
    19921992                    if (correct_old_format == -1) { 
    1993                         correct_old_format = aw_ask_sure(GBS_global_string("'%s' seems to be in old selection-list-format. Try to correct?", fname)); 
     1993                        correct_old_format = aw_ask_sure(NULL, GBS_global_string("'%s' seems to be in old selection-list-format. Try to correct?", fname)); 
    19941994                    } 
    19951995 
  • trunk/WINDOW/AW_modal.cxx

    r8309 r8359  
    1414#include <aw_awar.hxx> 
    1515#include "aw_root.hxx" 
     16#include "aw_question.hxx" 
     17#include "aw_advice.hxx" 
     18#include "aw_msg.hxx" 
    1619 
    1720#include <arbdbt.h> 
     
    5558//      aw_question 
    5659 
    57 int aw_question(const char *question, const char *buttons, bool fixedSizeButtons, const char *helpfile) { 
     60void AW_reactivate_all_questions() { 
     61    GB_transaction  ta(AW_ROOT_DEFAULT); 
     62    GBDATA         *gb_neverAskedAgain = GB_search(AW_ROOT_DEFAULT, "answers", GB_FIND); 
     63    const char     *msg                = "No questions were disabled yet."; 
     64 
     65    if (gb_neverAskedAgain) { 
     66        int reactivated = 0; 
     67        for (GBDATA *gb_q = GB_child(gb_neverAskedAgain); gb_q; gb_q = GB_nextChild(gb_q)) { 
     68            if (GB_read_int(gb_q)) { 
     69                GB_write_int(gb_q, 0); 
     70                reactivated++; 
     71            } 
     72        } 
     73        if (reactivated) { 
     74            msg = GBS_global_string("Reactivated %i questions (for this session)\n" 
     75                                    "To reactivate them for future sessions, save properties.", 
     76                                    reactivated); 
     77        } 
     78    } 
     79    aw_message(msg); 
     80} 
     81 
     82int aw_question(const char *uniqueID, const char *question, const char *buttons, bool fixedSizeButtons, const char *helpfile) { 
    5883    // return 0 for first button, 1 for second button, 2 for third button, ... 
    5984    // 
     
    7398    AW_root *root = AW_root::SINGLETON; 
    7499 
    75     AW_window_message *aw_msg; 
    76     char              *button_list  = strdup(buttons ? buttons : "OK"); 
    77  
    78     if (button_list[0] == 0) { 
    79         freedup(button_list, "Maybe ok,EXIT"); 
    80         GBK_dump_backtrace(stderr, "Empty buttonlist"); 
    81         question = GBS_global_string_copy("%s\n" 
    82                                           "(Program error - Unsure what happens when you click ok\n" 
    83                                           " Check console for backtrace and report error)", 
    84                                           question); 
    85     } 
    86  
    87     AW_awar *awar_quest     = root->awar_string(AWAR_QUESTION); 
    88     if (!question) question = "<oops - no question?!>"; 
    89     awar_quest->write_string(question); 
    90  
    91     size_t question_length, question_lines; 
    92     aw_detect_text_size(question, question_length, question_lines); 
    93  
    94     // hash key to find matching window 
    95     char *hindex = GBS_global_string_copy("%s$%zu$%zu$%i$%s", 
    96                                           button_list, 
    97                                           question_length, question_lines, int(fixedSizeButtons), 
    98                                           helpfile ? helpfile : ""); 
    99  
    100     static GB_HASH *hash_windows    = 0; 
    101     if (!hash_windows) hash_windows = GBS_create_hash(256, GB_MIND_CASE); 
    102     aw_msg                          = (AW_window_message *)GBS_read_hash(hash_windows, hindex); 
     100    char *awar_name_neverAskAgain = NULL; 
     101    int   have_auto_answer        = 0; 
     102 
     103    if (uniqueID) { 
     104        GB_ERROR error = GB_check_key(uniqueID); 
     105        if (error) { 
     106            aw_message(error); 
     107            uniqueID = NULL; 
     108        } 
     109        else { 
     110            awar_name_neverAskAgain     = GBS_global_string_copy("answers/%s", uniqueID); 
     111            AW_awar *awar_neverAskAgain = root->awar_int(awar_name_neverAskAgain, 0, AW_ROOT_DEFAULT); 
     112            have_auto_answer            = awar_neverAskAgain->read_int(); 
     113        } 
     114    } 
     115 
     116    if (have_auto_answer>0) { 
     117        aw_message_cb_result = have_auto_answer-1; 
     118    } 
     119    else { 
     120        char *button_list = strdup(buttons ? buttons : "OK"); 
     121        if (button_list[0] == 0) { 
     122            freedup(button_list, "Maybe ok,EXIT"); 
     123            GBK_dump_backtrace(stderr, "Empty buttonlist"); 
     124            question = GBS_global_string_copy("%s\n" 
     125                                              "(Program error - Unsure what happens when you click ok\n" 
     126                                              " Check console for backtrace and report error)", 
     127                                              question); 
     128        } 
     129 
     130        AW_awar *awar_quest     = root->awar_string(AWAR_QUESTION); 
     131        if (!question) question = "<oops - no question?!>"; 
     132        awar_quest->write_string(question); 
     133 
     134        size_t question_length, question_lines; 
     135        aw_detect_text_size(question, question_length, question_lines); 
     136 
     137        // hash key to find matching window 
     138        char *hindex = GBS_global_string_copy("%s$%s$%zu$%zu$%i$%s", 
     139                                              button_list, uniqueID ? uniqueID : "<NOID>", 
     140                                              question_length, question_lines, int(fixedSizeButtons), 
     141                                              helpfile ? helpfile : ""); 
     142 
     143        static GB_HASH    *hash_windows = 0; 
     144        if (!hash_windows) hash_windows = GBS_create_hash(256, GB_MIND_CASE); 
     145        AW_window_message *aw_msg       = (AW_window_message *)GBS_read_hash(hash_windows, hindex); 
    103146 
    104147#if defined(DEBUG) 
    105     printf("question_length=%zu question_lines=%zu\n", question_length, question_lines); 
    106     printf("hindex='%s'\n", hindex); 
    107     if (aw_msg) printf("[Reusing existing aw_question-window]\n"); 
     148        printf("hindex='%s'\n", hindex); 
    108149#endif // DEBUG 
    109150 
    110     if (!aw_msg) { 
    111         aw_msg = new AW_window_message; 
    112         GBS_write_hash(hash_windows, hindex, (long)aw_msg); 
    113  
    114         aw_msg->init(root, "QUESTION BOX", false); 
    115         aw_msg->recalc_size_atShow(AW_RESIZE_DEFAULT); // force size recalc (ignores user size) 
    116  
    117         aw_msg->label_length(10); 
    118  
    119         aw_msg->at(10, 10); 
    120         aw_msg->auto_space(10, 10); 
    121  
    122         aw_msg->button_length(question_length+1); 
    123         aw_msg->button_height(question_lines); 
    124  
    125         aw_msg->create_button(0, AWAR_QUESTION); 
    126  
    127         aw_msg->button_height(0); 
    128  
    129         aw_msg->at_newline(); 
    130  
    131         if (fixedSizeButtons) { 
    132             size_t  max_button_length = helpfile ? 4 : 0; 
    133             char   *pos               = button_list; 
    134  
    135             while (1) { 
    136                 char *comma       = strchr(pos, ','); 
    137                 if (!comma) comma = strchr(pos, 0); 
    138  
    139                 size_t len                                   = comma-pos; 
    140                 if (len>max_button_length) max_button_length = len; 
    141  
    142                 if (!comma[0]) break; 
    143                 pos = comma+1; 
    144             } 
    145  
    146             aw_msg->button_length(max_button_length+1); 
     151        if (!aw_msg) { 
     152            aw_msg = new AW_window_message; 
     153            GBS_write_hash(hash_windows, hindex, (long)aw_msg); 
     154 
     155            aw_msg->init(root, "QUESTION BOX", false); 
     156            aw_msg->recalc_size_atShow(AW_RESIZE_DEFAULT); // force size recalc (ignores user size) 
     157 
     158            aw_msg->label_length(10); 
     159 
     160            aw_msg->at(10, 10); 
     161            aw_msg->auto_space(10, 10); 
     162 
     163            aw_msg->button_length(question_length+1); 
     164            aw_msg->button_height(question_lines); 
     165 
     166            aw_msg->create_button(0, AWAR_QUESTION); 
     167 
     168            aw_msg->button_height(0); 
     169 
     170            aw_msg->at_newline(); 
     171 
     172            if (fixedSizeButtons) { 
     173                size_t  max_button_length = helpfile ? 4 : 0; 
     174                char   *pos               = button_list; 
     175 
     176                while (1) { 
     177                    char *comma       = strchr(pos, ','); 
     178                    if (!comma) comma = strchr(pos, 0); 
     179 
     180                    size_t len                                   = comma-pos; 
     181                    if (len>max_button_length) max_button_length = len; 
     182 
     183                    if (!comma[0]) break; 
     184                    pos = comma+1; 
     185                } 
     186 
     187                aw_msg->button_length(max_button_length+1); 
     188            } 
     189            else { 
     190                aw_msg->button_length(0); 
     191            } 
     192 
     193            // insert the buttons: 
     194            char *ret              = strtok(button_list, ","); 
     195            bool  help_button_done = false; 
     196            int   counter          = 0; 
     197 
     198            while (ret) { 
     199                if (ret[0] == '^') { 
     200                    if (helpfile && !help_button_done) { 
     201                        aw_msg->callback(AW_POPUP_HELP, (AW_CL)helpfile); 
     202                        aw_msg->create_button("HELP", "HELP", "H"); 
     203                        help_button_done = true; 
     204                    } 
     205                    aw_msg->at_newline(); 
     206                    ++ret; 
     207                } 
     208                if (strcmp(ret, "EXIT") == 0) { 
     209                    aw_msg->callback(message_cb, -1); 
     210                } 
     211                else { 
     212                    aw_msg->callback(message_cb, (AW_CL)counter++); 
     213                } 
     214 
     215                if (fixedSizeButtons) { 
     216                    aw_msg->create_button(0, ret); 
     217                } 
     218                else { 
     219                    aw_msg->create_autosize_button(0, ret); 
     220                } 
     221                ret = strtok(NULL, ","); 
     222            } 
     223 
     224            if (helpfile && !help_button_done) { // if not done above 
     225                aw_msg->callback(AW_POPUP_HELP, (AW_CL)helpfile); 
     226                aw_msg->create_button("HELP", "HELP", "H"); 
     227                help_button_done = true; 
     228            } 
     229 
     230            if (uniqueID) { 
     231                aw_msg->at_newline(); 
     232                const char *label = counter>1 ? "Never ask again" : "Never notify me again"; 
     233                aw_msg->label_length(strlen(label)); 
     234                aw_msg->label(label); 
     235                aw_msg->create_toggle(awar_name_neverAskAgain); 
     236            } 
     237 
     238            aw_msg->window_fit(); 
    147239        } 
    148240        else { 
    149             aw_msg->button_length(0); 
    150         } 
    151  
    152         // insert the buttons: 
    153         char *ret              = strtok(button_list, ","); 
    154         bool  help_button_done = false; 
    155         int   counter          = 0; 
    156  
    157         while (ret) { 
    158             if (ret[0] == '^') { 
    159                 if (helpfile && !help_button_done) { 
    160                     aw_msg->callback(AW_POPUP_HELP, (AW_CL)helpfile); 
    161                     aw_msg->create_button("HELP", "HELP", "H"); 
    162                     help_button_done = true; 
     241#if defined(DEBUG) 
     242            printf("[Reusing existing aw_question-window]\n"); 
     243#endif 
     244        } 
     245        free(hindex); 
     246        aw_msg->recalc_pos_atShow(AW_REPOS_TO_MOUSE); 
     247        aw_msg->show_grabbed(); 
     248 
     249        free(button_list); 
     250        aw_message_cb_result = -13; 
     251 
     252#if defined(TRACE_STATUS_MORE) 
     253        fprintf(stderr, "add aw_message_timer_listen_event with delay = %i\n", AW_MESSAGE_LISTEN_DELAY); fflush(stdout); 
     254#endif // TRACE_STATUS_MORE 
     255        root->add_timed_callback_never_disabled(AW_MESSAGE_LISTEN_DELAY, aw_message_timer_listen_event, (AW_CL)aw_msg, 0); 
     256        root->disable_callbacks = true; 
     257        while (aw_message_cb_result == -13) { 
     258            root->process_events(); 
     259        } 
     260        root->disable_callbacks = false; 
     261        aw_msg->hide(); 
     262 
     263        if (awar_name_neverAskAgain) { 
     264            AW_awar *awar_neverAskAgain = root->awar(awar_name_neverAskAgain); 
     265 
     266            if (awar_neverAskAgain->read_int()) { // user checked "Never ask again" 
     267                int givenAnswer = aw_message_cb_result >= 0 ? aw_message_cb_result+1 : 0; 
     268                awar_neverAskAgain->write_int(givenAnswer); // store given answer for "never asking again" 
     269 
     270                if (givenAnswer && strchr(buttons, ',') != 0) { 
     271                    const char *appname = root->program_name; 
     272                    char       *advice  = GBS_global_string_copy("You will not be asked that question again in this session.\n" 
     273                                                                 "%s will always assume the answer you just gave.\n" 
     274                                                                 "\n" 
     275                                                                 "When you restart %s that question will be asked again.\n" 
     276                                                                 "To disable that question permanently for future sessions,\n" 
     277                                                                 "you need to save properties.\n" 
     278                                                                 "\n" 
     279                                                                 "Depending on the type of question doing that might be\n" 
     280                                                                 "helpful or obstructive.\n" 
     281                                                                 "Disabled questions can be reactivated from the properties menu.\n", 
     282                                                                 appname, appname); 
     283                    AW_advice(advice, AW_ADVICE_TOGGLE, "Disabling questions", NULL); 
     284                    free(advice); 
    163285                } 
    164                 aw_msg->at_newline(); 
    165                 ++ret; 
    166             } 
    167             if (strcmp(ret, "EXIT") == 0) { 
    168                 aw_msg->callback(message_cb, -1); 
    169             } 
    170             else { 
    171                 aw_msg->callback(message_cb, (AW_CL)counter++); 
    172             } 
    173  
    174             if (fixedSizeButtons) { 
    175                 aw_msg->create_button(0, ret); 
    176             } 
    177             else { 
    178                 aw_msg->create_autosize_button(0, ret); 
    179             } 
    180             ret = strtok(NULL, ","); 
    181         } 
    182  
    183         if (helpfile && !help_button_done) { // if not done above 
    184             aw_msg->callback(AW_POPUP_HELP, (AW_CL)helpfile); 
    185             aw_msg->create_button("HELP", "HELP", "H"); 
    186             help_button_done = true; 
    187         } 
    188  
    189         aw_msg->window_fit(); 
    190     } 
    191     free(hindex); 
    192     aw_msg->recalc_pos_atShow(AW_REPOS_TO_MOUSE); 
    193     aw_msg->show_grabbed(); 
    194  
    195     free(button_list); 
    196     aw_message_cb_result = -13; 
    197  
    198 #if defined(TRACE_STATUS_MORE) 
    199     fprintf(stderr, "add aw_message_timer_listen_event with delay = %i\n", AW_MESSAGE_LISTEN_DELAY); fflush(stdout); 
    200 #endif // TRACE_STATUS_MORE 
    201     root->add_timed_callback_never_disabled(AW_MESSAGE_LISTEN_DELAY, aw_message_timer_listen_event, (AW_CL)aw_msg, 0); 
    202     root->disable_callbacks = true; 
    203     while (aw_message_cb_result == -13) { 
    204         root->process_events(); 
    205     } 
    206     root->disable_callbacks = false; 
    207     aw_msg->hide(); 
     286            } 
     287        } 
     288    } 
     289 
     290    free(awar_name_neverAskAgain); 
    208291 
    209292    switch (aw_message_cb_result) { 
     
    219302} 
    220303 
    221 bool aw_ask_sure(const char *msg, bool fixedSizeButtons, const char *helpfile) { 
    222     return aw_question(msg, "Yes,No", fixedSizeButtons, helpfile) == 0; 
    223 } 
    224 void aw_popup_ok(const char *msg, bool fixedSizeButtons, const char *helpfile) { 
    225     aw_question(msg, "Ok", fixedSizeButtons, helpfile); 
    226 } 
    227 void aw_popup_exit(const char *msg, bool fixedSizeButtons, const char *helpfile) { 
    228     aw_question(msg, "EXIT", fixedSizeButtons, helpfile); 
     304bool aw_ask_sure(const char *uniqueID, const char *msg) { 
     305    return aw_question(uniqueID, msg, "Yes,No", true, NULL) == 0; 
     306} 
     307void aw_popup_ok(const char *msg) { 
     308    aw_question(NULL, msg, "Ok", true, NULL); 
     309} 
     310void aw_popup_exit(const char *msg) { 
     311    aw_question(NULL, msg, "EXIT", true, NULL); 
    229312    aw_assert(0); // should not be reached 
    230313    exit(EXIT_FAILURE); 
  • trunk/WINDOW/AW_nawar.cxx

    r8355 r8359  
    717717    char *dir = awar_dir->read_string(); 
    718718    if (dir[0] && !GB_is_directory(dir)) { 
    719         if (aw_ask_sure(GBS_global_string("Directory '%s' does not exist. Create?", dir))) { 
     719        if (aw_ask_sure("create_directory", GBS_global_string("Directory '%s' does not exist. Create?", dir))) { 
    720720            GB_ERROR error = GB_create_directory(dir); 
    721721            if (error) aw_message(GBS_global_string("Failed to create directory '%s' (Reason: %s)", dir, error)); 
  • trunk/WINDOW/AW_preset.cxx

    r8358 r8359  
    2121#include "aw_device.hxx" 
    2222#include "aw_root.hxx" 
     23#include "aw_question.hxx" 
    2324 
    2425#include <arbdbt.h> 
     
    10971098 
    10981099static void add_common_property_menu_entries(AW_window *aw) { 
    1099     aw->insert_menu_topic("enable_advices", "Reactivate advices", "R", "advice.hlp", AWM_ALL, (AW_CB) AW_reactivate_all_advices, 0, 0); 
     1100    aw->insert_menu_topic("enable_advices",   "Reactivate advices",   "R", "advice.hlp",    AWM_ALL, (AW_CB)AW_reactivate_all_advices,   0, 0); 
     1101    aw->insert_menu_topic("enable_questions", "Reactivate questions", "q", "questions.hlp", AWM_ALL, (AW_CB)AW_reactivate_all_questions, 0, 0); 
    11001102} 
    11011103void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm) { add_common_property_menu_entries(awmm); } 
  • trunk/WINDOW/AW_question.cxx

    r6867 r8359  
    2525} 
    2626 
    27 int AW_repeated_question::get_answer(const char *question, const char *buttons, const char *to_all, bool add_abort) 
     27int AW_repeated_question::get_answer(const char *uniqueID, const char *question, const char *buttons, const char *to_all, bool add_abort) 
    2828{ 
    2929    if (!buttons_used) { 
     
    8181        } 
    8282 
    83         int user_answer = aw_question(question, new_buttons, true, helpfile); 
     83        int user_answer = aw_question(uniqueID, question, new_buttons, true, helpfile); 
    8484 
    8585        if (dont_ask_again) {   // ask question as normal when called first (dont_ask_again later) 
  • trunk/WINDOW/AW_status.cxx

    r8355 r8359  
    404404#endif // TRACE_STATUS_MORE 
    405405    if (aw_stg.mode == AW_STATUS_ABORT) { 
    406         int action = aw_question("Couldn't quit properly in time.\n" 
     406        int action = aw_question(NULL, 
     407                                 "Couldn't quit properly in time.\n" 
    407408                                 "Either wait again for the abortion,\n" 
    408409                                 "kill the calculating process or\n" 
     
    449450    } 
    450451    else { 
    451         if (!aw_ask_sure("Are you sure to abort running calculation?")) { 
     452        if (!aw_ask_sure("aw_status_kill", "Are you sure to abort running calculation?")) { 
    452453            return; // don't abort 
    453454        } 
  • trunk/WINDOW/AW_window.cxx

    r8357 r8359  
    17071707    if ((p_global->main_aww == aww) || !p_global->main_aww->is_shown()) { 
    17081708#ifdef NDEBUG 
    1709         if (aw_question("Are you sure to quit?", "YES,NO")) return; 
     1709        if (!aw_ask_sure("quit_by_X", "Are you sure to quit?")) return; 
    17101710#endif 
    17111711        exit(0); 
  • trunk/WINDOW/Makefile

    r8358 r8359  
    319319AW_help.o: $(ARBHOME)/INCLUDE/test_global.h 
    320320 
     321AW_modal.o: aw_advice.hxx 
    321322AW_modal.o: aw_awar.hxx 
    322323AW_modal.o: aw_base.hxx 
     
    324325AW_modal.o: aw_global.hxx 
    325326AW_modal.o: aw_keysym.hxx 
     327AW_modal.o: aw_msg.hxx 
     328AW_modal.o: aw_question.hxx 
    326329AW_modal.o: aw_root.hxx 
    327330AW_modal.o: aw_window.hxx 
     
    385388AW_preset.o: aw_position.hxx 
    386389AW_preset.o: aw_preset.hxx 
     390AW_preset.o: aw_question.hxx 
    387391AW_preset.o: aw_root.hxx 
    388392AW_preset.o: aw_window.hxx 
  • trunk/WINDOW/aw_question.hxx

    r8356 r8359  
    2929#endif 
    3030 
    31 // for simple questions use: int aw_question(const char *msg, const char *buttons, ...) 
    32 // 
    3331// if you ask the same question in a loop, it is recommended to use AW_repeated_question 
    3432// to avoid asking the same question again and again. 
     
    3735//         2. call get_answer() inside the loop 
    3836 
     37// The second way to get rid of unwanted questions is by using a 'uniqueID' 
     38// - if uniqueID is set, a toggle "Never ask me again" will be added to the question-popup. 
     39// - if uniqueID is NULL, no such toggle will appear (i.e. the popup can NOT be suppressed!) 
     40// The latter is recommended 
     41// - whenever the buttons get generated dynamically 
     42// - when not asking is REALLY dangerous 
     43// 
     44// Whenever you change the meaning of a question, it is mandatory that you change the uniqueID!!! 
     45 
    3946class AW_repeated_question : virtual Noncopyable { 
    40 private: 
    4147    int   answer; 
    4248    bool  dont_ask_again; 
     
    5864    void add_help(const char *help_file); // when called, a help button is added to the prompter 
    5965 
    60     int get_answer(const char *question, const char *buttons, const char *to_all, bool add_abort); 
     66    int get_answer(const char *uniqueID, const char *question, const char *buttons, const char *to_all, bool add_abort); 
    6167    // return 0 for first button, 1 for second button, 2 for third button, ... 
    6268    // the single buttons are separated by commas (i.e. "YES,NO") 
     
    6470}; 
    6571 
    66 int  aw_question  (const char *msg, const char *buttons, bool fixedSizeButtons = true, const char *helpfile = 0); 
    67 bool aw_ask_sure  (const char *msg, bool fixedSizeButtons = true, const char *helpfile = 0); 
    68 void aw_popup_ok  (const char *msg, bool fixedSizeButtons = true, const char *helpfile = 0); 
    69 void aw_popup_exit(const char *msg, bool fixedSizeButtons = true, const char *helpfile = 0) __ATTR__NORETURN; 
     72int  aw_question(const char *uniqueID, const char *msg, const char *buttons, bool fixedSizeButtons = true, const char *helpfile = 0); 
     73bool aw_ask_sure(const char *uniqueID, const char *msg); 
     74 
     75// the following functions should only be used in very special cases - please use aw_message if possible! 
     76void aw_popup_ok  (const char *msg); 
     77void aw_popup_exit(const char *msg) __ATTR__NORETURN; 
     78 
     79void AW_reactivate_all_questions(); 
    7080 
    7181#else