mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
update library on changing download directory
This commit is contained in:
parent
affff7e149
commit
7d8c3de94d
5 changed files with 43 additions and 45 deletions
|
@ -91,30 +91,31 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
String.valueOf(new DecimalFormatSymbols(Locale.getDefault()).getDecimalSeparator());
|
||||
|
||||
final Screen directoriesScreen = createPreferenceScreen("directories");
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "bookPath", Paths.BookPathOption, new Runnable() {
|
||||
public void run() {
|
||||
final BookCollectionShadow collection = new BookCollectionShadow();
|
||||
collection.bindToService(PreferenceActivity.this, new Runnable() {
|
||||
public void run() {
|
||||
collection.reset(false);
|
||||
collection.unbind();
|
||||
}
|
||||
});
|
||||
}
|
||||
final Runnable libraryUpdater = new Runnable() {
|
||||
public void run() {
|
||||
final BookCollectionShadow collection = new BookCollectionShadow();
|
||||
collection.bindToService(PreferenceActivity.this, new Runnable() {
|
||||
public void run() {
|
||||
collection.reset(false);
|
||||
collection.unbind();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "bookPath", Paths.BookPathOption, libraryUpdater
|
||||
));
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "downloadDir", Paths.DownloadsDirectoryOption()
|
||||
directoriesScreen.Resource, "downloadDir", Paths.DownloadsDirectoryOption(), libraryUpdater
|
||||
));
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "fontPath", Paths.FontPathOption
|
||||
directoriesScreen.Resource, "fontPath", Paths.FontPathOption, null
|
||||
));
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "wallpaperPath", Paths.WallpaperPathOption
|
||||
directoriesScreen.Resource, "wallpaperPath", Paths.WallpaperPathOption, null
|
||||
));
|
||||
directoriesScreen.addPreference(myChooserCollection.createPreference(
|
||||
directoriesScreen.Resource, "tempDir", Paths.TempDirectoryOption()
|
||||
directoriesScreen.Resource, "tempDir", Paths.TempDirectoryOption(), null
|
||||
));
|
||||
|
||||
final Screen appearanceScreen = createPreferenceScreen("appearance");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue