]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveWebpageDialog.kt
Restore saving as MHT web archives. https://redmine.stoutner.com/issues/677
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / SaveWebpageDialog.kt
index b27e1703b6537b04022560eada2122b9f4556f6d..782526d0f761ed94adc7877978f2717c5aa404a1 100644 (file)
@@ -77,7 +77,8 @@ class SaveWebpageDialog : DialogFragment() {
     companion object {
         // Define the companion object constants.  These can be moved to class constants once all of the code has transitioned to Kotlin.
         const val SAVE_URL = 0
-        const val SAVE_IMAGE = 1
+        const val SAVE_ARCHIVE = 1
+        const val SAVE_IMAGE = 2
 
         // `@JvmStatic` will no longer be required once all the code has transitioned to Kotlin.
         @JvmStatic
@@ -135,6 +136,18 @@ class SaveWebpageDialog : DialogFragment() {
                 }
             }
 
+            SAVE_ARCHIVE -> {
+                // Set the title.
+                dialogBuilder.setTitle(R.string.save_archive)
+
+                // Set the icon according to the theme.
+                if (currentThemeStatus == Configuration.UI_MODE_NIGHT_NO) {
+                    dialogBuilder.setIcon(R.drawable.dom_storage_cleared_day)
+                } else {
+                    dialogBuilder.setIcon(R.drawable.dom_storage_cleared_night)
+                }
+            }
+
             SAVE_IMAGE -> {
                 // Set the title.
                 dialogBuilder.setTitle(R.string.save_image)