1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-09 03:31:46 +00:00

Fix "Share to Syncthing" when user didn't complete welcome wizard (fixes #354) (#360)

* Add string: complete_welcome_wizard_first

* Imported de translation

* Fix "Share to Syncthing" when user didn't complete welcome wizard (fixes #354)
This commit is contained in:
Catfriend1 2019-03-09 23:02:58 +01:00 committed by GitHub
parent 20e6a42ec0
commit c8502ccbd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -29,6 +29,7 @@ import com.nutomic.syncthingandroid.model.Folder;
import com.nutomic.syncthingandroid.service.SyncthingService;
import com.nutomic.syncthingandroid.service.SyncthingServiceBinder;
import com.nutomic.syncthingandroid.util.ConfigRouter;
import com.nutomic.syncthingandroid.util.ConfigXml.OpenConfigException;
import com.nutomic.syncthingandroid.util.Util;
import java.io.File;
@ -76,7 +77,14 @@ public class ShareActivity extends SyncthingActivity
@Override
public void onServiceStateChange(SyncthingService.State currentState) {
List<Folder> folders = mConfig.getFolders(getApi());
List<Folder> folders = null;
try {
folders = mConfig.getFolders(getApi());
} catch (OpenConfigException e) {
Toast.makeText(this, getString(R.string.complete_welcome_wizard_first), Toast.LENGTH_LONG).show();
finish();
return;
}
// Get the index of the previously selected folder.
int folderIndex = 0;

View file

@ -703,6 +703,9 @@ Bitte melden Sie auftretende Probleme via GitHub.</string>
<!-- ShareActivity -->
<!-- Toast if user didn't complete the welcome wizard yet -->
<string name="complete_welcome_wizard_first">Starte zuerst die App aus der App-Übersicht und schließe den Willkommensassistenten ab, bevor Du Dateien teilst.</string>
<!-- Title of the "share" activity -->
<string name="share_activity_title">Speichern in Syncthing</string>

View file

@ -724,6 +724,9 @@ Please report any problems you encounter via Github.</string>
<!-- ShareActivity -->
<!-- Toast if user didn't complete the welcome wizard yet -->
<string name="complete_welcome_wizard_first">First, launch the app from the app drawer and complete the welcome wizard before sharing files.</string>
<!-- Title of the "share" activity -->
<string name="share_activity_title">Save to Syncthing</string>