void read_all_groups(void) { int rc,c; char the_path[FMSIZE],directory[15]; /* char status[50]; */ if (ncn<0) { return; } strcpy( the_path, article_path ); /* save article_path */ for (c=0;c<maximum_group+1;c++) { if (group[c].first_msg<=group[c].last_msg) { /* any articles? */ use_status( 2 ); /* use window info line */ newsgroup_to_directory( group[c].name, directory ); mkdir( article_path, S_IWRITE|S_IREAD ); show_status( group[c].name ); evnt_timer( 1200, 0 ); /* wait 1.2 seconds */ if (ncn>=0) { rc = news_group( group[c].name ); read_all_articles( c, article_path ); group[c].viewed = VIEWED; } hide_status(); } } unload_group( current_newsgroup ); strcpy( article_path, the_path ); /* restore article_path */ }
/* read selected articles in the selected newsgroup */ void read_selected_selected_group(int index) { int rc; char the_path[FMSIZE],directory[15]; if (ncn<0) { return; } if (index<0) { return; } strcpy( the_path, article_path ); /* save article_path */ if (index<maximum_group+1) { newsgroup_to_directory( group[index].name, directory ); mkdir( article_path, S_IWRITE|S_IREAD ); if (ncn>=0) { rc = news_group( group[index].name ); read_selected_articles( index, article_path ); } } strcpy( article_path, the_path ); /* restore article_path */ }
int OptionMenu::detect() { if( !active_flag ) return 0; int bx = (VGA_WIDTH - PAGE_WIDTH) / 2; int by = (VGA_HEIGHT - PAGE_HEIGHT) / 2; Config &tempConfig = config; // int i; int retFlag1 = 1; if( se_vol_slide.detect() == 1) { tempConfig.sound_effect_flag = se_vol_slide.view_recno > 0; if( se_vol_slide.view_recno > 0) tempConfig.sound_effect_volume = slide_to_percent_volume(se_vol_slide.view_recno); else tempConfig.sound_effect_volume = 1; // never set sound_effect_volume = 0 audio.set_wav_volume(tempConfig.sound_effect_volume); // change music volume, sound effect volume may change music volume if( tempConfig.music_flag ) { music.change_volume( tempConfig.wav_music_volume); } } // else if( music_vol_slide.detect() == 1) // { // tempConfig.music_flag = music_vol_slide.view_recno > 0; // tempConfig.wav_music_volume = slide_to_percent_volume(music_vol_slide.view_recno); // if( tempConfig.music_flag ) // { // music.change_volume( tempConfig.wav_music_volume ); // } // } else if( music_group.detect() >= 0 ) { tempConfig.music_flag = music_group[music_group()].custom_para.value; } else if( frame_speed_slide.detect() == 1) { tempConfig.frame_speed = frame_speed_slide.view_recno <= 30 ? frame_speed_slide.view_recno : 99; } else if( scroll_speed_slide.detect() == 1) { tempConfig.scroll_speed = scroll_speed_slide.view_recno; } else retFlag1 = 0; int retFlag2 = 0; // for( i = 0; i < MAX_RACE; ++i ) // { // if( race_button[i].detect() ) // { // if( config.music_flag ) // { // music.play( race_button[i].custom_para.value + 1, // sys.cdrom_drive ? MUSIC_CD_THEN_WAV : 0 ); // } // else // { // // stop any music playing // music.stop(); // } // retFlag2 = 1; // } // } int retFlag3 = 1; if( help_group.detect() >= 0) { tempConfig.help_mode = help_group[help_group()].custom_para.value; //refresh_flag |= IGOPTION_HELP; update_flag |= IGOPTION_HELP; } else if( news_group.detect() >= 0) { tempConfig.disp_news_flag = news_group[news_group()].custom_para.value; //refresh_flag |= IGOPTION_HELP; update_flag |= IGOPTION_HELP; } else if( report_group.detect() >= 0) { tempConfig.opaque_report = report_group[report_group()].custom_para.value; //refresh_flag |= IGOPTION_REPORT; update_flag |= IGOPTION_REPORT; } else if( show_icon_group.detect() >= 0) { tempConfig.show_all_unit_icon = show_icon_group[show_icon_group()].custom_para.value; //refresh_flag |= IGOPTION_SHOW_ICON; update_flag |= IGOPTION_SHOW_ICON; } else if( show_path_group.detect() >= 0) { tempConfig.show_unit_path = show_path_group[show_path_group()].custom_para.value; //refresh_flag |= IGOPTION_DRAW_PATH; update_flag |= IGOPTION_DRAW_PATH; } else if( inside_info_group.detect() >= 0) { tempConfig.disp_extend_info = inside_info_group[inside_info_group()].custom_para.value; update_flag |= IGOPTION_INSIDE_INFO; } else if( scroll_method_group.detect() >= 0) { tempConfig.scroll_method = scroll_method_group[scroll_method_group()].custom_para.value; update_flag |= IGOPTION_SCROLL_METHOD; } else if( start_button.detect(KEY_RETURN) ) { // detect return button if( &config != &tempConfig) config = tempConfig; exit(1); if( update_flag ) { // save config Config fileConfig; if( !fileConfig.load("config.dat") ) fileConfig.init(); fileConfig.change_preference(tempConfig); fileConfig.save("config.dat"); } } else if( cancel_button.detect(KEY_ESC) ) { config = old_config; exit(0); } else retFlag3 = 0; return retFlag1 || retFlag2 || retFlag3; }