Skip to content

Commit

Permalink
Fix #2789 (Add "Load documents from files" to "Choose document" as well)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Sep 14, 2023
1 parent 079240b commit fd3473a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ import kotlinx.coroutines.launch
import net.bible.android.activity.R
import net.bible.android.control.backup.BackupControl
import net.bible.android.control.document.canDelete
import net.bible.android.control.event.ABEventBus
import net.bible.android.database.DocumentSearchDao
import net.bible.android.view.activity.base.Dialogs
import net.bible.android.view.activity.base.DocumentSelectionBase
import net.bible.android.view.activity.base.IntentHelper
import net.bible.android.view.activity.base.installedDocument
import net.bible.android.view.activity.download.DownloadActivity
import net.bible.android.view.activity.installzip.InstallZip
import net.bible.android.view.activity.navigation.genbookmap.ChooseGeneralBookKey
import net.bible.android.view.activity.page.MainBibleActivity
import net.bible.service.common.CommonUtils
import net.bible.service.db.DatabaseContainer
import net.bible.service.download.FakeBookFactory
Expand Down Expand Up @@ -158,6 +161,13 @@ class ChooseDocument : DocumentSelectionBase(R.menu.choose_document_menu, R.menu
BackupControl.backupModulesViaIntent(this@ChooseDocument)
}
}
R.id.installZip -> {
val intent = Intent(this, InstallZip::class.java)
lifecycleScope.launch {
awaitIntent(intent)
ABEventBus.post(MainBibleActivity.UpdateMainBibleActivityDocuments())
}
}
}
if (!isHandled) {
isHandled = super.onOptionsItemSelected(item)
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/menu/choose_document_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
android:title="@string/backup_modules2"
appcompat:iconTint="@color/white"
android:icon="@drawable/ic_backup_black_24dp"
appcompat:showAsAction="ifRoom"/>
appcompat:showAsAction="never"/>

<item android:id="@+id/downloadButton"
android:title="@string/download"
appcompat:iconTint="@color/white"
android:icon="@drawable/ic_file_download_24dp"
appcompat:showAsAction="always"/>
appcompat:showAsAction="never"/>
<item android:id="@+id/installZip"
android:title="@string/install_zip"
android:icon="@drawable/ic_unarchive_white_24dp"
appcompat:showAsAction="never"/>
</menu>
1 change: 0 additions & 1 deletion app/src/main/res/menu/document_context_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@
<item android:id="@+id/delete_index"
android:title="@string/delete_index"
appcompat:showAsAction="never"/>

</menu>

0 comments on commit fd3473a

Please sign in to comment.