-rwxr-xr-x | noncore/apps/qashmoney/accountdisplay.cpp | 12 | ||||
-rwxr-xr-x | noncore/apps/qashmoney/qmaccounts.db | bin | 4096 -> 4096 bytes | |||
-rwxr-xr-x | noncore/apps/qashmoney/qmmemory.db | bin | 4096 -> 4096 bytes | |||
-rwxr-xr-x | noncore/apps/qashmoney/qmtransactions.db | bin | 4096 -> 4096 bytes | |||
-rwxr-xr-x | noncore/apps/qashmoney/qmtransfers.db | bin | 3072 -> 3072 bytes | |||
-rwxr-xr-x | noncore/apps/qashmoney/transactiondisplay.cpp | 2 |
6 files changed, 13 insertions, 1 deletions
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index 46ab1db..b2c0838 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp @@ -392,41 +392,53 @@ void AccountDisplay::editAccount () if ( preferences->getPreference ( 4 ) == 1 ) { // get currency code for this account then iterate through the currency box // to find the one we want int count = currencybox->currencybox->count(); QString code = account->getCurrencyCode ( accountid ); for ( int counter = 0; count - 1; counter++ ) { if ( QString::compare ( currencybox->currencybox->text ( counter ), code ) == 0 ) { currencybox->currencybox->setCurrentItem ( counter ); break; } } } else currencybox->setEnabled ( FALSE ); //execute the dialog box int response = editaccountwindow->exec(); if ( response == 1 ) { account->updateAccount ( accountname->text(), accountdescription->text(), currencybox->currencybox->currentText(), accountid ); account->displayAccounts ( listview ); + + // Try and select the same account that was just edited + QListViewItemIterator it ( listview ); + for ( ; it.current(); ++it ) + { + if ( it.current()->text ( 0 ) == accountname->text() ) + { + listview->setSelected ( it.current(), TRUE ); + return; + } + } + maintabs->setTabEnabled ( tab2, FALSE ); } } } void AccountDisplay::setAccountExpanded ( QListViewItem *item ) { int accountid = item->text ( getIDColumn() ).toInt(); account->setAccountExpanded ( 1, accountid ); } void AccountDisplay::setAccountCollapsed ( QListViewItem *item ) { int accountid = item->text ( getIDColumn() ).toInt(); account->setAccountExpanded ( 0, accountid ); } diff --git a/noncore/apps/qashmoney/qmaccounts.db b/noncore/apps/qashmoney/qmaccounts.db Binary files differindex 1c6f024..449bcab 100755 --- a/noncore/apps/qashmoney/qmaccounts.db +++ b/noncore/apps/qashmoney/qmaccounts.db diff --git a/noncore/apps/qashmoney/qmmemory.db b/noncore/apps/qashmoney/qmmemory.db Binary files differindex be33cd4..5c23122 100755 --- a/noncore/apps/qashmoney/qmmemory.db +++ b/noncore/apps/qashmoney/qmmemory.db diff --git a/noncore/apps/qashmoney/qmtransactions.db b/noncore/apps/qashmoney/qmtransactions.db Binary files differindex 1b05561..9e4acc9 100755 --- a/noncore/apps/qashmoney/qmtransactions.db +++ b/noncore/apps/qashmoney/qmtransactions.db diff --git a/noncore/apps/qashmoney/qmtransfers.db b/noncore/apps/qashmoney/qmtransfers.db Binary files differindex 4c04b5f..c31df1a 100755 --- a/noncore/apps/qashmoney/qmtransfers.db +++ b/noncore/apps/qashmoney/qmtransfers.db diff --git a/noncore/apps/qashmoney/transactiondisplay.cpp b/noncore/apps/qashmoney/transactiondisplay.cpp index 6e5c4f6..14f5641 100755 --- a/noncore/apps/qashmoney/transactiondisplay.cpp +++ b/noncore/apps/qashmoney/transactiondisplay.cpp @@ -240,49 +240,49 @@ void TransactionDisplay::editTransfer () layout->addWidget ( datebox, Qt::AlignLeft ); layout->addWidget ( amounttlabel, Qt::AlignLeft ); layout->addWidget ( amountbox, Qt::AlignLeft ); layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); if ( editransfer->exec() == QDialog::Accepted ) { //get fromaccount fromaccount = ( accountids.operator[] ( fromaccountbox->currentItem() ) ).toInt(); //get to account toaccount = ( accountids.operator[] ( toaccountbox->currentItem() ) ).toInt(); //set cleared flag int cleared = 0; if ( clearedcheckbox->isChecked() == TRUE ) cleared = 1; //update transfer transfer->updateTransfer ( fromaccount, account->getParentAccountID ( fromaccount ), toaccount, account->getParentAccountID ( toaccount ), day, month, year, amount->text().toFloat(), cleared, transferid ); account->updateAccountBalance ( fromaccount ); if ( account->getParentAccountID ( fromaccount ) != -1 ) - account->changeParentAccountBalance ( fromaccount ); + account->changeParentAccountBalance ( account->getParentAccountID ( fromaccount ) ); updateAndDisplay ( toaccount ); } } void TransactionDisplay::editTransaction () { int cleared; // set the transaction id and budgetid int transactionid = listview->currentItem()->text ( getIDColumn() ).toInt(); int budgetid = transaction->getBudgetID ( transactionid ); int lineitemid = transaction->getLineItemID ( transactionid ); // create edit transaction window NewTransaction *newtransaction = new NewTransaction ( this ); int width = this->width(); newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) ); newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) ); newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) ); newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) ); |