Esempio n. 1
0
        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;
                }
            }
        }
Esempio n. 2
0
        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);
        }