]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/commitdiff
Move Refresh to the top of the options menu. https://redmine.stoutner.com/issues/526
authorSoren Stoutner <soren@stoutner.com>
Wed, 25 Mar 2020 21:08:58 +0000 (14:08 -0700)
committerSoren Stoutner <soren@stoutner.com>
Wed, 25 Mar 2020 21:08:58 +0000 (14:08 -0700)
app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
app/src/main/res/menu/webview_options_menu.xml
app/src/main/res/values-de/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-fr/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values-tr/strings.xml
app/src/main/res/values/strings.xml

index 81a80cf28686d981fe97f7fb1c545a061dbf208c..8034dd68e3d507a67d8e18fd5c94212a0822092f 100644 (file)
@@ -991,109 +991,13 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                 // Consume the event.
                 return true;
 
-            case R.id.add_or_edit_domain:
-                if (currentWebView.getDomainSettingsApplied()) {  // Edit the current domain settings.
-                    // Reapply the domain settings on returning to `MainWebViewActivity`.
-                    reapplyDomainSettingsOnRestart = true;
-
-                    // Create an intent to launch the domains activity.
-                    Intent domainsIntent = new Intent(this, DomainsActivity.class);
-
-                    // Add the extra information to the intent.
-                    domainsIntent.putExtra("load_domain", currentWebView.getDomainSettingsDatabaseId());
-                    domainsIntent.putExtra("close_on_back", true);
-                    domainsIntent.putExtra("current_url", currentWebView.getUrl());
-
-                    // Get the current certificate.
-                    SslCertificate sslCertificate = currentWebView.getCertificate();
-
-                    // Check to see if the SSL certificate is populated.
-                    if (sslCertificate != null) {
-                        // Extract the certificate to strings.
-                        String issuedToCName = sslCertificate.getIssuedTo().getCName();
-                        String issuedToOName = sslCertificate.getIssuedTo().getOName();
-                        String issuedToUName = sslCertificate.getIssuedTo().getUName();
-                        String issuedByCName = sslCertificate.getIssuedBy().getCName();
-                        String issuedByOName = sslCertificate.getIssuedBy().getOName();
-                        String issuedByUName = sslCertificate.getIssuedBy().getUName();
-                        long startDateLong = sslCertificate.getValidNotBeforeDate().getTime();
-                        long endDateLong = sslCertificate.getValidNotAfterDate().getTime();
-
-                        // Add the certificate to the intent.
-                        domainsIntent.putExtra("ssl_issued_to_cname", issuedToCName);
-                        domainsIntent.putExtra("ssl_issued_to_oname", issuedToOName);
-                        domainsIntent.putExtra("ssl_issued_to_uname", issuedToUName);
-                        domainsIntent.putExtra("ssl_issued_by_cname", issuedByCName);
-                        domainsIntent.putExtra("ssl_issued_by_oname", issuedByOName);
-                        domainsIntent.putExtra("ssl_issued_by_uname", issuedByUName);
-                        domainsIntent.putExtra("ssl_start_date", startDateLong);
-                        domainsIntent.putExtra("ssl_end_date", endDateLong);
-                    }
-
-                    // Check to see if the current IP addresses have been received.
-                    if (currentWebView.hasCurrentIpAddresses()) {
-                        // Add the current IP addresses to the intent.
-                        domainsIntent.putExtra("current_ip_addresses", currentWebView.getCurrentIpAddresses());
-                    }
-
-                    // Make it so.
-                    startActivity(domainsIntent);
-                } else {  // Add a new domain.
-                    // Apply the new domain settings on returning to `MainWebViewActivity`.
-                    reapplyDomainSettingsOnRestart = true;
-
-                    // Get the current domain
-                    Uri currentUri = Uri.parse(currentWebView.getUrl());
-                    String currentDomain = currentUri.getHost();
-
-                    // Initialize the database handler.  The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`.
-                    DomainsDatabaseHelper domainsDatabaseHelper = new DomainsDatabaseHelper(this, null, null, 0);
-
-                    // Create the domain and store the database ID.
-                    int newDomainDatabaseId = domainsDatabaseHelper.addDomain(currentDomain);
-
-                    // Create an intent to launch the domains activity.
-                    Intent domainsIntent = new Intent(this, DomainsActivity.class);
-
-                    // Add the extra information to the intent.
-                    domainsIntent.putExtra("load_domain", newDomainDatabaseId);
-                    domainsIntent.putExtra("close_on_back", true);
-                    domainsIntent.putExtra("current_url", currentWebView.getUrl());
-
-                    // Get the current certificate.
-                    SslCertificate sslCertificate = currentWebView.getCertificate();
-
-                    // Check to see if the SSL certificate is populated.
-                    if (sslCertificate != null) {
-                        // Extract the certificate to strings.
-                        String issuedToCName = sslCertificate.getIssuedTo().getCName();
-                        String issuedToOName = sslCertificate.getIssuedTo().getOName();
-                        String issuedToUName = sslCertificate.getIssuedTo().getUName();
-                        String issuedByCName = sslCertificate.getIssuedBy().getCName();
-                        String issuedByOName = sslCertificate.getIssuedBy().getOName();
-                        String issuedByUName = sslCertificate.getIssuedBy().getUName();
-                        long startDateLong = sslCertificate.getValidNotBeforeDate().getTime();
-                        long endDateLong = sslCertificate.getValidNotAfterDate().getTime();
-
-                        // Add the certificate to the intent.
-                        domainsIntent.putExtra("ssl_issued_to_cname", issuedToCName);
-                        domainsIntent.putExtra("ssl_issued_to_oname", issuedToOName);
-                        domainsIntent.putExtra("ssl_issued_to_uname", issuedToUName);
-                        domainsIntent.putExtra("ssl_issued_by_cname", issuedByCName);
-                        domainsIntent.putExtra("ssl_issued_by_oname", issuedByOName);
-                        domainsIntent.putExtra("ssl_issued_by_uname", issuedByUName);
-                        domainsIntent.putExtra("ssl_start_date", startDateLong);
-                        domainsIntent.putExtra("ssl_end_date", endDateLong);
-                    }
-
-                    // Check to see if the current IP addresses have been received.
-                    if (currentWebView.hasCurrentIpAddresses()) {
-                        // Add the current IP addresses to the intent.
-                        domainsIntent.putExtra("current_ip_addresses", currentWebView.getCurrentIpAddresses());
-                    }
-
-                    // Make it so.
-                    startActivity(domainsIntent);
+            case R.id.refresh:
+                if (menuItem.getTitle().equals(getString(R.string.refresh))) {  // The refresh button was pushed.
+                    // Reload the current WebView.
+                    currentWebView.reload();
+                } else {  // The stop button was pushed.
+                    // Stop the loading of the WebView.
+                    currentWebView.stopLoading();
                 }
 
                 // Consume the event.
@@ -1777,13 +1681,109 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
                 // Consume the event.
                 return true;
 
-            case R.id.refresh:
-                if (menuItem.getTitle().equals(getString(R.string.refresh))) {  // The refresh button was pushed.
-                    // Reload the current WebView.
-                    currentWebView.reload();
-                } else {  // The stop button was pushed.
-                    // Stop the loading of the WebView.
-                    currentWebView.stopLoading();
+            case R.id.add_or_edit_domain:
+                if (currentWebView.getDomainSettingsApplied()) {  // Edit the current domain settings.
+                    // Reapply the domain settings on returning to `MainWebViewActivity`.
+                    reapplyDomainSettingsOnRestart = true;
+
+                    // Create an intent to launch the domains activity.
+                    Intent domainsIntent = new Intent(this, DomainsActivity.class);
+
+                    // Add the extra information to the intent.
+                    domainsIntent.putExtra("load_domain", currentWebView.getDomainSettingsDatabaseId());
+                    domainsIntent.putExtra("close_on_back", true);
+                    domainsIntent.putExtra("current_url", currentWebView.getUrl());
+
+                    // Get the current certificate.
+                    SslCertificate sslCertificate = currentWebView.getCertificate();
+
+                    // Check to see if the SSL certificate is populated.
+                    if (sslCertificate != null) {
+                        // Extract the certificate to strings.
+                        String issuedToCName = sslCertificate.getIssuedTo().getCName();
+                        String issuedToOName = sslCertificate.getIssuedTo().getOName();
+                        String issuedToUName = sslCertificate.getIssuedTo().getUName();
+                        String issuedByCName = sslCertificate.getIssuedBy().getCName();
+                        String issuedByOName = sslCertificate.getIssuedBy().getOName();
+                        String issuedByUName = sslCertificate.getIssuedBy().getUName();
+                        long startDateLong = sslCertificate.getValidNotBeforeDate().getTime();
+                        long endDateLong = sslCertificate.getValidNotAfterDate().getTime();
+
+                        // Add the certificate to the intent.
+                        domainsIntent.putExtra("ssl_issued_to_cname", issuedToCName);
+                        domainsIntent.putExtra("ssl_issued_to_oname", issuedToOName);
+                        domainsIntent.putExtra("ssl_issued_to_uname", issuedToUName);
+                        domainsIntent.putExtra("ssl_issued_by_cname", issuedByCName);
+                        domainsIntent.putExtra("ssl_issued_by_oname", issuedByOName);
+                        domainsIntent.putExtra("ssl_issued_by_uname", issuedByUName);
+                        domainsIntent.putExtra("ssl_start_date", startDateLong);
+                        domainsIntent.putExtra("ssl_end_date", endDateLong);
+                    }
+
+                    // Check to see if the current IP addresses have been received.
+                    if (currentWebView.hasCurrentIpAddresses()) {
+                        // Add the current IP addresses to the intent.
+                        domainsIntent.putExtra("current_ip_addresses", currentWebView.getCurrentIpAddresses());
+                    }
+
+                    // Make it so.
+                    startActivity(domainsIntent);
+                } else {  // Add a new domain.
+                    // Apply the new domain settings on returning to `MainWebViewActivity`.
+                    reapplyDomainSettingsOnRestart = true;
+
+                    // Get the current domain
+                    Uri currentUri = Uri.parse(currentWebView.getUrl());
+                    String currentDomain = currentUri.getHost();
+
+                    // Initialize the database handler.  The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`.
+                    DomainsDatabaseHelper domainsDatabaseHelper = new DomainsDatabaseHelper(this, null, null, 0);
+
+                    // Create the domain and store the database ID.
+                    int newDomainDatabaseId = domainsDatabaseHelper.addDomain(currentDomain);
+
+                    // Create an intent to launch the domains activity.
+                    Intent domainsIntent = new Intent(this, DomainsActivity.class);
+
+                    // Add the extra information to the intent.
+                    domainsIntent.putExtra("load_domain", newDomainDatabaseId);
+                    domainsIntent.putExtra("close_on_back", true);
+                    domainsIntent.putExtra("current_url", currentWebView.getUrl());
+
+                    // Get the current certificate.
+                    SslCertificate sslCertificate = currentWebView.getCertificate();
+
+                    // Check to see if the SSL certificate is populated.
+                    if (sslCertificate != null) {
+                        // Extract the certificate to strings.
+                        String issuedToCName = sslCertificate.getIssuedTo().getCName();
+                        String issuedToOName = sslCertificate.getIssuedTo().getOName();
+                        String issuedToUName = sslCertificate.getIssuedTo().getUName();
+                        String issuedByCName = sslCertificate.getIssuedBy().getCName();
+                        String issuedByOName = sslCertificate.getIssuedBy().getOName();
+                        String issuedByUName = sslCertificate.getIssuedBy().getUName();
+                        long startDateLong = sslCertificate.getValidNotBeforeDate().getTime();
+                        long endDateLong = sslCertificate.getValidNotAfterDate().getTime();
+
+                        // Add the certificate to the intent.
+                        domainsIntent.putExtra("ssl_issued_to_cname", issuedToCName);
+                        domainsIntent.putExtra("ssl_issued_to_oname", issuedToOName);
+                        domainsIntent.putExtra("ssl_issued_to_uname", issuedToUName);
+                        domainsIntent.putExtra("ssl_issued_by_cname", issuedByCName);
+                        domainsIntent.putExtra("ssl_issued_by_oname", issuedByOName);
+                        domainsIntent.putExtra("ssl_issued_by_uname", issuedByUName);
+                        domainsIntent.putExtra("ssl_start_date", startDateLong);
+                        domainsIntent.putExtra("ssl_end_date", endDateLong);
+                    }
+
+                    // Check to see if the current IP addresses have been received.
+                    if (currentWebView.hasCurrentIpAddresses()) {
+                        // Add the current IP addresses to the intent.
+                        domainsIntent.putExtra("current_ip_addresses", currentWebView.getCurrentIpAddresses());
+                    }
+
+                    // Make it so.
+                    startActivity(domainsIntent);
                 }
 
                 // Consume the event.
index dd0fc53d7e1192b40d1150248b890742d8de7271..df2a6f207cb265caa4d1ab59c5c65425c13b09bd 100644 (file)
@@ -32,8 +32,8 @@
         app:showAsAction="ifRoom" />
 
     <item
-        android:id="@+id/add_or_edit_domain"
-        android:title="@string/add_domain_settings"
+        android:id="@+id/refresh"
+        android:title="@string/refresh"
         android:orderInCategory="200"
         app:showAsAction="never" />
 
     </item>
 
     <item
-        android:id="@+id/refresh"
-        android:title="@string/refresh"
+        android:id="@+id/add_or_edit_domain"
+        android:title="@string/add_domain_settings"
         android:orderInCategory="1300"
         app:showAsAction="never" />
 
index 6c247979b5a6f7878eadba2b3de979092124e185..0cea25f1af5a70ad957766e93dae34a67f53f014 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Domain-Einstellungen speichern</string>
-    <string name="edit_domain_settings">Domain-Einstellungen bearbeiten</string>
+    <string name="refresh">Aktualisieren</string>
+    <string name="stop">Stop</string>
     <string name="first_party_cookies">Erstanbieter-Cookies</string>
     <string name="third_party_cookies">Drittanbieter-Cookies</string>
     <string name="dom_storage">DOM-Speicher</string>
         <string name="share_url">URL teilen</string>
         <string name="open_with_app">Mit App öffnen</string>
         <string name="open_with_browser">Mit Browser öffnen</string>
-    <string name="refresh">Aktualisieren</string>
-    <string name="stop">Stop</string>
+    <string name="add_domain_settings">Domain-Einstellungen speichern</string>
+    <string name="edit_domain_settings">Domain-Einstellungen bearbeiten</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">In neuem Tab öffnen</string>
index e75f0343444db2eac8ef444c1daf6f06d69fdb5e..04d6d65ab7f668730131d51bd6d5b14ebed7a4f3 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">Javascript</string>
-    <string name="add_domain_settings">Añadir dominio</string>
-    <string name="edit_domain_settings">Editar dominio</string>
+    <string name="refresh">Actualizar</string>
+    <string name="stop">Parar</string>
     <string name="first_party_cookies">Cookies de primera parte</string>
     <string name="third_party_cookies">Cookies de terceras partes</string>
     <string name="dom_storage">Almacenamiento DOM</string>
         <string name="share_url">Compartir URL</string>
         <string name="open_with_app">Abrir con App</string>
         <string name="open_with_browser">Abrir con Navegador</string>
-    <string name="refresh">Actualizar</string>
-    <string name="stop">Parar</string>
+    <string name="add_domain_settings">Añadir dominio</string>
+    <string name="edit_domain_settings">Editar dominio</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Abrir en nueva pestaña</string>
         <string name="clear_cache_summary">Borra la caché de WebView.</string>
     <string name="general">General</string>
         <string name="homepage">Página de inicio</string>
+        <string name="download_location">Lugar de descarga</string>
+        <string-array name="download_location_entries">
+            <item>Auto</item>
+            <item>Directorio de aplicaciones</item>
+            <item>Directorio público</item>
+            <item>Personalizado</item>
+        </string-array>
+        <string name="download_custom_location">Lugar personalizado de descarga</string>
         <string name="font_size_preference">Tamaño de fuente</string>
         <string name="open_intents_in_new_tab">Abrir contenido en nueva pestaña</string>
         <string name="open_intents_in_new_tab_summary">Los contenidos son enlaces enviados desde otras apps.</string>
index 3af69bdeb8670264b3f4d8bcd9249fb44e3441f4..3e923a8ee4b4c0d6a6cf137a6cbcd900c716480b 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Paramétrer le domaine</string>
-    <string name="edit_domain_settings">Editer le domaine</string>
+    <string name="refresh">Rafraîchir</string>
+    <string name="stop">Stop</string>
     <string name="first_party_cookies">Cookies internes</string>
     <string name="third_party_cookies">Cookies tiers</string>
     <string name="dom_storage">Stockage DOM</string>
         <string name="share_url">Partager URL</string>
         <string name="open_with_app">Ouvrir avec une application</string>
         <string name="open_with_browser">Ouvrir dans le navigateur</string>
-    <string name="refresh">Rafraîchir</string>
-    <string name="stop">Stop</string>
+    <string name="add_domain_settings">Paramétrer le domaine</string>
+    <string name="edit_domain_settings">Editer le domaine</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Ouvrir dans un nouvel onglet</string>
index a567b71e07b1f502ac674191ed8aba7c3acbf457..3eab77c8083eee70c78ad65b5f8b5c3e0b99cbd6 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Aggiungi dominio</string>
-    <string name="edit_domain_settings">Modifica dominio</string>
+    <string name="refresh">Aggiorna</string>
+    <string name="stop">Stop</string>
     <string name="first_party_cookies">Cookies proprietari</string>
     <string name="third_party_cookies">Cookies di terze parti</string>
     <string name="dom_storage">DOM storage</string>
         <string name="share_url">Condividi URL</string>
         <string name="open_with_app">Apri con App</string>
         <string name="open_with_browser">Apri con il Browser</string>
-    <string name="refresh">Aggiorna</string>
-    <string name="stop">Stop</string>
+    <string name="add_domain_settings">Aggiungi dominio</string>
+    <string name="edit_domain_settings">Modifica dominio</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Apri in una nuova Scheda</string>
index 4c5e3485aa89a3103e24f79bc1c489ed58ffce59..111da7028435e8d1a3b3f62ab9f7790e40056e76 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Добавление параметров домена</string>
-    <string name="edit_domain_settings">Изменение параметров домена</string>
+    <string name="refresh">Обновить</string>
+    <string name="stop">Остановить</string>
     <string name="first_party_cookies">Первичные файлы cookie</string>
     <string name="third_party_cookies">Сторонние файлы cookie</string>
     <string name="dom_storage">DOM-хранилище</string>
         <string name="share_url">Поделиться URL</string>
         <string name="open_with_app">Открыть в приложении</string>
         <string name="open_with_browser">Открыть в браузере</string>
-    <string name="refresh">Обновить</string>
-    <string name="stop">Остановить</string>
+    <string name="add_domain_settings">Добавление параметров домена</string>
+    <string name="edit_domain_settings">Изменение параметров домена</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Открыть в новой вкладке</string>
index 689cc1efaf846330aef762c2998f68dc685fac59..6a0ad6f717f02a5f0e40b8a3a054ef4748b184dc 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Domain ayarları ekle</string>
-    <string name="edit_domain_settings">Domain ayarlarını düzenle</string>
+    <string name="refresh">Yenile</string>
+    <string name="stop">Dur</string>
     <string name="first_party_cookies">Birinci Taraf Çerezler</string>
     <string name="third_party_cookies">Üçüncü Taraf Çerezler</string>
     <string name="dom_storage">DOM Depolama</string>
         <string name="share_url">URL\'yi paylaş</string>
         <string name="open_with_app">Uygulamayla aç</string>
         <string name="open_with_browser">Tarayıcıyla aç</string>
-    <string name="refresh">Yenile</string>
-    <string name="stop">Dur</string>
+    <string name="add_domain_settings">Domain ayarları ekle</string>
+    <string name="edit_domain_settings">Domain ayarlarını düzenle</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Yeni sekmede aç</string>
index 3dffed5415d82feaff3261bbc53e244e3d8e99bb..3df126b613b936c649a77486fa156dc48b8ba175 100644 (file)
 
     <!-- MainWebViewActivity Options Menu. -->
     <string name="javascript">JavaScript</string>
-    <string name="add_domain_settings">Add Domain Settings</string>
-    <string name="edit_domain_settings">Edit Domain Settings</string>
+    <string name="refresh">Refresh</string>
+    <string name="stop">Stop</string>
     <string name="first_party_cookies">First-Party Cookies</string>
     <string name="third_party_cookies">Third-Party Cookies</string>
     <string name="dom_storage">DOM Storage</string>
         <string name="share_url">Share URL</string>
         <string name="open_with_app">Open with App</string>
         <string name="open_with_browser">Open with Browser</string>
-    <string name="refresh">Refresh</string>
-    <string name="stop">Stop</string>
+    <string name="add_domain_settings">Add Domain Settings</string>
+    <string name="edit_domain_settings">Edit Domain Settings</string>
 
     <!-- Context Menus. -->
     <string name="open_in_new_tab">Open in New Tab</string>