diff --git a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java index fa164681..cf71649f 100644 --- a/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java +++ b/src/main/java/com/nutomic/syncthingandroid/activities/MainActivity.java @@ -404,7 +404,7 @@ public class MainActivity extends SyncthingActivity startActivity(new Intent(Intent.ACTION_VIEW, uri)); break; } - getApi().editOptions(options, this); + getApi().editSettings(getApi().getGui(), options, this); }; getApi().getUsageReport(report -> { diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java index 64a8b2ec..f5af6e27 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/SettingsFragment.java @@ -165,7 +165,7 @@ public class SettingsFragment extends PreferenceFragment mGui = mApi.getGui(); Joiner joiner = Joiner.on(", "); - mDeviceName.setTitle(mApi.getLocalDevice().name); + //mDeviceName.setTitle(mApi.getLocalDevice().name); mListenAddresses.setText(joiner.join(mOptions.listenAddresses)); mMaxRecvKbps.setText(Integer.toString(mOptions.maxRecvKbps)); mMaxSendKbps.setText(Integer.toString(mOptions.maxSendKbps)); @@ -219,8 +219,7 @@ public class SettingsFragment extends PreferenceFragment ? Options.USAGE_REPORTING_ACCEPTED : Options.USAGE_REPORTING_DENIED; - mApi.editOptions(mOptions, getActivity()); - mApi.editGui(mGui, getActivity()); + mApi.editSettings(mGui, mOptions, getActivity()); return true; } diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java index cb6de59d..6e02491e 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java @@ -274,12 +274,8 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, addFolder(newFolder); } - public void editGui(Config.Gui newGui, Activity activity) { + public void editSettings(Config.Gui newGui, Options newOptions, Activity activity) { mConfig.gui = newGui; - requireRestart(activity); - } - - public void editOptions(Options newOptions, Activity activity) { mConfig.options = newOptions; requireRestart(activity); }