From 552cb192aa6e443f9d797710269a40507f51b405 Mon Sep 17 00:00:00 2001 From: Michel Mastriani Date: Thu, 5 Mar 2020 21:17:29 -0300 Subject: [PATCH] OpenExamples Code --- Source/Fractorium/Fractorium.h | 3 +- Source/Fractorium/Fractorium.ui | 301 ++++++++++++++------------ Source/Fractorium/FractoriumMenus.cpp | 7 + archive/build.sh | 1 + archive/build_linux.sh | 1 + 5 files changed, 168 insertions(+), 145 deletions(-) diff --git a/Source/Fractorium/Fractorium.h b/Source/Fractorium/Fractorium.h index 65b5235..128b987 100644 --- a/Source/Fractorium/Fractorium.h +++ b/Source/Fractorium/Fractorium.h @@ -141,6 +141,7 @@ public slots: void OnActionCopyFlameInCurrentFile(bool checked); void OnActionCreateReferenceFile(bool checked); void OnActionOpen(bool checked); + void OnActionOpenExamples(bool checked); void OnActionSaveCurrentAsXml(bool checked); void OnActionSaveEntireFileAsXml(bool checked); void OnActionSaveCurrentScreen(bool checked); @@ -466,7 +467,7 @@ private: void EnableRenderControls(bool enable); //Dialogs. - QStringList SetupOpenXmlDialog(); + QStringList SetupOpenXmlDialog(bool openExamples = false); QString SetupSaveXmlDialog(const QString& defaultFilename); QString SetupSaveImageDialog(const QString& defaultFilename); QString SetupSaveFolderDialog(); diff --git a/Source/Fractorium/Fractorium.ui b/Source/Fractorium/Fractorium.ui index c0867a6..db0668e 100644 --- a/Source/Fractorium/Fractorium.ui +++ b/Source/Fractorium/Fractorium.ui @@ -80,8 +80,8 @@ 0 0 - 1277 - 985 + 1213 + 978 @@ -173,7 +173,7 @@ 0 0 230 - 934 + 928 @@ -263,30 +263,30 @@ false + + 35 + 145 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -455,30 +455,30 @@ false + + 15 + 15 false - - 15 - true false + + 15 + 15 false - - 15 - Geometry @@ -536,30 +536,30 @@ false + + 15 + 15 false - - 15 - true false + + 15 + 15 false - - 15 - Iteration @@ -636,30 +636,30 @@ false + + 15 + 15 false - - 15 - true false + + 15 + 15 false - - 15 - Filter @@ -773,30 +773,30 @@ false + + 35 + 120 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -1123,30 +1123,30 @@ false + + 35 + 145 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -1299,30 +1299,30 @@ false + + 15 + 15 false - - 15 - true false + + 15 + 15 false - - 15 - Animation @@ -1408,30 +1408,30 @@ false + + 35 + 145 false - - 35 - true false + + 22 + 22 false - - 22 - Interpolation @@ -1572,30 +1572,30 @@ false + + 35 + 120 false - - 35 - true false + + 22 + 22 false - - 22 - false @@ -1821,30 +1821,30 @@ false + + 15 + 15 false - - 15 - true false + + 16 + 16 false - - 16 - Color @@ -2093,27 +2093,27 @@ false + + 35 + 35 false - - 35 - false + + 22 + 22 false - - 22 - @@ -2216,10 +2216,10 @@ false - + 35 - + 35 @@ -2231,10 +2231,10 @@ false - + 22 - + 22 @@ -2290,14 +2290,17 @@ true + + 35 + 35 false - - 35 + + 22 22 @@ -2305,9 +2308,6 @@ false - - 22 - @@ -2370,8 +2370,8 @@ 0 0 - 285 - 675 + 389 + 690 @@ -2474,10 +2474,10 @@ false - + 62 - + 62 @@ -2486,15 +2486,15 @@ false + + 22 + 22 false - - 22 - @@ -2713,10 +2713,10 @@ false - + 20 - + 20 @@ -2825,15 +2825,15 @@ false + + 16 + 16 false - - 16 - false @@ -3059,8 +3059,8 @@ 0 0 - 291 - 876 + 277 + 880 @@ -3409,30 +3409,30 @@ false + + 27 + 110 false - - 27 - true false + + 21 + 21 false - - 21 - @@ -3627,27 +3627,27 @@ false - - false - 27 + + false + true false + + 21 + 21 false - - 21 - false @@ -3963,30 +3963,30 @@ false + + 27 + 125 false - - 27 - true false + + 22 + 22 false - - 22 - false @@ -4230,15 +4230,15 @@ false + + 40 + 100 false - - 40 - true @@ -4248,15 +4248,15 @@ false + + 22 + 22 false - - 22 - false @@ -5035,15 +5035,15 @@ false + + 40 + 100 false - - 40 - true @@ -5053,15 +5053,15 @@ false + + 22 + 22 false - - 22 - false @@ -5955,15 +5955,15 @@ 3 + + 10 + 70 true - - 10 - true @@ -6187,8 +6187,8 @@ 0 0 - 267 - 670 + 253 + 646 @@ -6318,7 +6318,7 @@ 0 0 291 - 856 + 854 @@ -6448,10 +6448,10 @@ false - + 22 - + 22 @@ -6463,10 +6463,10 @@ false - + 21 - + 21 @@ -6583,12 +6583,12 @@ false - - 100 - 30 + + 100 + false @@ -6987,30 +6987,30 @@ false + + 27 + 110 false - - 27 - true false + + 22 + 22 false - - 22 - false @@ -7196,7 +7196,7 @@ 0 0 1712 - 20 + 22 @@ -7213,6 +7213,7 @@ + @@ -7428,8 +7429,8 @@ 0 0 - 424 - 574 + 488 + 643 @@ -8690,6 +8691,18 @@ Create a file with a separate flame for each possible variation + + + + :/Fractorium/Icons/folder-visiting-4.png:/Fractorium/Icons/folder-visiting-4.png + + + Open Examples + + + Open Examples + + diff --git a/Source/Fractorium/FractoriumMenus.cpp b/Source/Fractorium/FractoriumMenus.cpp index 31371f8..973966c 100644 --- a/Source/Fractorium/FractoriumMenus.cpp +++ b/Source/Fractorium/FractoriumMenus.cpp @@ -13,6 +13,7 @@ void Fractorium::InitMenusUI() connect(ui.ActionCopyFlameInCurrentFile, SIGNAL(triggered(bool)), this, SLOT(OnActionCopyFlameInCurrentFile(bool)), Qt::QueuedConnection); connect(ui.ActionCreateReferenceFile, SIGNAL(triggered(bool)), this, SLOT(OnActionCreateReferenceFile(bool)), Qt::QueuedConnection); connect(ui.ActionOpen, SIGNAL(triggered(bool)), this, SLOT(OnActionOpen(bool)), Qt::QueuedConnection); + connect(ui.ActionOpenExamples, SIGNAL(triggered(bool)), this, SLOT(OnActionOpenExamples(bool)), Qt::QueuedConnection); connect(ui.ActionSaveCurrentAsXml, SIGNAL(triggered(bool)), this, SLOT(OnActionSaveCurrentAsXml(bool)), Qt::QueuedConnection); connect(ui.ActionSaveEntireFileAsXml, SIGNAL(triggered(bool)), this, SLOT(OnActionSaveEntireFileAsXml(bool)), Qt::QueuedConnection); connect(ui.ActionSaveCurrentScreen, SIGNAL(triggered(bool)), this, SLOT(OnActionSaveCurrentScreen(bool)), Qt::QueuedConnection); @@ -370,6 +371,12 @@ void FractoriumEmberController::OpenAndPrepFiles(const QStringList& filenames /// Ignored void Fractorium::OnActionOpen(bool checked) { m_Controller->OpenAndPrepFiles(SetupOpenXmlDialog(), false); } +/// +/// Show a file open dialog to open examples Xml files. +/// +/// Ignored +void Fractorium::OnActionOpenExamples(bool checked) { m_Controller->OpenAndPrepFiles(SetupOpenXmlDialog(true), false); } + /// /// Save current ember as Xml, using the Xml saving template values from the options. /// This will first save the current ember back to the opened file in memory before diff --git a/archive/build.sh b/archive/build.sh index d827822..dfd59c9 100755 --- a/archive/build.sh +++ b/archive/build.sh @@ -56,6 +56,7 @@ cp *.gradient $FRACTORIUM_FINAL_ROOT cp *.ugr $FRACTORIUM_FINAL_ROOT cp Info.plist $FRACTORIUM_FINAL_ROOT/../ cp -r Bench $FRACTORIUM_FINAL_ROOT +cp -r FlameExamples $FRACTORIUM_FINAL_ROOT cd $FRACTORIUM_RELEASE_ROOT diff --git a/archive/build_linux.sh b/archive/build_linux.sh index 6838f80..1a75004 100755 --- a/archive/build_linux.sh +++ b/archive/build_linux.sh @@ -101,6 +101,7 @@ cp $DATA_PATH/uranium.qss $FRACTORIUM_BIN cp $DATA_PATH/flam3-palettes.xml $FRACTORIUM_BIN cp $DATA_PATH/*.gradient $FRACTORIUM_BIN cp $DATA_PATH/*.ugr $FRACTORIUM_BIN +cp -ar $DATA_PATH/FlameExamples $FRACTORIUM_BIN cp $ICON_PATH/Fractorium.png $FRACTORIUM_ICO/fractorium.png cp $DATA_PATH/fractorium.appimage.desktop $FRACTORIUM_SHR/fractorium.desktop