Skip to content

Commit

Permalink
#5231: Fix logic typo preventing UndoableCommands from functioning. F…
Browse files Browse the repository at this point in the history
…ix captions in Patch Cap dialog.
  • Loading branch information
codereader committed Jun 20, 2020
1 parent e2891bf commit 06df831
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/iundo.h
Expand Up @@ -127,7 +127,7 @@ class UndoableCommand
_shouldFinish(false)
{
// Avoid double-starting undo operations
if (GlobalUndoSystem().operationStarted())
if (!GlobalUndoSystem().operationStarted())
{
GlobalUndoSystem().start();
_shouldFinish = true;
Expand Down
19 changes: 11 additions & 8 deletions radiant/ui/patch/CapDialog.cpp
Expand Up @@ -20,14 +20,17 @@ namespace
{
const char* WINDOW_TITLE = N_("Create Cap Patch");

const char* const CAPTYPE_NAMES[5] =
inline std::string getCapTypeName(patch::CapType capType)
{
N_("Bevel"),
N_("End Cap"),
N_("Inverted Bevel"),
N_("Inverted Endcap"),
N_("Cylinder"),
};
switch (capType)
{
case patch::CapType::Bevel: return _("Bevel");
case patch::CapType::EndCap: return _("End Cap");
case patch::CapType::InvertedBevel: return _("Inverted Bevel");
case patch::CapType::InvertedEndCap: return _("Inverted Endcap");
case patch::CapType::Cylinder: return _("Cylinder");
};
}
}

PatchCapDialog::PatchCapDialog() :
Expand All @@ -53,7 +56,7 @@ void PatchCapDialog::addItemToTable(wxFlexGridSizer* sizer, const std::string& i
wxStaticBitmap* img = new wxStaticBitmap(_dialog, wxID_ANY,
wxArtProvider::GetBitmap(GlobalUIManager().ArtIdPrefix() + image));

wxRadioButton* radioButton = new wxRadioButton(_dialog, wxID_ANY, _(CAPTYPE_NAMES[static_cast<std::size_t>(type)]),
wxRadioButton* radioButton = new wxRadioButton(_dialog, wxID_ANY, getCapTypeName(type),
wxDefaultPosition, wxDefaultSize, type == patch::CapType::Bevel ? wxRB_GROUP : 0);

sizer->Add(img, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL);
Expand Down

0 comments on commit 06df831

Please sign in to comment.