Disable interface for operations that takes a long time

This commit is contained in:
Grégory Soutadé 2012-05-12 18:06:15 +02:00
parent 434f1707c7
commit 102daf9a96
4 changed files with 25 additions and 5 deletions

View File

@ -104,8 +104,15 @@ void ExportPanel::OnButtonSearch()
return;
}
_kiss->setOverrideCursor(QCursor(Qt::WaitCursor));
_wxUI->setEnabled(false);
_wxUI->repaint();
_grid->LoadOperations(_operations, 0, 0);
_wxUI->setEnabled(true);
_kiss->setOverrideCursor(QCursor(Qt::ArrowCursor));
layout();
}

View File

@ -378,6 +378,10 @@ void ImportPanel::OnIntegrate()
_buttonIntegrate->setEnabled(false);
_kiss->setOverrideCursor(QCursor(Qt::WaitCursor));
_wxUI->setEnabled(false);
_wxUI->repaint();
for(i=0; i<(int)_operations->size(); i++)
{
oldid = (*_operations)[i].id;
@ -423,6 +427,9 @@ void ImportPanel::OnIntegrate()
_operations->clear();
_operationsGrid->ClearGrid();
_wxUI->setEnabled(true);
_kiss->setOverrideCursor(QCursor(Qt::ArrowCursor));
QMessageBox::information(0, "KissCount", _("Operations successfully imported"));
_wxUI->NeedReload();

View File

@ -90,7 +90,7 @@ QString SearchPanel::GetToolTip()
void SearchPanel::OnEnter(void* caller)
{
SearchPanel* _this = (SearchPanel*) caller;
_this->OnButtonSearch();
}
@ -110,8 +110,15 @@ void SearchPanel::OnButtonSearch()
return;
}
_kiss->setOverrideCursor(QCursor(Qt::WaitCursor));
_wxUI->setEnabled(false);
_wxUI->repaint();
_grid->LoadOperations(_operations, 0, 0);
_wxUI->setEnabled(true);
_kiss->setOverrideCursor(QCursor(Qt::ArrowCursor));
_wxUI->layout();
}

View File

@ -1536,9 +1536,9 @@ void GridAccount::MassUpdate(std::vector<int>& rows, bool do_childs, updateOpera
std::vector<Operation>::iterator it;
Operation op, op2;
_kiss->setOverrideCursor(QCursor(Qt::WaitCursor));
_parent->setEnabled(false);
_parent->setCursor(Qt::BusyCursor);
_parent->repaint();
if (rows.size())
{
@ -1586,6 +1586,5 @@ void GridAccount::MassUpdate(std::vector<int>& rows, bool do_childs, updateOpera
layout();
_parent->setEnabled(true);
_parent->setCursor(Qt::ArrowCursor);
_kiss->setOverrideCursor(QCursor(Qt::ArrowCursor));
}