Do not reload current panel when a modification is done (but reload other ones) Add a method to KissPanel for reload other panels avoiding directly using _wxUI member
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
|
||||
#define SET_READ_ONLY(item) item->setFlags(item->flags() & ~Qt::ItemIsEditable);
|
||||
|
||||
GridAccount::GridAccount(KissCount* kiss, QWidget *parent,
|
||||
GridAccount::GridAccount(KissCount* kiss, KissPanel *parent,
|
||||
bool canAddOperation, bool setWeek, bool synchronizeWithDatabase)
|
||||
: QTableWidget(parent), _fixCosts(0), _week1(0),
|
||||
_week2(0), _week3(0), _week4(0), _week5(0), _canAddOperation(canAddOperation),
|
||||
@@ -165,7 +165,10 @@ void GridAccount::UpdateOperation(Operation& op)
|
||||
if (it != _operations->end())
|
||||
{
|
||||
if (_databaseSynchronization)
|
||||
{
|
||||
_kiss->UpdateOperation(op);
|
||||
_parent->NeedReload();
|
||||
}
|
||||
*it = op;
|
||||
}
|
||||
}
|
||||
@@ -572,7 +575,10 @@ void GridAccount::DeleteOperation(const Operation& op) throw (OperationNotFound)
|
||||
if (it != _operations->end())
|
||||
{
|
||||
if (_databaseSynchronization)
|
||||
{
|
||||
_kiss->DeleteOperation(*it);
|
||||
_parent->NeedReload();
|
||||
}
|
||||
if (it->parent)
|
||||
{
|
||||
parent = GetOperation(it->parent);
|
||||
@@ -1151,6 +1157,7 @@ void GridAccount::OnOperationModified(int row, int col)
|
||||
new_op.parent = 0;
|
||||
|
||||
new_op_id = _kiss->AddOperation(new_op);
|
||||
_parent->NeedReload();
|
||||
|
||||
if (!new_op_id)
|
||||
{
|
||||
@@ -1353,6 +1360,7 @@ void GridAccount::Group()
|
||||
op.childs.clear();
|
||||
|
||||
op.id = _kiss->AddOperation(op);
|
||||
_parent->NeedReload();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1596,7 +1604,10 @@ void GridAccount::MassUpdate(std::vector<int>& rows, bool do_childs, updateOpera
|
||||
{
|
||||
func (&(*it), params);
|
||||
if (_databaseSynchronization)
|
||||
{
|
||||
_kiss->UpdateOperation(*it);
|
||||
_parent->NeedReload();
|
||||
}
|
||||
|
||||
if (it->meta && do_childs)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
enum {TREE, DESCRIPTION, OP_DATE, DEBIT, CREDIT, CATEGORY, TAG, ACCOUNT, OP_DELETE, CHECKED, NUMBER_COLS_OPS};
|
||||
|
||||
GridAccount(KissCount* kiss, QWidget *parent,
|
||||
GridAccount(KissCount* kiss, KissPanel *parent,
|
||||
bool canAddOperation, bool setWeek, bool synchronizeWithDatabase);
|
||||
~GridAccount();
|
||||
|
||||
@@ -72,7 +72,7 @@ private slots:
|
||||
void OnDeleteClicked(int id);
|
||||
|
||||
private:
|
||||
QWidget* _parent;
|
||||
KissPanel* _parent;
|
||||
KissCount* _kiss;
|
||||
bool _displayLines;
|
||||
bool _setWeek;
|
||||
|
||||
Reference in New Issue
Block a user