Fix hotkey detection

develop
Anuradha Dissanayake 2013-01-03 22:01:01 +13:00
parent 581a8dd955
commit 7b561f108b
1 changed files with 71 additions and 71 deletions

@ -1679,7 +1679,34 @@ namespace wf_ui
bool AdjustmentScreen::feed(set<df::interface_key> *input, ItemConstraint *cv, ProtectedJob *pj /* = NULL */) bool AdjustmentScreen::feed(set<df::interface_key> *input, ItemConstraint *cv, ProtectedJob *pj /* = NULL */)
{ {
if ((edit_limit || edit_gap)) if (input->count(interface_key::CUSTOM_T) && !edit_limit && !edit_gap)
{
if (!cv)
{
// Add tracking
return false;
}
// Remove tracking
if (pj)
{
for (vector<ItemConstraint*>::iterator it = pj->constraints.begin(); it < pj->constraints.end(); it++)
delete_constraint(*it);
forget_job(color_ostream_proxy(Core::getInstance().getConsole()), pj);
}
else
{
delete_constraint(cv);
}
onConstraintChanged();
return true;
}
if (cv)
{
if (edit_limit || edit_gap)
{ {
df::interface_key last_token = *input->rbegin(); df::interface_key last_token = *input->rbegin();
if (last_token == interface_key::STRING_A000) if (last_token == interface_key::STRING_A000)
@ -1742,37 +1769,11 @@ namespace wf_ui
cv->setGoalByCount(!cv->goalByCount()); cv->setGoalByCount(!cv->goalByCount());
onModeChanged(); onModeChanged();
} }
else if (input->count(interface_key::CUSTOM_T))
{
if (cv)
{
// Remove tracking
if (pj)
{
for (vector<ItemConstraint*>::iterator it = pj->constraints.begin(); it < pj->constraints.end(); it++)
delete_constraint(*it);
forget_job(color_ostream_proxy(Core::getInstance().getConsole()), pj);
}
else
delete_constraint(cv);
}
else
{
// Add tracking
return false;
} }
onConstraintChanged();
}
else
{
return false; return false;
} }
return true;
}
void AdjustmentScreen::render(ItemConstraint *cv, bool in_monitor) void AdjustmentScreen::render(ItemConstraint *cv, bool in_monitor)
{ {
left_margin = (in_monitor) ? gps->dimx - 30 : get_left_margin(); left_margin = (in_monitor) ? gps->dimx - 30 : get_left_margin();
@ -2934,7 +2935,6 @@ namespace wf_ui
last_job = job; last_job = job;
} }
return job != NULL; return job != NULL;
} }