Skip to content

Commit b81f44f

Browse files
committed
Fixed: crash when deleting accounts
Fixed: autocompleting transaction names does not copy the time or export flag Fixed: random crash when opening app (or loading accounts) Updated version numbers for v1.2.5 release
1 parent e8ebbf2 commit b81f44f

7 files changed

Lines changed: 47 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
11
Change Log
22
===============================================================================
3+
Version 1.2.5 *(2013-09-17)*
4+
----------------------------
5+
* Feature: Search accounts by name
6+
* Fixed: crash when deleting accounts
7+
* Fixed: auto-completing transaction names does not copy the time or export flag
8+
* Fixed: random crash when opening app (or loading accounts)
9+
10+
Version 1.2.4 *(2013-09-05)*
11+
----------------------------
12+
* Added support for detecting placeholder accounts during import
13+
* Use full qualified account names in account selection spinners
14+
* Loads complete transaction as a template when the autocomplete suggestion is selected
15+
* Fixed: selecting items from lists caused multiple to be selected in the wrong positions
16+
* Fixed: widgets not updated when all accounts or all transactions are deleted
17+
* Other minor bug fixes.
18+
319
Version 1.2.3 *(2013-08-28)*
420
----------------------------
521
* Fixed: crashes when editing/creating transactions
622
* Feature: Added Chinese language translation
723
* Feature: Autocomplete transaction descriptions
824
* Improved reliability of importing stock accounts
925
* Improved speed of loading account balance
10-
* Improved incrased touch target area of "new transaction" button in accounts list view
26+
* Improved increased touch target area of "new transaction" button in accounts list view
1127

1228
Version 1.2.2 *(2013-06-23)*
1329
----------------------------

app/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
1919
package="org.gnucash.android"
20-
android:versionCode="14"
21-
android:versionName="1.2.4" >
20+
android:versionCode="16"
21+
android:versionName="1.2.5" >
2222

2323
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/>
2424

app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<description>Gnucash Android companion application</description>
2323

2424
<parent>
25-
<version>1.2.4-SNAPSHOT</version>
25+
<version>1.2.6-SNAPSHOT</version>
2626
<groupId>org.gnucash.android</groupId>
2727
<artifactId>gnucash-android-parent</artifactId>
2828
</parent>

app/src/org/gnucash/android/ui/accounts/AccountsListFragment.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import android.view.ViewGroup;
4141
import android.widget.*;
4242
import android.widget.AdapterView.OnItemLongClickListener;
43-
import android.widget.SearchView;
4443
import com.actionbarsherlock.app.ActionBar;
4544
import com.actionbarsherlock.app.SherlockDialogFragment;
4645
import com.actionbarsherlock.app.SherlockListFragment;
@@ -49,7 +48,6 @@
4948
import com.actionbarsherlock.view.Menu;
5049
import com.actionbarsherlock.view.MenuInflater;
5150
import com.actionbarsherlock.view.MenuItem;
52-
import com.actionbarsherlock.widget.*;
5351
import org.gnucash.android.R;
5452
import org.gnucash.android.data.Account;
5553
import org.gnucash.android.data.Money;
@@ -61,7 +59,6 @@
6159
import org.gnucash.android.util.OnAccountClickedListener;
6260

6361
import java.lang.ref.WeakReference;
64-
import java.util.Locale;
6562

6663
/**
6764
* Fragment for displaying the list of accounts in the database
@@ -312,6 +309,7 @@ protected void deleteAccount(long rowId) {
312309
mAccountsDbAdapter.reassignParent(accountUID, null);
313310
Toast.makeText(getActivity(), R.string.toast_account_deleted, Toast.LENGTH_SHORT).show();
314311
WidgetConfigurationActivity.updateAllWidgets(getActivity().getApplicationContext());
312+
getLoaderManager().destroyLoader(0);
315313
}
316314
refreshList();
317315
}
@@ -731,7 +729,15 @@ protected Money doInBackground(Long... params) {
731729
cancel(true);
732730
return Money.getZeroInstance();
733731
}
734-
Money balance = accountsDbAdapter.getAccountBalance(params[0]);
732+
Money balance = Money.getZeroInstance();
733+
734+
try {
735+
balance = accountsDbAdapter.getAccountBalance(params[0]);
736+
} catch (IllegalArgumentException ex){
737+
//sometimes a load computation has been started and the data set changes.
738+
//the account ID may no longer exist. So we catch that exception here and do nothing
739+
Log.e(TAG, "Error computing account balance: " + ex);
740+
}
735741
return balance;
736742
}
737743

app/src/org/gnucash/android/ui/transactions/NewTransactionFragment.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,16 @@ public class NewTransactionFragment extends SherlockFragment implements
163163
*/
164164
private Spinner mDoubleAccountSpinner;
165165

166+
/**
167+
* Flag to note if double entry accounting is in use or not
168+
*/
166169
private boolean mUseDoubleEntry;
167170

171+
/**
172+
* Flag to note if the user has manually edited the amount of the transaction
173+
*/
174+
boolean mAmountManuallyEdited = false;
175+
168176
/**
169177
* Create the view and retrieve references to the UI elements
170178
*/
@@ -252,6 +260,8 @@ public Cursor runQuery(CharSequence name) {
252260
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
253261
mTransaction = mTransactionsDbAdapter.getTransaction(id);
254262
mTransaction.setUID(UUID.randomUUID().toString());
263+
mTransaction.setExported(false);
264+
mTransaction.setTime(System.currentTimeMillis());
255265
long accountId = ((TransactionsActivity)getSherlockActivity()).getCurrentAccountID();
256266
mTransaction.setAccountUID(mTransactionsDbAdapter.getAccountUID(accountId));
257267
initializeViewsWithTransaction();
@@ -269,7 +279,10 @@ private void initializeViewsWithTransaction(){
269279

270280
mNameEditText.setText(mTransaction.getName());
271281
mTransactionTypeButton.setChecked(mTransaction.getTransactionType() == TransactionType.DEBIT);
272-
mAmountEditText.setText(mTransaction.getAmount().toPlainString());
282+
if (!mAmountManuallyEdited){
283+
//when autocompleting, only change the amount if the user has not manually changed it already
284+
mAmountEditText.setText(mTransaction.getAmount().toPlainString());
285+
}
273286
mCurrencyTextView.setText(mTransaction.getAmount().getCurrency().getSymbol(Locale.getDefault()));
274287
mDescriptionEditText.setText(mTransaction.getDescription());
275288
mDateTextView.setText(DATE_FORMATTER.format(mTransaction.getTimeMillis()));
@@ -643,7 +656,7 @@ public void beforeTextChanged(CharSequence s, int start, int count,
643656
public void onTextChanged(CharSequence s, int start, int before,
644657
int count) {
645658
// nothing to see here, move along
646-
659+
mAmountManuallyEdited = true;
647660
}
648661

649662
}

integration-tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1818
<modelVersion>4.0.0</modelVersion>
1919
<parent>
20-
<version>1.2.4-SNAPSHOT</version>
20+
<version>1.2.6-SNAPSHOT</version>
2121
<groupId>org.gnucash.android</groupId>
2222
<artifactId>gnucash-android-parent</artifactId>
2323
</parent>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1919
<modelVersion>4.0.0</modelVersion>
20-
<version>1.2.4-SNAPSHOT</version>
20+
<version>1.2.6-SNAPSHOT</version>
2121
<groupId>org.gnucash.android</groupId>
2222
<artifactId>gnucash-android-parent</artifactId>
2323
<name>GnuCash Android parent</name>

0 commit comments

Comments
 (0)