public void Click_AddFrames() { if (CheckBusy()) { return; } if (ProjectManager.CurrentProject.Frames.Count == 0) { using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.SelectFolder, Message.GetString("Select Folder"))) { if (Directory.Exists(LSSettings.LastImgDir)) { fdlg.InitialDirectory = LSSettings.LastImgDir; } if (fdlg.Show() == WindowResponse.Ok) { LSSettings.LastImgDir = fdlg.SelectedPath; LSSettings.Save(); if (ProjectManager.AddFrames(fdlg.SelectedPath)) { SetSaveStatus(false); } else { MsgBox.ShowMessage(MessageContent.NotEnoughValidFiles); } } } } else { MsgBox.ShowMessage(MessageContent.FramesAlreadyAdded); } }
public void Click_SaveProject(bool alwaysAsk) { if (CheckBusy()) { return; } if (File.Exists(ProjectSavePath) && !alwaysAsk) { SavingProject(); } else { using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.SaveFile, Message.GetString("Save Project"))) { fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("LapseStudio Project"), "lasp")); if (Directory.Exists(LSSettings.LastProjDir)) { fdlg.InitialDirectory = LSSettings.LastProjDir; } if (fdlg.Show() == WindowResponse.Ok) { if (Path.GetExtension(fdlg.SelectedPath) != ".lasp") { Path.ChangeExtension(fdlg.SelectedPath, ".lasp"); } LSSettings.LastProjDir = Path.GetDirectoryName(fdlg.SelectedPath); LSSettings.Save(); ProjectSavePath = fdlg.SelectedPath; SavingProject(); } } } SetSaveStatus(true); }
public void BrowseRT() { using (FileDialog dlg = FileDlg.CreateDialog(FileDialogType.OpenFile, "Title")) { if (!string.IsNullOrWhiteSpace(RTPath) && Directory.Exists(Path.GetDirectoryName(RTPath))) { dlg.InitialDirectory = Path.GetDirectoryName(RTPath); } else { switch (ProjectManager.RunningPlatform) { case Platform.MacOSX: dlg.InitialDirectory = "/Applications/"; break; case Platform.Unix: dlg.InitialDirectory = "/usr/bin/"; break; case Platform.Windows: dlg.InitialDirectory = @"C:\Program Files\"; break; } } switch (ProjectManager.RunningPlatform) { case Platform.MacOSX: dlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("Application"), "app", "App")); break; case Platform.Windows: dlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("Executable"), "exe")); break; } if (dlg.Show() == WindowResponse.Ok) { RTPath = dlg.SelectedPath; } } }
public void Click_OpenProject() { if (CheckBusy()) { return; } using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open Project"))) { fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("LapseStudio Project"), "lasp")); if (Directory.Exists(LSSettings.LastProjDir)) { fdlg.InitialDirectory = LSSettings.LastProjDir; } if (fdlg.Show() == WindowResponse.Ok) { LSSettings.LastProjDir = System.IO.Path.GetDirectoryName(fdlg.SelectedPath); LSSettings.Save(); ProjectSavePath = fdlg.SelectedPath; OpeningProject(); } } SetSaveStatus(true); }
public void OpenMetaData(int index) { if (LSSettings.UsedProgram == ProjectType.CameraRaw) { XMP CurXmp = ((FrameACR)ProjectManager.CurrentProject.Frames[index]).XMPFile; if (CurXmp == null || (CurXmp != null && CurXmp.Values.Count == 0)) { WindowResponse res = MsgBox.Show(Message.GetString(@"No XMP associated with this file. Do you want to reload to check if there is one now? Yes reloads the files XMP values. No lets you load values from a standalone XMP file."), MessageWindowType.Question, MessageWindowButtons.YesNoCancel); if (res == WindowResponse.Yes) { ProjectManager.ReadXMP(); return; } else if (res == WindowResponse.Cancel) { return; } using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open XMP"))) { fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("XMP"), "xmp", "XMP")); if (Directory.Exists(LSSettings.LastMetaDir)) { fdlg.InitialDirectory = LSSettings.LastMetaDir; } if (fdlg.Show() == WindowResponse.Ok) { LSSettings.LastMetaDir = Path.GetDirectoryName(fdlg.SelectedPath); LSSettings.Save(); ProjectManager.AddKeyframe(index, fdlg.SelectedPath); } } } else { ProjectManager.AddKeyframe(index); } } else if (LSSettings.UsedProgram == ProjectType.RawTherapee) { using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.OpenFile, Message.GetString("Open PP3"))) { fdlg.AddFileTypeFilter(new FileTypeFilter(Message.GetString("Postprocessing Profile"), "PP3", "pp3")); if (Directory.Exists(LSSettings.LastMetaDir)) { fdlg.InitialDirectory = LSSettings.LastMetaDir; } if (fdlg.Show() == WindowResponse.Ok) { LSSettings.LastMetaDir = Path.GetDirectoryName(fdlg.SelectedPath); LSSettings.Save(); ProjectManager.AddKeyframe(index, fdlg.SelectedPath); } } } else { ProjectManager.AddKeyframe(index); } if (ProjectManager.CurrentProject.Frames[index].IsKeyframe) { MsgBox.ShowMessage(MessageContent.KeyframeAdded); } else { MsgBox.ShowMessage(MessageContent.KeyframeNotAdded); } }
public void ProcessFiles() { bool ask = true; if (LSSettings.UsedProgram == ProjectType.CameraRaw) { ask = false; } else if (LSSettings.UsedProgram == ProjectType.LapseStudio) { ask = true; ((ProjectLS)ProjectManager.CurrentProject).SaveFormat = LSSettings.SaveFormat; } else if (LSSettings.UsedProgram == ProjectType.RawTherapee) { if (!File.Exists(LSSettings.RTPath)) { string NewRTPath = ProjectRT.SearchForRT(); if (NewRTPath != null) { LSSettings.RTPath = NewRTPath; LSSettings.Save(); ((ProjectRT)ProjectManager.CurrentProject).RTPath = NewRTPath; } else { MsgBox.Show(Message.GetString("RawTherapee can't be found. Abort!")); return; } } ask = ((ProjectRT)ProjectManager.CurrentProject).RunRT; ((ProjectRT)ProjectManager.CurrentProject).SaveFormat = LSSettings.SaveFormat; } if (ask) { using (FileDialog fdlg = FDialog.CreateDialog(FileDialogType.SelectFolder, Message.GetString("Select Folder"))) { if (Directory.Exists(LSSettings.LastProcDir)) { fdlg.InitialDirectory = LSSettings.LastProcDir; } if (fdlg.Show() == WindowResponse.Ok) { LSSettings.LastProcDir = fdlg.SelectedPath; LSSettings.Save(); if (ProjectManager.CurrentProject.IsBrightnessCalculated) { ProjectManager.SetAltBrightness(MainGraph.Points); } ProjectManager.ProcessFiles(fdlg.SelectedPath); } } } else { if (ProjectManager.CurrentProject.IsBrightnessCalculated) { ProjectManager.SetAltBrightness(MainGraph.Points); } ProjectManager.ProcessFiles(); } SetSaveStatus(false); }