Skip to content

Commit

Permalink
Merge branch 'hotfix/patches'
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Sep 19, 2016
2 parents d7d15fc + ad229ab commit 66b3d0c
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 51 deletions.
7 changes: 7 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ GnuCash Android is built by people like you! Please [join us](https://github.com
* You can maintain your stable installation of GnuCash and test with another installation.
The two instances of GnuCash Android will live side-by-side on your device and not affect each other. You can install the development version by executing `gradle installDD` inside the root project directory
* The latest changes are in the `develop` branch.
* Always rebase develop before working on a fix or issuing a pull request
* The master branch contains only stable releases.
* Pull requests to the `master` branch will be rejected.
* The `hotfix/patches` branch is reserved for very small fixes to the current release
* This branch may diverge significantly from the `develop` branch
* When working on a hotfix, always rebase and start off the `origin/hotfix/patches` branch
* Examples of such are typos, translation updates, critical bugs (e.g. cannot save transactions)
* Any bigger changes should be made to develop

* Make a new branch for every feature you're working on.
* Try to make clean commits that are easily readable (including descriptive commit messages!)
* Test before you push make sure all test pass on your machine.
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#### Steps to reproduce the behaviour
1. <!-- List the detail steps to reproduce the problem here -->

#### Expected behaviour


#### Actual behaviour


#### Steps to reproduce the behaviour
1. <!-- List the detail steps to reproduce the problem here -->

#### Software specifications
* GnuCash Android version:
* System Android version:
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
Change Log
===============================================================================
Version 2.1.2 *(2016-09-21)*
----------------------------
* Fixed: Scheduled exports always run daily (no matter the actual schedule)
* Fixed: New transactions cannot be saved in single-entry mode
* Fixed: ownCloud connect success messages displayed in red (now green)
* Fixed: Crash when scheduled action service cannot find transaction in db
* Improved: German and Brazilian Portuguese translations

Version 2.1.1 *(2016-09-05)*
----------------------------
* Fixed: Bug cause crash during start-up for devices with no scheduled transactions

Version 2.1.0 *(2016-09-01)*
----------------------------
* Feature: Use multiple GnuCash books in single application
Expand All @@ -15,7 +27,9 @@ Version 2.1.0 *(2016-09-01)*
Version 2.0.7 *(2016-05-05)*
----------------------------
* Fixed: Currency exchange rate does not accept very small rates (> 2 decimal places)
* Improved: Updated translations for Japanese, Polish, French, Version 2.0.6 *(2016-02-20)*
* Improved: Updated translations for Japanese, Polish, French,

Version 2.0.6 *(2016-02-20)*
----------------------------
* Fixed: Saving transaction gets slower with increase in size of database
* Fixed: Imbalance amount wrongly computed in split editor (for some accounts)
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'io.fabric'

def versionMajor = 2
def versionMinor = 1
def versionPatch = 1
def versionPatch = 2
def versionBuild = 0

def buildTime() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ protected void onHandleIntent(Intent intent) {
Log.i(LOG_TAG, String.format("Processing %d total scheduled actions for Book: %s",
scheduledActions.size(), book.getDisplayName()));
processScheduledActions(scheduledActions, db);

//close all databases except the currently active database
if (!db.getPath().equals(GnuCashApplication.getActiveDb().getPath()))
db.close();
}

Log.i(LOG_TAG, "Completed service @ " + java.text.DateFormat.getDateTimeInstance().format(new Date()));
Expand Down Expand Up @@ -142,10 +146,11 @@ private static void executeScheduledEvent(ScheduledAction scheduledAction, SQLit
ContentValues contentValues = new ContentValues();
contentValues.put(DatabaseSchema.ScheduledActionEntry.COLUMN_LAST_RUN, System.currentTimeMillis());
contentValues.put(DatabaseSchema.ScheduledActionEntry.COLUMN_EXECUTION_COUNT, executionCount);
new ScheduledActionDbAdapter(db, new RecurrenceDbAdapter(db)).updateRecord(scheduledAction.getUID(), contentValues);
db.update(DatabaseSchema.ScheduledActionEntry.TABLE_NAME, contentValues,
DatabaseSchema.ScheduledActionEntry.COLUMN_UID + "=?", new String[]{scheduledAction.getUID()});

//set the values in the object because they will be checked for the next iteration in the calling loop
scheduledAction.setExecutionCount(executionCount);
//set the execution count in the object because it will be checked for the next iteration in the calling loop
scheduledAction.setExecutionCount(executionCount); //this call is important, do not remove!!
}

/**
Expand All @@ -163,6 +168,9 @@ private static int executeBackup(ScheduledAction scheduledAction, SQLiteDatabase
if (endTime > 0 && endTime < now)
return executionCount;

if (scheduledAction.computeNextScheduledExecutionTime() > now)
return 0;

ExportParams params = ExportParams.parseCsv(scheduledAction.getTag());
try {
//wait for async task to finish before we proceed (we are holding a wake lock)
Expand All @@ -187,7 +195,14 @@ private static int executeTransactions(ScheduledAction scheduledAction, SQLiteDa
int executionCount = 0;
String actionUID = scheduledAction.getActionUID();
TransactionsDbAdapter transactionsDbAdapter = new TransactionsDbAdapter(db, new SplitsDbAdapter(db));
Transaction trxnTemplate = transactionsDbAdapter.getRecord(actionUID);
Transaction trxnTemplate = null;
try {
trxnTemplate = transactionsDbAdapter.getRecord(actionUID);
} catch (IllegalArgumentException ex){ //if the record could not be found, abort
Log.e(LOG_TAG, "Scheduled transaction with UID " + actionUID + " could not be found in the db with path " + db.getPath());
return executionCount;
}


long now = System.currentTimeMillis();
//if there is an end time in the past, we execute all schedules up to the end time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ public void onSaveInstanceState(Bundle outState) {
@Override
public void onDestroy() {
super.onDestroy();
mAccountRecyclerAdapter.swapCursor(null);
if (mAccountRecyclerAdapter != null)
mAccountRecyclerAdapter.swapCursor(null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.DialogFragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.Preference;
import android.util.Log;
Expand Down Expand Up @@ -180,19 +181,23 @@ public void onRemoteOperationFinish(RemoteOperation caller, RemoteOperationResul
Log.e("OC", result.getLogMessage(), result.getException());

if (caller instanceof GetRemoteStatusOperation) {
mServerError.setTextColor(ContextCompat.getColor(getContext(), R.color.debit_red));
mServerError.setText(getString(R.string.owncloud_server_invalid));
mServerError.setVisibility(View.VISIBLE);

} else if (caller instanceof GetRemoteUserNameOperation &&
mServerError.getText().toString().equals(getString(R.string.owncloud_server_ok))) {
mUsernameError.setTextColor(ContextCompat.getColor(getContext(), R.color.debit_red));
mUsernameError.setText(getString(R.string.owncloud_user_invalid));
mUsernameError.setVisibility(View.VISIBLE);
}
} else {
if (caller instanceof GetRemoteStatusOperation) {
mServerError.setTextColor(ContextCompat.getColor(getContext(), R.color.theme_primary));
mServerError.setText(getString(R.string.owncloud_server_ok));
mServerError.setVisibility(View.VISIBLE);
} else if (caller instanceof GetRemoteUserNameOperation) {
mUsernameError.setTextColor(ContextCompat.getColor(getContext(), R.color.theme_primary));
mUsernameError.setText(getString(R.string.owncloud_user_ok));
mUsernameError.setVisibility(View.VISIBLE);
}
Expand All @@ -208,9 +213,11 @@ public void onRemoteOperationFinish(RemoteOperation caller, RemoteOperationResul
gu.execute(mClient, listener, mHandler);

if (FileUtils.isValidPath(mOC_dir, false)) {
mDirError.setTextColor(ContextCompat.getColor(getContext(), R.color.theme_primary));
mDirError.setText(getString(R.string.owncloud_dir_ok));
mDirError.setVisibility(View.VISIBLE);
} else {
mDirError.setTextColor(ContextCompat.getColor(getContext(), R.color.debit_red));
mDirError.setText(getString(R.string.owncloud_dir_invalid));
mDirError.setVisibility(View.VISIBLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,9 @@ public boolean onOptionsItemSelected(MenuItem item) {
* @return {@code true} if the transaction can be saved, {@code false} otherwise
*/
private boolean canSave(){
return (mAmountEditText.isInputValid())
&& (mUseDoubleEntry && mTransferAccountSpinner.getCount() > 0);
return (mUseDoubleEntry && mAmountEditText.isInputValid()
&& mTransferAccountSpinner.getCount() > 0)
|| (!mUseDoubleEntry && mAmountEditText.isInputValid());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private boolean copy(File src, File dst) throws IOException {
*/
private int recursiveMove(File src, File dst){
int copyCount = 0;
if (src.isDirectory()){
if (src.isDirectory() && src.listFiles() != null){
dst.mkdirs(); //we assume it works everytime. Great, right?
for (File file : src.listFiles()) {
File target = new File(dst, file.getName());
Expand Down
30 changes: 15 additions & 15 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,20 +459,20 @@ No user-identifiable information will be collected as part of this process!</str
<item quantity="other">%d Buchungen</item>
</plurals>
<string-array name="report_account_types">
<item>EXPENSE</item>
<item>INCOME</item>
<item>AUFWENDUNGEN</item>
<item>ERTRÄGE</item>
</string-array>
<string name="toast_connected_to_google_drive">Connected to Google Drive</string>
<string name="toast_unable_to_connect_to_google_drive">Unable to connect to Google Drive</string>
<string name="toast_enter_amount_to_split">Please enter an amount to split</string>
<string name="label_export_target_external_service">external service</string>
<string name="toast_updated_transaction_recurring_schedule">Updated transaction recurring schedule</string>
<string name="label_export_transactions_since_date">Since</string>
<string name="switch_export_transactions_from_all_time">All time</string>
<string name="label_recommend_app">Recommend in Play Store</string>
<string name="repeat_until_date">until %1$s</string>
<string name="repeat_on_weekday">on %1$s</string>
<string name="repeat_x_times">for %1$s times</string>
<string name="menu_show_compact_view">Compact View</string>
<string name="book_default_name">Book %1$d</string>
<string name="toast_connected_to_google_drive">Verbunden mit Google Drive</string>
<string name="toast_unable_to_connect_to_google_drive">Keine Verbindung zu Google Drive</string>
<string name="toast_enter_amount_to_split">Bitte geben Sie einen aufzuteilenden Betrag ein</string>
<string name="label_export_target_external_service">externer Dienst</string>
<string name="toast_updated_transaction_recurring_schedule">Aktualisierte Buchung aus wiederkehrendem Zeitplan</string>
<string name="label_export_transactions_since_date">Seit</string>
<string name="switch_export_transactions_from_all_time">Zeitlich unbegrenzt</string>
<string name="label_recommend_app">Im Play Store empfehlen</string>
<string name="repeat_until_date">bis %1$s</string>
<string name="repeat_on_weekday">am %1$s</string>
<string name="repeat_x_times">%1$s mal</string>
<string name="menu_show_compact_view">Kompakte Ansicht</string>
<string name="book_default_name">Buch %1$d</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -472,5 +472,5 @@ Este proceso solo recoge información que no permite identificar al usuario</str
<string name="repeat_on_weekday">en %1$s</string>
<string name="repeat_x_times">%1$s veces</string>
<string name="menu_show_compact_view">Vista compacta</string>
<string name="book_default_name">Book %1$d</string>
<string name="book_default_name">Libro %1$d</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -474,5 +474,5 @@
<string name="repeat_on_weekday">il %1$s</string>
<string name="repeat_x_times">per %1$s volte</string>
<string name="menu_show_compact_view">Visualizzazione compatta</string>
<string name="book_default_name">Book %1$d</string>
<string name="book_default_name">Libro %1$d</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-ja-rJP/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,5 @@
<string name="repeat_on_weekday">%1$s に</string>
<string name="repeat_x_times">%1$s 回</string>
<string name="menu_show_compact_view">コンパクト表示</string>
<string name="book_default_name">Book %1$d</string>
<string name="book_default_name">帳簿 %1$d</string>
</resources>
36 changes: 18 additions & 18 deletions app/src/main/res/values-pt-rPT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Neste processo não serão recolhidas informações do utilizador!</string>
<!-- Passcode lock -->
<string name="digit_one">1</string>
<!-- In the English locale, digit 1 has no text on it. This is simply empty space. If your locale has text on digit 1, then translate-->
<string name="digit_one_text"></string>
<string name="digit_one_text"> </string>
<string name="digit_two">2</string>
<string name="digit_two_text">ABC</string>
<string name="digit_three">3</string>
Expand Down Expand Up @@ -449,27 +449,27 @@ Neste processo não serão recolhidas informações do utilizador!</string>
<string name="label_inside_account_with_name">em %1$s</string>
<plurals name="book_account_stats">
<item quantity="one">%d conta</item>
<item quantity="other">%d accounts</item>
<item quantity="other">%d contas</item>
</plurals>
<plurals name="book_transaction_stats">
<item quantity="one">%d transação</item>
<item quantity="other">%d transactions</item>
<item quantity="other">%d transações</item>
</plurals>
<string-array name="report_account_types">
<item>EXPENSE</item>
<item>INCOME</item>
<item>DESPESA</item>
<item>RECEITA</item>
</string-array>
<string name="toast_connected_to_google_drive">Connected to Google Drive</string>
<string name="toast_unable_to_connect_to_google_drive">Unable to connect to Google Drive</string>
<string name="toast_enter_amount_to_split">Please enter an amount to split</string>
<string name="label_export_target_external_service">external service</string>
<string name="toast_updated_transaction_recurring_schedule">Updated transaction recurring schedule</string>
<string name="label_export_transactions_since_date">Since</string>
<string name="switch_export_transactions_from_all_time">All time</string>
<string name="label_recommend_app">Recommend in Play Store</string>
<string name="repeat_until_date">until %1$s</string>
<string name="repeat_on_weekday">on %1$s</string>
<string name="repeat_x_times">for %1$s times</string>
<string name="menu_show_compact_view">Compact View</string>
<string name="book_default_name">Book %1$d</string>
<string name="toast_connected_to_google_drive">Ligado ao Google Drive</string>
<string name="toast_unable_to_connect_to_google_drive">Não é possível estabelecer ligação ao Google Drive</string>
<string name="toast_enter_amount_to_split">Por favor introduza um montante a dividir</string>
<string name="label_export_target_external_service">serviço externo</string>
<string name="toast_updated_transaction_recurring_schedule">Transação atualizada agendamento recorrente</string>
<string name="label_export_transactions_since_date">Desde</string>
<string name="switch_export_transactions_from_all_time">Todo o tempo</string>
<string name="label_recommend_app">Recomendado na Play Store</string>
<string name="repeat_until_date">desde%1$s</string>
<string name="repeat_on_weekday">na %1$s</string>
<string name="repeat_x_times">para %1$s vezes</string>
<string name="menu_show_compact_view">Vista Compacta</string>
<string name="book_default_name">Livro %1$d</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,5 @@
<string name="repeat_on_weekday">в %1$s</string>
<string name="repeat_x_times">для %1$s раз</string>
<string name="menu_show_compact_view">Компактный вид</string>
<string name="book_default_name">Book %1$d</string>
<string name="book_default_name">Книга %1$d</string>
</resources>
Loading

0 comments on commit 66b3d0c

Please sign in to comment.