mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-11 04:25:53 +00:00
Don't show duplicate restart dialog when changing settings
This commit is contained in:
parent
877cf224a5
commit
66a7cf45db
3 changed files with 4 additions and 9 deletions
|
@ -404,7 +404,7 @@ public class MainActivity extends SyncthingActivity
|
||||||
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
startActivity(new Intent(Intent.ACTION_VIEW, uri));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
getApi().editOptions(options, this);
|
getApi().editSettings(getApi().getGui(), options, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
getApi().getUsageReport(report -> {
|
getApi().getUsageReport(report -> {
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class SettingsFragment extends PreferenceFragment
|
||||||
mGui = mApi.getGui();
|
mGui = mApi.getGui();
|
||||||
|
|
||||||
Joiner joiner = Joiner.on(", ");
|
Joiner joiner = Joiner.on(", ");
|
||||||
mDeviceName.setTitle(mApi.getLocalDevice().name);
|
//mDeviceName.setTitle(mApi.getLocalDevice().name);
|
||||||
mListenAddresses.setText(joiner.join(mOptions.listenAddresses));
|
mListenAddresses.setText(joiner.join(mOptions.listenAddresses));
|
||||||
mMaxRecvKbps.setText(Integer.toString(mOptions.maxRecvKbps));
|
mMaxRecvKbps.setText(Integer.toString(mOptions.maxRecvKbps));
|
||||||
mMaxSendKbps.setText(Integer.toString(mOptions.maxSendKbps));
|
mMaxSendKbps.setText(Integer.toString(mOptions.maxSendKbps));
|
||||||
|
@ -219,8 +219,7 @@ public class SettingsFragment extends PreferenceFragment
|
||||||
? Options.USAGE_REPORTING_ACCEPTED
|
? Options.USAGE_REPORTING_ACCEPTED
|
||||||
: Options.USAGE_REPORTING_DENIED;
|
: Options.USAGE_REPORTING_DENIED;
|
||||||
|
|
||||||
mApi.editOptions(mOptions, getActivity());
|
mApi.editSettings(mGui, mOptions, getActivity());
|
||||||
mApi.editGui(mGui, getActivity());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,12 +274,8 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
|
||||||
addFolder(newFolder);
|
addFolder(newFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void editGui(Config.Gui newGui, Activity activity) {
|
public void editSettings(Config.Gui newGui, Options newOptions, Activity activity) {
|
||||||
mConfig.gui = newGui;
|
mConfig.gui = newGui;
|
||||||
requireRestart(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void editOptions(Options newOptions, Activity activity) {
|
|
||||||
mConfig.options = newOptions;
|
mConfig.options = newOptions;
|
||||||
requireRestart(activity);
|
requireRestart(activity);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue