|
@@ -32,9 +32,9 @@ import info.knacki.pass.git.entities.GitRef;
|
|
|
import info.knacki.pass.io.FileUtils;
|
|
import info.knacki.pass.io.FileUtils;
|
|
|
import info.knacki.pass.io.PathUtils;
|
|
import info.knacki.pass.io.PathUtils;
|
|
|
import info.knacki.pass.settings.SettingsManager;
|
|
import info.knacki.pass.settings.SettingsManager;
|
|
|
|
|
+import info.knacki.pass.ui.GitPullActivity;
|
|
|
import info.knacki.pass.ui.alertPrompt.AlertPrompt;
|
|
import info.knacki.pass.ui.alertPrompt.AlertPrompt;
|
|
|
import info.knacki.pass.ui.alertPrompt.views.TextView;
|
|
import info.knacki.pass.ui.alertPrompt.views.TextView;
|
|
|
-import info.knacki.pass.ui.GitPullActivity;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* A {@link PreferenceActivity} that presents a set of application settings. On
|
|
* A {@link PreferenceActivity} that presents a set of application settings. On
|
|
@@ -477,6 +477,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ updateGpgFileLabel();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -487,9 +488,21 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|
|
if (null != uriData) {
|
|
if (null != uriData) {
|
|
|
String path = uriData.getPath();
|
|
String path = uriData.getPath();
|
|
|
SettingsManager.SetGPGKeyFile(getActivity(), path);
|
|
SettingsManager.SetGPGKeyFile(getActivity(), path);
|
|
|
|
|
+ updateGpgFileLabel();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ protected void updateGpgFileLabel() {
|
|
|
|
|
+ String gpgFileName = SettingsManager.GetGPGKeyFile(getActivity());
|
|
|
|
|
+ File gpgFile = gpgFileName == null ? null : new File(gpgFileName);
|
|
|
|
|
+
|
|
|
|
|
+ if (gpgFile != null && gpgFile.exists()) {
|
|
|
|
|
+ findPreference(getResources().getString(R.string.id_gpg_keyfile)).setSummary(gpgFile.getName());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ findPreference(getResources().getString(R.string.id_gpg_keyfile)).setSummary(R.string.pref_summary_gpg_keyfile);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|