- for( int i=0; i<folders.size(); ++i )
- if( !strcasecmp(folders[i], folder) ) return;
- folders.append(cstrdup(folder));
+ for( int i=0; i<AWINDOW_FOLDERS; ++i ) {
+ if( !strcmp(title, AWindowGUI::folder_names[i]) )
+ return i;
+ }
+ for( int i=0; i<folders.size(); ++i ) {
+ if( !strcmp(title, folders[i]->title) )
+ return folders[i]->awindow_folder;
+ }
+ return AW_NO_FOLDER;
+}
+
+const char *EDL::get_folder_name(int no)
+{
+ if( no >= 0 && no<AWINDOW_FOLDERS )
+ return AWindowGUI::folder_names[no];
+ BinFolder *fp = get_folder(no);
+ return !fp ? "" : fp->title;
+}
+
+int EDL::new_folder(const char *title)
+{
+ if( !title[0] ) return 1;
+ int ret = get_folder_number(title);
+ if( ret >= 0 ) return 1;
+ int idx = AWINDOW_FOLDERS;
+ for( int i=0; i<folders.size(); ++i ) {
+ BinFolder *fp = folders[i];
+ int no = fp->awindow_folder;
+ if( no >= idx ) idx = no+1;
+ }
+ folders.append(new BinFolder(idx, title));
+ return 0;