Merge pull request #4067 from leoetlino/no-device

InputConfigDiag: Don't prevent closing dialog if device not found
This commit is contained in:
Pierre Bourdon 2016-07-31 17:25:40 +02:00 committed by GitHub
commit 18a669abcc
2 changed files with 9 additions and 9 deletions

View File

@ -320,7 +320,8 @@ bool ControlDialog::Validate()
UpdateGUI(); UpdateGUI();
return control_reference->parse_error == EXPRESSION_PARSE_SUCCESS; return (control_reference->parse_error == EXPRESSION_PARSE_SUCCESS ||
control_reference->parse_error == EXPRESSION_PARSE_NO_DEVICE);
} }
void GamepadPage::SetDevice(wxCommandEvent&) void GamepadPage::SetDevice(wxCommandEvent&)

View File

@ -401,7 +401,7 @@ private:
if (control == nullptr) if (control == nullptr)
{ {
*expr_out = new DummyExpression(tok.qualifier); *expr_out = new DummyExpression(tok.qualifier);
return EXPRESSION_PARSE_SUCCESS; return EXPRESSION_PARSE_NO_DEVICE;
} }
*expr_out = new ControlExpression(tok.qualifier, device, control); *expr_out = new ControlExpression(tok.qualifier, device, control);
@ -427,13 +427,12 @@ private:
ExpressionParseStatus Unary(ExpressionNode** expr_out) ExpressionParseStatus Unary(ExpressionNode** expr_out)
{ {
ExpressionParseStatus status;
if (IsUnaryExpression(Peek().type)) if (IsUnaryExpression(Peek().type))
{ {
Token tok = Chew(); Token tok = Chew();
ExpressionNode* atom_expr; ExpressionNode* atom_expr;
if ((status = Atom(&atom_expr)) != EXPRESSION_PARSE_SUCCESS) ExpressionParseStatus status = Atom(&atom_expr);
if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
return status; return status;
*expr_out = new UnaryExpression(tok.type, atom_expr); *expr_out = new UnaryExpression(tok.type, atom_expr);
return EXPRESSION_PARSE_SUCCESS; return EXPRESSION_PARSE_SUCCESS;
@ -457,16 +456,16 @@ private:
ExpressionParseStatus Binary(ExpressionNode** expr_out) ExpressionParseStatus Binary(ExpressionNode** expr_out)
{ {
ExpressionParseStatus status; ExpressionParseStatus status = Unary(expr_out);
if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
if ((status = Unary(expr_out)) != EXPRESSION_PARSE_SUCCESS)
return status; return status;
while (IsBinaryToken(Peek().type)) while (IsBinaryToken(Peek().type))
{ {
Token tok = Chew(); Token tok = Chew();
ExpressionNode* unary_expr; ExpressionNode* unary_expr;
if ((status = Unary(&unary_expr)) != EXPRESSION_PARSE_SUCCESS) status = Unary(&unary_expr);
if (status == EXPRESSION_PARSE_SYNTAX_ERROR)
{ {
delete *expr_out; delete *expr_out;
return status; return status;