Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable selector empty option and clean python api Conda build linker warnings #3557

Merged
merged 1 commit into from
Mar 12, 2024
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ include_directories ("${PROJECT_SOURCE_DIR}/lib/osgl/glad/include")
if (WIN32)
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
endif ()
if (BUILD_VDC)
if (BUILD_VDC AND EXISTS ${PYTHONPATH}/lib-dynload)
link_directories (${PYTHONPATH}/lib-dynload)
endif ()

Expand Down
10 changes: 9 additions & 1 deletion apps/vaporgui/PStringDropdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ PStringDropdown::PStringDropdown(const std::string &tag, const std::vector<std::

void PStringDropdown::SetItems(const std::vector<std::string> &items) const { _vComboBox->SetOptions(items); }

void PStringDropdown::updateGUI() const { _vComboBox->SetValue(getParamsString()); }
void PStringDropdown::updateGUI() const
{
auto val = getParamsString();
if (val.empty())
val = _customBlankText;
_vComboBox->SetValue(val);
}

void PStringDropdown::setCustomBlankText(std::string text) { _customBlankText = text; }

void PStringDropdown::dropdownTextChanged(std::string text) { setParamsString(text); }
2 changes: 2 additions & 0 deletions apps/vaporgui/PStringDropdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class PStringDropdown : public PLineItem {
Q_OBJECT

VComboBox *_vComboBox;
std::string _customBlankText;

public:
PStringDropdown(const std::string &tag, const std::vector<std::string> &items, const std::string &label = "");
Expand All @@ -22,6 +23,7 @@ class PStringDropdown : public PLineItem {

protected:
virtual void updateGUI() const override;
void setCustomBlankText(std::string text);

protected slots:
virtual void dropdownTextChanged(std::string text);
Expand Down
3 changes: 2 additions & 1 deletion apps/vaporgui/PVariableSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ typedef VAPoR::DataMgr::VarType VarType;

#define NULL_TEXT "<none>"

PVariableSelector::PVariableSelector(const std::string &tag, const std::string &label) : PStringDropdown(tag, {}, label) {}
PVariableSelector::PVariableSelector(const std::string &tag, const std::string &label)
: PStringDropdown(tag, {}, label) { setCustomBlankText(NULL_TEXT); }

void PVariableSelector::updateGUI() const
{
Expand Down