From d5983b587e3e9739622b8e1658114a81ccfc3e69 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 29 Jun 2013 18:27:11 -0400 Subject: [PATCH] InputConfigDialog: Don't show "..." for complicated expressions Just show the actual expression. We need to do a bit of mangling here as wx has no way to turn off mnemonics parsing, so do that as well. --- Source/Core/DolphinWX/Src/InputConfigDiag.cpp | 7 +++---- .../ControllerInterface/ControllerInterface.h | 7 ------- .../ControllerInterface/ExpressionParser.cpp | 17 ----------------- .../Src/ControllerInterface/ExpressionParser.h | 1 - 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp index 7be5f0c55e..033eca8da0 100644 --- a/Source/Core/DolphinWX/Src/InputConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/InputConfigDiag.cpp @@ -240,10 +240,9 @@ void GamepadPage::UpdateGUI() , e = (*g)->control_buttons.end(); for (; i!=e; ++i) { ControllerInterface::ControlReference *r = (*i)->control_reference; - if (r->IsComplicated()) - (*i)->SetLabel("..."); - else - (*i)->SetLabel(StrToWxStr((*i)->control_reference->expression)); + wxString expr = StrToWxStr((*i)->control_reference->expression); + expr.Replace("&", "&&"); + (*i)->SetLabel(expr); } // cboxes diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h index e130c951aa..57903a08a7 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h +++ b/Source/Core/InputCommon/Src/ControllerInterface/ControllerInterface.h @@ -73,13 +73,6 @@ public: return 0; } - bool IsComplicated() { - if (parsed_expression) - return parsed_expression->is_complicated; - else - return false; - } - protected: ControlReference(const bool _is_input) : range(1), is_input(_is_input), parsed_expression(NULL) {} ciface::ExpressionParser::Expression *parsed_expression; diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp index c68df48e25..5b6495b781 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.cpp @@ -210,7 +210,6 @@ public: virtual ControlState GetValue() { return 0; } virtual void SetValue(ControlState state) {} virtual int CountNumControls() { return 0; } - virtual bool IsComplicated() { return false; } virtual operator std::string() { return ""; } }; @@ -237,11 +236,6 @@ public: return 1; } - virtual bool IsComplicated() - { - return false; - } - virtual operator std::string() { return "`" + (std::string)qualifier + "`"; @@ -293,11 +287,6 @@ public: return lhs->CountNumControls() + rhs->CountNumControls(); } - virtual bool IsComplicated() - { - return true; - } - virtual operator std::string() { return OpName(op) + "(" + (std::string)(*lhs) + ", " + (std::string)(*rhs) + ")"; @@ -345,11 +334,6 @@ public: return inner->CountNumControls(); } - virtual bool IsComplicated() - { - return true; - } - virtual operator std::string() { return OpName(op) + "(" + (std::string)(*inner) + ")"; @@ -539,7 +523,6 @@ Expression::Expression(ExpressionNode *node_) { node = node_; num_controls = node->CountNumControls(); - is_complicated = node->IsComplicated(); } Expression::~Expression() diff --git a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.h b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.h index d85c17a474..70cc51373b 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.h +++ b/Source/Core/InputCommon/Src/ControllerInterface/ExpressionParser.h @@ -51,7 +51,6 @@ public: ControlState GetValue(); void SetValue (ControlState state); int num_controls; - bool is_complicated; ExpressionNode *node; };