OSDN Git Service

Preferenceの初期化部分を統合したとき、不足していた初期化データを追加(途中)。
authorMRSa <mrsa@myad.jp>
Thu, 3 Aug 2023 14:47:46 +0000 (23:47 +0900)
committerMRSa <mrsa@myad.jp>
Thu, 3 Aug 2023 14:47:46 +0000 (23:47 +0900)
app/src/main/java/net/osdn/gokigen/pkremote/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/pkremote/preference/PreferencePropertyInitializer.kt
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences_nikon.xml

index 9c9637a..48fe04f 100644 (file)
@@ -109,6 +109,8 @@ public interface IPreferencePropertyAccessor
     String NIKON_CAMERA_IP_ADDRESS = "nikon_host_ip";
     String NIKON_CAMERA_IP_ADDRESS_DEFAULT_VALUE = "192.168.1.1";
 
+    String NIKON_AUTO_DETECT_HOST_IP = "nikon_auto_detect_host_ip";
+
     String NIKON_RECEIVE_WAIT = "nikon_receive_wait";
     String NIKON_RECEIVE_WAIT_DEFAULT_VALUE = "50";
 
index 6a6b57b..805d2b7 100644 (file)
@@ -120,6 +120,21 @@ class PreferencePropertyInitializer(context: Context)
             if (!items.containsKey(IPreferencePropertyAccessor.VISIONKIDS_AUTO_SET_HOST_IP)) {
                 editor?.putBoolean(IPreferencePropertyAccessor.VISIONKIDS_AUTO_SET_HOST_IP, true)
             }
+            if (!items.containsKey(IPreferencePropertyAccessor.NIKON_AUTO_DETECT_HOST_IP)) {
+                editor?.putBoolean(IPreferencePropertyAccessor.NIKON_AUTO_DETECT_HOST_IP, true)
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CANON_RAW_SUFFIX))
+            {
+                editor.putString(IPreferencePropertyAccessor.CANON_RAW_SUFFIX, IPreferencePropertyAccessor.CANON_RAW_SUFFIX_DEFAULT_VALUE);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CANON_RECEIVE_WAIT))
+            {
+                editor.putString(IPreferencePropertyAccessor.CANON_RECEIVE_WAIT, IPreferencePropertyAccessor.CANON_RECEIVE_WAIT_DEFAULT_VALUE);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL))
+            {
+                editor.putBoolean(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, false);
+            }
             editor?.apply()
         }
         catch (e: Exception)
index 46e81e2..c52f8aa 100644 (file)
     <string name="canon_get_image_screennail">画像取得中&#8230;</string>
     <string name="canon_get_image_screennail_done">完了</string>
 
+    <string name="pref_nikon_auto_detect_host_ip">カメラIPアドレスを自動設定</string>
+    <string name="pref_summary_nikon_auto_detect_host_ip">通常、ONのままでご使用ください。</string>
+
     <string name="pref_canon_auto_detect_host_ip">カメラIPアドレスを自動設定</string>
     <string name="pref_summary_canon_auto_detect_host_ip">通常、ONのままでご使用ください。</string>
 
index 43a4a89..a166234 100644 (file)
     <string name="canon_get_image_screennail">Get Image&#8230;</string>
     <string name="canon_get_image_screennail_done">Done.</string>
 
+    <string name="pref_nikon_auto_detect_host_ip">Set camera ip automatically.</string>
+    <string name="pref_summary_nikon_auto_detect_host_ip">Normally to keep ON.</string>
+
     <string name="pref_canon_auto_detect_host_ip">Set camera ip automatically.</string>
     <string name="pref_summary_canon_auto_detect_host_ip">Normally to keep ON.</string>
 
index 3a69e51..0819b63 100644 (file)
             android:defaultValue="50"
             android:summary="@string/pref_summary_nikon_receive_wait" />
 
+        <CheckBoxPreference
+            android:key="nikon_auto_detect_host_ip"
+            android:title="@string/pref_nikon_auto_detect_host_ip"
+            android:summary="@string/pref_summary_nikon_auto_detect_host_ip" />
 <!--
         <CheckBoxPreference
             android:key="ble_wifi_on"