Changeset 8359
- Timestamp:
- 03/02/12 16:44:38 (4 months ago)
- Location:
- trunk
- Files:
-
- 42 modified
-
ARB_GDE/GDE_event.cxx (modified) (2 diffs)
-
AWT/AWT_asciiprint.cxx (modified) (1 diff)
-
AWT/AWT_input_mask.cxx (modified) (1 diff)
-
AWTI/AWTI_import.cxx (modified) (2 diffs)
-
EDIT4/ED4_ProteinViewer.cxx (modified) (2 diffs)
-
EDIT4/ED4_base.cxx (modified) (1 diff)
-
EDIT4/ED4_edit_string.cxx (modified) (1 diff)
-
EDIT4/ED4_search.cxx (modified) (5 diffs)
-
EDIT4/ED4_terminal.cxx (modified) (2 diffs)
-
EDIT4/ED4_visualizeSAI.cxx (modified) (1 diff)
-
GENOM/EXP_interface.cxx (modified) (1 diff)
-
GENOM/GEN_interface.cxx (modified) (1 diff)
-
GENOM/GEN_map.cxx (modified) (2 diffs)
-
GENOM/GEN_translations.cxx (modified) (1 diff)
-
MERGE/MG_alignment.cxx (modified) (1 diff)
-
MERGE/MG_main.cxx (modified) (1 diff)
-
MERGE/MG_species.cxx (modified) (2 diffs)
-
NTREE/NT_cb.cxx (modified) (1 diff)
-
NTREE/NT_concatenate.cxx (modified) (4 diffs)
-
NTREE/NT_extern.cxx (modified) (2 diffs)
-
NTREE/NT_main.cxx (modified) (3 diffs)
-
NTREE/ad_ali.cxx (modified) (1 diff)
-
NTREE/ad_transpro.cxx (modified) (2 diffs)
-
PARSIMONY/PARS_main.cxx (modified) (2 diffs)
-
PRIMER_DESIGN/primer_design.cxx (modified) (1 diff)
-
PROBE_DESIGN/probe_design.cxx (modified) (4 diffs)
-
SECEDIT/SEC_graphic.cxx (modified) (1 diff)
-
SECEDIT/SEC_main.cxx (modified) (4 diffs)
-
SL/DB_QUERY/db_query.cxx (modified) (6 diffs)
-
SL/DB_UI/ui_species.cxx (modified) (3 diffs)
-
SL/FAST_ALIGNER/fast_aligner.cxx (modified) (1 diff)
-
SL/TREEDISP/TreeDisplay.cxx (modified) (1 diff)
-
WINDOW/AW_advice.cxx (modified) (1 diff)
-
WINDOW/AW_button.cxx (modified) (1 diff)
-
WINDOW/AW_modal.cxx (modified) (4 diffs)
-
WINDOW/AW_nawar.cxx (modified) (1 diff)
-
WINDOW/AW_preset.cxx (modified) (2 diffs)
-
WINDOW/AW_question.cxx (modified) (2 diffs)
-
WINDOW/AW_status.cxx (modified) (2 diffs)
-
WINDOW/AW_window.cxx (modified) (1 diff)
-
WINDOW/Makefile (modified) (3 diffs)
-
WINDOW/aw_question.hxx (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ARB_GDE/GDE_event.cxx
r8356 r8359 332 332 333 333 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); 335 335 336 336 switch (replace_mode) { … … 373 373 ACCEPT_CHANGE = 0, 374 374 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); 376 376 377 377 if (change_mode == REJECT_CHANGE) writeSequence = false; -
trunk/AWT/AWT_asciiprint.cxx
r8355 r8359 146 146 if (f) { 147 147 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")) { 149 149 return; 150 150 } -
trunk/AWT/AWT_input_mask.cxx
r8355 r8359 2247 2247 2248 2248 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"); 2250 2250 switch (answer) { 2251 2251 case 0: -
trunk/AWTI/AWTI_import.cxx
r8355 r8359 747 747 " or a long comment in a sequence\n", file, line); 748 748 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")) { 750 750 case 0: 751 751 max_line *= 2; … … 1125 1125 1126 1126 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", 1128 1129 "Generate new short names (recommended),Use found names")==0) 1129 1130 { -
trunk/EDIT4/ED4_ProteinViewer.cxx
r8309 r8359 464 464 e4_assert(ASKtoOverWriteData); 465 465 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); 467 467 } 468 468 if (skip_sp) { … … 539 539 if (giNewAlignments>0) { 540 540 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);543 541 aw_message(msg); 544 545 542 free(msg); 546 543 -
trunk/EDIT4/ED4_base.cxx
r8355 r8359 302 302 #if defined(DEBUG) && 1 303 303 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!");305 304 #endif 306 305 GBDATA *gb_lastSon = GB_search_last_son(gb_species_data); -
trunk/EDIT4/ED4_edit_string.cxx
r8355 r8359 1074 1074 if (write_fault) { 1075 1075 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!"); 1086 1079 } 1087 1080 } -
trunk/EDIT4/ED4_search.cxx
r8355 r8359 98 98 complement = 0; 99 99 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)"); 101 101 } 102 102 } … … 992 992 ++result_counter; 993 993 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) { 995 996 max_allowed_results = max_allowed_results*2; 996 997 } … … 1536 1537 1537 1538 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) { 1539 1540 error = "Wont overwrite existing file"; 1540 1541 } … … 1585 1586 } 1586 1587 1587 if (error) aw_ popup_ok(error);1588 if (error) aw_message(error); 1588 1589 else AW_POPDOWN(aw); 1589 1590 … … 1648 1649 } 1649 1650 1650 if (error) aw_ popup_ok(error);1651 if (error) aw_message(error); 1651 1652 else AW_POPDOWN(aw); 1652 1653 -
trunk/EDIT4/ED4_terminal.cxx
r8355 r8359 226 226 227 227 if (old_checksum != new_checksum) { 228 if (aw_question( "Checksum changed!", "Allow, Reject") == 1) {228 if (aw_question(NULL, "Checksum changed!", "Allow, Reject") == 1) { 229 229 allow_write_data = false; 230 230 } … … 1375 1375 #endif 1376 1376 if (!update_likelihood()) { 1377 aw_ popup_ok("Can't calculate likelihood.");1377 aw_message("Can't calculate likelihood."); 1378 1378 return ED4_R_IMPOSSIBLE; 1379 1379 } -
trunk/EDIT4/ED4_visualizeSAI.cxx
r8355 r8359 477 477 478 478 static 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?"); 480 480 if (delete_table) { 481 481 AW_root *aw_root = aws->get_root(); -
trunk/GENOM/EXP_interface.cxx
r8355 r8359 274 274 275 275 static 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")) { 277 277 GBDATA *gb_main = (GBDATA*)cl_gb_main; 278 278 GB_transaction ta(gb_main); -
trunk/GENOM/GEN_interface.cxx
r8355 r8359 910 910 911 911 static 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?")) { 913 913 GBDATA *gb_main = (GBDATA*)cl_gb_main; 914 914 GB_transaction ta(gb_main); -
trunk/GENOM/GEN_map.cxx
r8358 r8359 753 753 754 754 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); 756 756 757 757 create_new_gene_species = false; … … 768 768 if (gb_ali) { // the alignment already exists 769 769 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); 771 771 772 772 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 198 198 AW_repeated_question* q = ok_to_ignore_wrong_start_codon; 199 199 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", 201 202 "Ignore and remove,Keep translation", "all", false) == 0) { 202 203 retry++; -
trunk/MERGE/MG_alignment.cxx
r8355 r8359 139 139 static void MG_ad_al_delete_cb(AW_window *aww, AW_CL db_nr) 140 140 { 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?")) { 142 142 char buffer[256]; 143 143 sprintf(buffer, "tmp/merge%li/alignment_name", db_nr); -
trunk/MERGE/MG_main.cxx
r8358 r8359 197 197 if (dest_is_new) { 198 198 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"); 200 200 } 201 201 else { -
trunk/MERGE/MG_species.cxx
r8355 r8359 688 688 689 689 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" 691 692 "Choose one destination alignment or ABORT", b); 692 693 free(b); … … 773 774 } 774 775 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" 776 778 " You may:\n" 777 779 " - Overwrite existing species\n" -
trunk/NTREE/NT_cb.cxx
r8355 r8359 33 33 34 34 void 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" 36 37 "This will destroy primary data !!!")) 37 38 { -
trunk/NTREE/NT_concatenate.cxx
r8309 r8359 300 300 301 301 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)); 303 303 if (!overwrite) { 304 304 error = "Alignment exists! Quitting function..."; … … 341 341 char *speciesName = GB_read_string(GB_entry(gb_species, "full_name")); 342 342 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); 344 344 if (!skip_ali) { 345 345 ali_len = GBT_get_alignment_len(GLOBAL_gb_main, const_ali_name); … … 655 655 if (error) { 656 656 gb_new_species = 0; 657 aw_ popup_ok(error);657 aw_message(error); 658 658 } 659 659 … … 671 671 error = GBT_add_new_changekey(gb_main, new_field_name, GB_STRING); 672 672 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)); 674 675 if (!overwrite) return error; 675 676 } -
trunk/NTREE/NT_extern.cxx
r8358 r8359 251 251 #endif // DEBUG 252 252 253 const char *quit_buttons = "Quit ARB,Do NOT quit"; 253 254 if (secs) { 254 255 secs = GB_time_of_day() - secs; 255 256 if (secs>10) { 256 257 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); 258 259 free(question); 259 260 if (dontQuit) return; … … 261 262 } 262 263 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; 264 265 } 265 266 } -
trunk/NTREE/NT_main.cxx
r8246 r8359 109 109 default: { 110 110 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); 112 112 113 113 switch (answer) { … … 244 244 245 245 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))) { 247 247 GB_ERROR error = 0; 248 248 error = GB_delete_database(db_server); … … 479 479 full_path, load_file_err); 480 480 481 int ans = aw_question( msg, "Browser,Exit");481 int ans = aw_question(NULL, msg, "Browser,Exit"); 482 482 action = ans ? EXIT : BROWSE_DB; 483 483 } 484 484 else { 485 485 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"); 487 487 } 488 488 } -
trunk/NTREE/ad_ali.cxx
r8355 r8359 80 80 81 81 static 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")) { 83 83 char *source = aww->get_root()->awar("presets/use")->read_string(); 84 84 GB_transaction ta(GLOBAL_gb_main); -
trunk/NTREE/ad_transpro.cxx
r8355 r8359 55 55 const char *msg = GBS_global_string("You have not selected a destination alignment\n" 56 56 "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)) { 58 58 error = "Cancelled by user"; 59 59 } … … 694 694 695 695 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))) { 697 697 error = GBS_global_string("Missing %li columns in alignment '%s'", neededLength, ali_dest); 698 698 } -
trunk/PARSIMONY/PARS_main.cxx
r8358 r8359 1214 1214 long tree_size = GBT_size_of_tree(GLOBAL_gb_main, tree_name); 1215 1215 if (tree_size == -1) { 1216 error = GB_export_error("Please select an existing tree");1216 error = "Please select an existing tree"; 1217 1217 } 1218 1218 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")); 1221 1224 } 1222 1225 } … … 1241 1244 GB_begin_transaction(GLOBAL_gb_main); 1242 1245 { 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) { 1248 1253 GB_commit_transaction(GLOBAL_gb_main); 1249 1254 return; -
trunk/PRIMER_DESIGN/primer_design.cxx
r8355 r8359 128 128 129 129 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) { 131 131 return; 132 132 } -
trunk/PROBE_DESIGN/probe_design.cxx
r8355 r8359 499 499 abort = true; 500 500 } 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" 502 503 " The following names are new to it:\n" 503 504 " %s\n" … … 1408 1409 } 1409 1410 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 { 1417 1412 int *resolution_idx = new int[bases_to_resolve]; 1418 1413 int *resolution_max_idx = new int[bases_to_resolve]; … … 1658 1653 static void pd_kill_pt_server(AW_window *aww, AW_CL kill_all) 1659 1654 { 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"))) { 1663 1657 long min = 0; 1664 1658 long max = 0; … … 1747 1741 1748 1742 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" 1751 1746 "Until the new server has analyzed all data, no server functions are available.\n\n" 1752 1747 "Note 1: You must have the write permissions to do that ($ARBHOME/lib/pts/xxx))\n" -
trunk/SECEDIT/SEC_graphic.cxx
r8355 r8359 114 114 115 115 sec_assert(error); 116 aw_ popup_ok(error);116 aw_message(error); 117 117 118 118 char *retry = aw_input(question, answer); -
trunk/SECEDIT/SEC_main.cxx
r8355 r8359 311 311 312 312 free(filename); 313 if (error) aw_ popup_ok(error);313 if (error) aw_message(error); 314 314 } 315 315 … … 430 430 free(filename); 431 431 } 432 if (error) aw_ popup_ok(error);432 if (error) aw_message(error); 433 433 } 434 434 … … 498 498 bool done = false; 499 499 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")) { 501 501 case 0: // default bone 502 502 error = structure->copyTo("Default"); … … 529 529 530 530 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()))) { 532 532 GB_ERROR error = structure->remove(); 533 533 if (error) aw_message(error); -
trunk/SL/DB_QUERY/db_query.cxx
r8356 r8359 527 527 } 528 528 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))) { 530 530 GB_abort_transaction(query->gb_main); 531 531 return; … … 1560 1560 switch (selector.type) { 1561 1561 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" 1563 1564 " The name is used to link database entries and trees\n" 1564 1565 " -> ALL TREES WILL BE LOST\n" … … 1569 1570 } 1570 1571 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" 1572 1574 " -> Pseudo-species will loose their link to the gene" 1573 1575 " -> The new name MUST be UNIQUE" … … 1577 1579 } 1578 1580 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" 1580 1583 " -> The new name MUST be UNIQUE" 1581 1584 " if not you will corrupt the database!", … … 1605 1608 while (!error && !(gb_key_name = GB_find_string(gb_key_data, CHANGEKEY_NAME, key, GB_IGNORE_CASE, SEARCH_GRANDCHILD))) { 1606 1609 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")) { 1608 1611 error = "Aborted by user"; 1609 1612 } … … 1621 1624 else { 1622 1625 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) 1624 1627 { 1625 1628 error = "Aborted by user"; -
trunk/SL/DB_UI/ui_species.cxx
r8355 r8359 234 234 } 235 235 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?")) { 237 237 arb_progress progress("Recreating species name", 1); 238 238 error = AWTC_recreate_name(gb_species); … … 259 259 error = "Please select a species first"; 260 260 } 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))) { 262 262 GB_transaction ta(gb_main); 263 263 error = GB_delete(gb_species); … … 968 968 969 969 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", 971 971 "Continue and destroy all name-fields,Abort"); 972 972 -
trunk/SL/FAST_ALIGNER/fast_aligner.cxx
r8355 r8359 1580 1580 toAlignSequence->name(), long(bestScore+.5), long(bestMirroredScore+.5)); 1581 1581 } 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; 1583 1583 } 1584 1584 else { -
trunk/SL/TREEDISP/TreeDisplay.cxx
r8355 r8359 613 613 const char *msg = GBS_global_string("What to do with group '%s'?", gname); 614 614 615 switch (aw_question( msg, "Rename,Destroy,Cancel")) {615 switch (aw_question(NULL, msg, "Rename,Destroy,Cancel")) { 616 616 case 0: { // rename 617 617 char *new_gname = aw_input("Rename group", "Change group name:", at->name); -
trunk/WINDOW/AW_advice.cxx
r8358 r8359 141 141 AW_awar *awar_disabled = get_disabled_advices(); 142 142 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."; 146 147 147 148 if (entries>0) { 148 149 aw_assert(entries>1); 149 150 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); 155 156 156 157 free(nosemi); -
trunk/WINDOW/AW_button.cxx
r8355 r8359 1991 1991 if (selection_list->value_equal_display) { // here no comma should occur 1992 1992 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)); 1994 1994 } 1995 1995 -
trunk/WINDOW/AW_modal.cxx
r8309 r8359 14 14 #include <aw_awar.hxx> 15 15 #include "aw_root.hxx" 16 #include "aw_question.hxx" 17 #include "aw_advice.hxx" 18 #include "aw_msg.hxx" 16 19 17 20 #include <arbdbt.h> … … 55 58 // aw_question 56 59 57 int aw_question(const char *question, const char *buttons, bool fixedSizeButtons, const char *helpfile) { 60 void 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 82 int aw_question(const char *uniqueID, const char *question, const char *buttons, bool fixedSizeButtons, const char *helpfile) { 58 83 // return 0 for first button, 1 for second button, 2 for third button, ... 59 84 // … … 73 98 AW_root *root = AW_root::SINGLETON; 74 99 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); 103 146 104 147 #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); 108 149 #endif // DEBUG 109 150 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(); 147 239 } 148 240 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); 163 285 } 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); 208 291 209 292 switch (aw_message_cb_result) { … … 219 302 } 220 303 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);304 bool aw_ask_sure(const char *uniqueID, const char *msg) { 305 return aw_question(uniqueID, msg, "Yes,No", true, NULL) == 0; 306 } 307 void aw_popup_ok(const char *msg) { 308 aw_question(NULL, msg, "Ok", true, NULL); 309 } 310 void aw_popup_exit(const char *msg) { 311 aw_question(NULL, msg, "EXIT", true, NULL); 229 312 aw_assert(0); // should not be reached 230 313 exit(EXIT_FAILURE); -
trunk/WINDOW/AW_nawar.cxx
r8355 r8359 717 717 char *dir = awar_dir->read_string(); 718 718 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))) { 720 720 GB_ERROR error = GB_create_directory(dir); 721 721 if (error) aw_message(GBS_global_string("Failed to create directory '%s' (Reason: %s)", dir, error)); -
trunk/WINDOW/AW_preset.cxx
r8358 r8359 21 21 #include "aw_device.hxx" 22 22 #include "aw_root.hxx" 23 #include "aw_question.hxx" 23 24 24 25 #include <arbdbt.h> … … 1097 1098 1098 1099 static 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); 1100 1102 } 1101 1103 void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm) { add_common_property_menu_entries(awmm); } -
trunk/WINDOW/AW_question.cxx
r6867 r8359 25 25 } 26 26 27 int AW_repeated_question::get_answer(const char * question, const char *buttons, const char *to_all, bool add_abort)27 int AW_repeated_question::get_answer(const char *uniqueID, const char *question, const char *buttons, const char *to_all, bool add_abort) 28 28 { 29 29 if (!buttons_used) { … … 81 81 } 82 82 83 int user_answer = aw_question( question, new_buttons, true, helpfile);83 int user_answer = aw_question(uniqueID, question, new_buttons, true, helpfile); 84 84 85 85 if (dont_ask_again) { // ask question as normal when called first (dont_ask_again later) -
trunk/WINDOW/AW_status.cxx
r8355 r8359 404 404 #endif // TRACE_STATUS_MORE 405 405 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" 407 408 "Either wait again for the abortion,\n" 408 409 "kill the calculating process or\n" … … 449 450 } 450 451 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?")) { 452 453 return; // don't abort 453 454 } -
trunk/WINDOW/AW_window.cxx
r8357 r8359 1707 1707 if ((p_global->main_aww == aww) || !p_global->main_aww->is_shown()) { 1708 1708 #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; 1710 1710 #endif 1711 1711 exit(0); -
trunk/WINDOW/Makefile
r8358 r8359 319 319 AW_help.o: $(ARBHOME)/INCLUDE/test_global.h 320 320 321 AW_modal.o: aw_advice.hxx 321 322 AW_modal.o: aw_awar.hxx 322 323 AW_modal.o: aw_base.hxx … … 324 325 AW_modal.o: aw_global.hxx 325 326 AW_modal.o: aw_keysym.hxx 327 AW_modal.o: aw_msg.hxx 328 AW_modal.o: aw_question.hxx 326 329 AW_modal.o: aw_root.hxx 327 330 AW_modal.o: aw_window.hxx … … 385 388 AW_preset.o: aw_position.hxx 386 389 AW_preset.o: aw_preset.hxx 390 AW_preset.o: aw_question.hxx 387 391 AW_preset.o: aw_root.hxx 388 392 AW_preset.o: aw_window.hxx -
trunk/WINDOW/aw_question.hxx
r8356 r8359 29 29 #endif 30 30 31 // for simple questions use: int aw_question(const char *msg, const char *buttons, ...)32 //33 31 // if you ask the same question in a loop, it is recommended to use AW_repeated_question 34 32 // to avoid asking the same question again and again. … … 37 35 // 2. call get_answer() inside the loop 38 36 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 39 46 class AW_repeated_question : virtual Noncopyable { 40 private:41 47 int answer; 42 48 bool dont_ask_again; … … 58 64 void add_help(const char *help_file); // when called, a help button is added to the prompter 59 65 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); 61 67 // return 0 for first button, 1 for second button, 2 for third button, ... 62 68 // the single buttons are separated by commas (i.e. "YES,NO") … … 64 70 }; 65 71 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; 72 int aw_question(const char *uniqueID, const char *msg, const char *buttons, bool fixedSizeButtons = true, const char *helpfile = 0); 73 bool 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! 76 void aw_popup_ok (const char *msg); 77 void aw_popup_exit(const char *msg) __ATTR__NORETURN; 78 79 void AW_reactivate_all_questions(); 70 80 71 81 #else
