Beispiel #1
0
        private void configurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            readyToRender = false;
            chooseDesiredEngineState();
            engineMgr.UpdateEngineState();
            updateEngineStatusPanel();
            Application.DoEvents();

            FractronConfig prevConfig = new FractronConfig(config);

            ConfigForm   dlg    = new ConfigForm(Config, engineMgr);
            DialogResult result = dlg.ShowDialog();

            readyToRender = true;

            if (result == DialogResult.OK)
            {
                config = new FractronConfig(dlg.Config);
            }
            else
            {
                config = new FractronConfig(prevConfig);
            }

            config.Valid = false;

            layoutRenderer();
            chooseDesiredEngineState();

            FractronConfig.Save(config);
        }
Beispiel #2
0
        private void openLibraryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            beginDlg();

            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter           = "Fractal Flame files (*.flame)|*.flame|All Files (*.*)|*.*";
            dlg.DefaultExt       = "flame";
            dlg.CheckFileExists  = true;
            dlg.InitialDirectory = Config.FractalDir;
            DialogResult dlgResult = dlg.ShowDialog();

            if (dlgResult == DialogResult.OK)
            {
                bool loadOk = false;
                try{
                    FractalManager.ReadFromFlameFile(dlg.FileName, config);
                    libraryNameLabel.Text = Path.GetFileName(dlg.FileName);
                    loadOk = true;
                }
                catch (FileNotFoundException ex)
                {
                    MessageBox.Show(ex.Message, "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    ErrorForm.Show(Narratives.Error_FractalOpenFailed, ex);
                }

                if (loadOk)
                {
                    config.CurrentLibraryFile = dlg.FileName;
                    FractronConfig.Save(config);
                    updateLibraryView();
                    sideBar.SelectedTab = libraryPage;
                }
            }

            endDlg();
        }
Beispiel #3
0
 protected override void OnClosed(EventArgs e)
 {
     FractronConfig.Save(config);
     Shutdown();
     base.OnClosed(e);
 }