session->group_number += groups;
switch( edl_mode ) {
case LOADMODE_EDL_CLIP: {
- sprintf(new_edl->local_session->clip_title, _("Clip %d"),
- session->clip_number++);
- char string[BCSTRLEN];
- time_t t; time(&t);
- ctime_r(&t, string);
- snprintf(new_edl->local_session->clip_notes,
- sizeof(new_edl->local_session->clip_notes),
- +("%sFrom: %s"), string, filename);
+ strcpy(new_edl->local_session->clip_title,
+ filenames->get(i));
+ struct stat st;
+ time_t t = !stat(filenames->get(i),&st) ?
+ st.st_mtime : time(&t);
+ ctime_r(&t, new_edl->local_session->clip_notes);
switch( load_mode ) {
case LOADMODE_REPLACE:
case LOADMODE_REPLACE_CONCATENATE:
sprintf(string2, _("Couldn't open %s for writing."), backup_path);
gui->show_message(string2);
}
+ save_undo_data();
}
void MWindow::load_backup()
void MWindow::save_undo_data()
{
- undo_before();
- undo_after(_("perpetual session"), LOAD_ALL);
+ if( stack.size() > 0 ) return;
+ if( !preferences->perpetual_session ) return;
char perpetual_path[BCTEXTLEN];
snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
File::get_config_path(), PERPETUAL_FILE);
void MWindow::load_undo_data()
{
+ if( stack.size() > 0 ) return;
+ if( !preferences->perpetual_session ) return;
char perpetual_path[BCTEXTLEN];
snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
File::get_config_path(), PERPETUAL_FILE);
FILE *fp = fopen(perpetual_path,"r");
if( !fp ) return;
undo->load(fp);
+ undo_before();
+ undo_after(_("perpetual load"), LOAD_ALL);
fclose(fp);
}
+void MWindow::remove_undo_data()
+{
+ if( stack.size() > 0 ) return;
+ char perpetual_path[BCTEXTLEN];
+ snprintf(perpetual_path, sizeof(perpetual_path), "%s/%s",
+ File::get_config_path(), PERPETUAL_FILE);
+ ::remove(perpetual_path);
+}
int MWindow::copy_target(const char *path, const char *target)
{
char progress_title[BCTEXTLEN];
sprintf(progress_title, _("Saving to %s:\n"), dir);
int total_assets = save_edl->assets->total();
+ gui->lock_window("MWindow::save_project");
MainProgressBar *progress = mainprogress->start_progress(progress_title, total_assets);
+ gui->unlock_window();
+
int ret = 0;
Asset *current = save_edl->assets->first;
for( int i=0; !ret && current; ++i, current=NEXT ) {