X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Frecordbatches.C;h=0fe7d76b2f87919bc33d9b39effd83db26ba75bc;hb=5621db270ccbeabc106e0f438941dba6f930652b;hp=861538c468c80ea21e5b9e1dc3def8e588e5e99a;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/recordbatches.C b/cinelerra-5.1/cinelerra/recordbatches.C index 861538c4..0fe7d76b 100644 --- a/cinelerra-5.1/cinelerra/recordbatches.C +++ b/cinelerra-5.1/cinelerra/recordbatches.C @@ -18,7 +18,7 @@ #include "timeentry.h" const char * RecordBatches:: -batch_titles[] = { +default_batch_titles[] = { N_("On"), N_("Path"), N_("News"), N_("Start time"), N_("Duration"), N_("Source"), N_("Mode") }; @@ -37,6 +37,7 @@ load_defaults(ChannelDB * channeldb, Record * record) early_margin = defaults->get("RECORD_EARLY_MARGIN", early_margin); late_margin = defaults->get("RECORD_LATE_MARGIN", late_margin); for(int i = 0; i < BATCH_COLUMNS; i++) { + batch_titles[i] = _(default_batch_titles[i]); sprintf(string, "BATCH_COLUMNWIDTH_%d", i); column_widths[i] = defaults->get(string, default_columnwidth[i]); } @@ -354,21 +355,10 @@ RecordBatchesGUI::Dir:: int RecordBatchesGUI::Dir:: handle_event() { - strncpy(directory, get_text(),sizeof(directory)); - char *bp, *cp, *dp = &directory[0]; - if( *dp ) { - if( dp[0] != '~' || dp[1] != 0 ) { - for( cp=dp; *cp; ++cp ) { - if( *cp != '/' ) continue; - for( bp=cp; *bp=='/'; ++bp ); - if( *bp ) dp = cp; - } - if( *--cp != '/' ) return 1; - while( cp>dp && *cp=='/' ) *cp-- = 0; - } - load_dirs(directory); - calculate_suggestions(dir_entries); - } + char *path = FileSystem::basepath(directory); + load_dirs(path); + calculate_suggestions(dir_entries); + delete [] path; return 1; } @@ -392,28 +382,17 @@ Path(RecordBatches &batches, int x, int y) : BC_TextBox(x, y, 200, 1, batches.get_editing_batch()->asset->path), batches(batches) { - file_entries = new ArrayList; - FileSystem fs; char string[BCTEXTLEN]; -// Load current directory - fs.update(getcwd(string, BCTEXTLEN)); - int total_files = fs.total_files(); - for(int i = 0; i < total_files; i++) { - const char *name = fs.get_entry(i)->get_name(); - file_entries->append(new BC_ListBoxItem(name)); - } } RecordBatchesGUI::Path:: ~Path() { - file_entries->remove_all_objects(); - delete file_entries; } int RecordBatchesGUI::Path:: handle_event() { - calculate_suggestions(file_entries); + calculate_suggestions(); Batch *batch = batches.gui->get_editing_batch(); strcpy(batch->asset->path, get_text()); batches.gui->update_batches();