Merge lp:~tlnd/financisto/dev into lp:~financisto-dev/financisto/trunk

Proposed by tlnd
Status: Merged
Merged at revision: 448
Proposed branch: lp:~tlnd/financisto/dev
Merge into: lp:~financisto-dev/financisto/trunk
Diff against target: 105 lines (+29/-13)
4 files modified
res/values/strings.xml (+3/-0)
res/xml/preferences.xml (+4/-0)
src/ru/orangesoftware/financisto/activity/AbstractTransactionActivity.java (+16/-12)
src/ru/orangesoftware/financisto/utils/MyPreferences.java (+6/-1)
To merge this branch: bzr merge lp:~tlnd/financisto/dev
Reviewer Review Type Date Requested Status
Financisto Developers Pending
Review via email: mp+128690@code.launchpad.net

Description of the change

Add a preference option to show/hide the 'Credit Card Payment' checkbox in the 'New Transaction' screen.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'res/values/strings.xml'
2--- res/values/strings.xml 2012-09-28 20:06:53 +0000
3+++ res/values/strings.xml 2012-10-09 11:41:21 +0000
4@@ -803,5 +803,8 @@
5 <string name="reconcile">Reconcile</string>
6
7 <string name="file_import_utf8_warning">Please make sure that the file is in UTF-8</string>
8+
9+ <string name="show_is_ccard_payment">Show \'Credit Card Payment\'</string>
10+ <string name="show_is_ccard_payment_summary">Show checkbox to mark credit card payments</string>
11
12 </resources>
13
14=== modified file 'res/xml/preferences.xml'
15--- res/xml/preferences.xml 2012-09-17 17:22:44 +0000
16+++ res/xml/preferences.xml 2012-10-09 11:41:21 +0000
17@@ -132,6 +132,10 @@
18 android:title="@string/show_picture"
19 android:summary="@string/show_picture_summary"
20 android:defaultValue="true"/>
21+ <CheckBoxPreference android:key="ntsl_show_is_ccard_payment"
22+ android:title="@string/show_is_ccard_payment"
23+ android:summary="@string/show_is_ccard_payment_summary"
24+ android:defaultValue="true"/>
25 <CheckBoxPreference android:key="ntsl_show_category_in_transfer"
26 android:title="@string/show_category_in_transfer"
27 android:summary="@string/show_category_in_transfer_summary"
28
29=== modified file 'src/ru/orangesoftware/financisto/activity/AbstractTransactionActivity.java'
30--- src/ru/orangesoftware/financisto/activity/AbstractTransactionActivity.java 2012-09-14 11:08:46 +0000
31+++ src/ru/orangesoftware/financisto/activity/AbstractTransactionActivity.java 2012-10-09 11:41:21 +0000
32@@ -109,7 +109,8 @@
33 protected boolean isRememberLastProject;
34 protected boolean isShowLocation;
35 protected boolean isShowNote;
36- protected boolean isShowTakePicture;
37+ protected boolean isShowTakePicture;
38+ protected boolean isShowIsCCardPayment;
39
40 protected AttributeView deleteAfterExpired;
41
42@@ -141,7 +142,8 @@
43 isRememberLastProject = isRememberLastCategory && MyPreferences.isRememberProject(this);
44 isShowLocation = MyPreferences.isShowLocation(this);
45 isShowNote = MyPreferences.isShowNote(this);
46- isShowTakePicture = MyPreferences.isShowTakePicture(this);
47+ isShowTakePicture = MyPreferences.isShowTakePicture(this);
48+ isShowIsCCardPayment = MyPreferences.isShowIsCCardPayment(this);
49
50 categorySelector = new CategorySelector(this, db, x);
51 categorySelector.setListener(this);
52@@ -493,12 +495,12 @@
53 if (isShowTakePicture && transaction.isNotTemplateLike()) {
54 pictureView = x.addPictureNodeMinus(this, layout, R.id.attach_picture, R.id.delete_picture, R.string.attach_picture, R.string.new_picture);
55 }
56- // checkbox to register if the transaction is a credit card payment.
57- // this will be used to exclude from totals in bill preview
58- ccardPayment = x.addCheckboxNode(layout,
59- R.id.is_ccard_payment, R.string.is_ccard_payment,
60- R.string.is_ccard_payment_summary, false);
61-
62+ if (isShowIsCCardPayment) {
63+ // checkbox to register if the transaction is a credit card payment.
64+ // this will be used to exclude from totals in bill preview
65+ ccardPayment = x.addCheckboxNode(layout, R.id.is_ccard_payment,
66+ R.string.is_ccard_payment, R.string.is_ccard_payment_summary, false);
67+ }
68 }
69
70 protected abstract void createListNodes(LinearLayout layout);
71@@ -761,10 +763,12 @@
72 setRecurrence(transaction.recurrence);
73 setNotification(transaction.notificationOptions);
74 }
75- if (isShowTakePicture) {
76- selectPicture(transaction.attachedPicture);
77- }
78- setIsCCardPayment(transaction.isCCardPayment);
79+ if (isShowTakePicture) {
80+ selectPicture(transaction.attachedPicture);
81+ }
82+ if (isShowIsCCardPayment) {
83+ setIsCCardPayment(transaction.isCCardPayment);
84+ }
85 }
86
87 private void setIsCCardPayment(int isCCardPaymentValue) {
88
89=== modified file 'src/ru/orangesoftware/financisto/utils/MyPreferences.java'
90--- src/ru/orangesoftware/financisto/utils/MyPreferences.java 2012-09-17 17:22:44 +0000
91+++ src/ru/orangesoftware/financisto/utils/MyPreferences.java 2012-10-09 11:41:21 +0000
92@@ -199,7 +199,12 @@
93 SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
94 return Integer.parseInt(sharedPreferences.getString("ntsl_show_location_order", "1"));
95 }
96-
97+
98+ public static boolean isShowIsCCardPayment(Context context) {
99+ SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
100+ return sharedPreferences.getBoolean("ntsl_show_is_ccard_payment", true);
101+ }
102+
103 /**
104 * Get google docs user login registered on preferences
105 * */