Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugins/SkyCultureMaker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Sky Culture Maker Plugin - Changelog

## Version 1.0.1

* Fix: Drawn constellations are not reset after "Export and Exit"
* Fix: Stop drawing line key (Double Right Click) only works when Star/DSO is selected
* Fix: Not all SC description input fields that are marked required are actually checked
* Fix: No formal checks for 'Constellations' input field in SC description

## Version 1.0.0

* Initial release of the Sky Culture Maker Plugin
2 changes: 1 addition & 1 deletion plugins/SkyCultureMaker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is the cmake config file for the Sky Culture Maker plugin
SET(SCM_VERSION "1.0.0")
SET(SCM_VERSION "1.0.1")

# Option to manually control converter, defaults to FALSE
OPTION(SCM_SHOULD_ENABLE_CONVERTER "Attempt to enable Sky Culture Converter" FALSE)
Expand Down
36 changes: 20 additions & 16 deletions plugins/SkyCultureMaker/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,53 @@ INCLUDE_DIRECTORIES(
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src)

SET( SkyCultureMaker_SRCS
SkyCultureMaker.hpp
SkyCultureMaker.cpp

ScmDraw.hpp
ScmDraw.cpp
enumBitops.hpp
ScmConstellation.hpp
ScmConstellation.cpp
ScmConstellationArtwork.hpp
ScmConstellationArtwork.cpp
ScmDraw.hpp
ScmDraw.cpp
ScmSkyCulture.hpp
ScmSkyCulture.cpp
SkyCultureMaker.hpp
SkyCultureMaker.cpp

gui/ScmStartDialog.hpp
gui/ScmStartDialog.cpp
gui/ScmConstellationDialog.hpp
gui/ScmConstellationDialog.cpp
gui/ScmSkyCultureDialog.hpp
gui/ScmSkyCultureDialog.cpp
gui/ScmConstellationImageAnchor.hpp
gui/ScmConstellationImageAnchor.cpp
gui/ScmConstellationImage.hpp
gui/ScmConstellationImage.cpp
gui/ScmSkyCultureExportDialog.hpp
gui/ScmSkyCultureExportDialog.cpp
gui/ScmConstellationImageAnchor.hpp
gui/ScmConstellationImageAnchor.cpp
gui/ScmHideOrAbortMakerDialog.hpp
gui/ScmHideOrAbortMakerDialog.cpp
gui/ScmSkyCultureDialog.hpp
gui/ScmSkyCultureDialog.cpp
gui/ScmSkyCultureExportDialog.hpp
gui/ScmSkyCultureExportDialog.cpp
gui/ScmStartDialog.hpp
gui/ScmStartDialog.cpp

types/Anchor.hpp
types/Classification.hpp
types/CoordinateLine.hpp
types/Description.hpp
types/Drawing.hpp
types/DialogID.hpp
types/Drawing.hpp
types/DrawingMode.hpp
types/DrawTools.hpp
types/License.hpp
types/Lines.hpp
types/StarLine.hpp
types/SkyPoint.hpp
types/Anchor.hpp
types/StarLine.hpp
)

SET( SCM_UIS
gui/scmConstellationDialog.ui
gui/scmHideOrAbortMakerDialog.ui
gui/scmSkyCultureDialog.ui
gui/scmSkyCultureExportDialog.ui
gui/scmHideOrAbortMakerDialog.ui
gui/scmStartDialog.ui
)

Expand Down
27 changes: 20 additions & 7 deletions plugins/SkyCultureMaker/src/ScmDraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void scm::ScmDraw::setSearchMode(bool active)
if (inSearchMode == true && active == false)
{
// only allow search and find for normal constellations
if(drawingMode == DrawingMode::StarsAndDSO)
if (drawingMode == DrawingMode::StarsAndDSO)
{
selectedStarIsSearched = true;
}
Expand Down Expand Up @@ -246,15 +246,28 @@ void scm::ScmDraw::handleMouseClicks(class QMouseEvent *event)
}

// Reset line drawing
if (event->button() == Qt::RightButton && event->type() == QEvent::MouseButtonDblClick &&
hasFlag(drawState, Drawing::hasEnd))
if (event->button() == Qt::RightButton && event->type() == QEvent::MouseButtonDblClick)
{
if (!drawnLines.coordinates.empty())
// this allows the double click to cancel drawing even if hovering over a star
// or when in coordinate mode
if (hasFlag(drawState, Drawing::hasEnd))
{
drawnLines.coordinates.pop_back();
drawnLines.stars.pop_back();
if (!drawnLines.coordinates.empty())
{
drawnLines.coordinates.pop_back();
drawnLines.stars.pop_back();
}
drawState = Drawing::None;
}
drawState = Drawing::None;
else if (hasFlag(drawState, Drawing::hasFloatingEnd))
{
std::get<CoordinateLine>(currentLine).start.set(0, 0, 0);
std::get<CoordinateLine>(currentLine).end.set(0, 0, 0);
std::get<StarLine>(currentLine).start.reset();
std::get<StarLine>(currentLine).end.reset();
drawState = Drawing::None;
}

event->accept();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/SkyCultureMaker/src/gui/ScmSkyCultureDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void ScmSkyCultureDialog::saveSkyCulture()
// check if description is complete
if (!desc.isComplete())
{
maker->showUserWarningMessage(dialog, ui->titleBar->title(), q_("The sky culture description is not complete. Please fill in all required fields."));
maker->showUserWarningMessage(dialog, ui->titleBar->title(), q_("The sky culture description is not complete. Please fill in all required fields correctly."));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ void ScmSkyCultureExportDialog::exportAndExitSkyCulture()
maker->resetScmDialogs();
maker->hideAllDialogs();
maker->setIsScmEnabled(false);
maker->setNewSkyCulture();
}

bool ScmSkyCultureExportDialog::saveSkyCultureCMakeListsFile(const QDir& directory)
Expand Down
2 changes: 1 addition & 1 deletion plugins/SkyCultureMaker/src/gui/scmSkyCultureDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<item>
<widget class="QTabWidget" name="tabs">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<property name="iconSize">
<size>
Expand Down
12 changes: 8 additions & 4 deletions plugins/SkyCultureMaker/src/types/Description.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,20 @@ struct Description

/**
* @brief Check if the description is complete.
* @return true if all required fields are filled, false otherwise.
* @return true if all required fields are correctly filled, false otherwise.
*/
bool isComplete() const
{
return !name.trimmed().isEmpty() &&
!authors.trimmed().isEmpty() &&
license != scm::LicenseType::NONE &&
!introduction.trimmed().isEmpty() &&
!cultureDescription.trimmed().isEmpty() &&
!about.trimmed().isEmpty() &&
!constellations.trimmed().isEmpty() &&
// at least one constellation name. this is a very basic check but at least makes the user aware of the markdown sections
constellations.contains("##### ") &&
!references.trimmed().isEmpty() &&
!authors.trimmed().isEmpty() &&
!about.trimmed().isEmpty() &&
license != scm::LicenseType::NONE &&
classification != scm::ClassificationType::NONE;
}
};
Expand Down
Loading