diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-09-13 10:35:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 10:35:27 +0200 |
commit | f9b4af4ba55636e943c0255066a74c11428cdd1c (patch) | |
tree | 1e553f95a18a91e5023fadca2d8c0e221778d43d | |
parent | 209285808761f20f180abb365c38de189628183e (diff) | |
parent | fc227ea919ed84fcc308f575f7d3c4ed88bbe540 (diff) |
Merge pull request #65708 from akien-mga/vcs-plugin-ssh-key-HOME
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 761140b2d5..336ce9e4c8 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -1124,6 +1124,8 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_password->connect(SNAME("text_changed"), callable_mp(this, &VersionControlEditorPlugin::_update_set_up_warning)); set_up_password_input->add_child(set_up_password); + const String home_dir = OS::get_singleton()->has_environment("HOME") ? OS::get_singleton()->get_environment("HOME") : OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS); + HBoxContainer *set_up_ssh_public_key_input = memnew(HBoxContainer); set_up_ssh_public_key_input->set_h_size_flags(Control::SIZE_EXPAND_FILL); set_up_settings_vbc->add_child(set_up_ssh_public_key_input); @@ -1147,10 +1149,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_ssh_public_key_file_dialog->set_access(FileDialog::ACCESS_FILESYSTEM); set_up_ssh_public_key_file_dialog->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE); set_up_ssh_public_key_file_dialog->set_show_hidden_files(true); - // TODO: Make this start at the user's home folder - Ref<DirAccess> d = DirAccess::open(OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DOCUMENTS)); - d->change_dir("../"); - set_up_ssh_public_key_file_dialog->set_current_dir(d->get_current_dir()); + set_up_ssh_public_key_file_dialog->set_current_dir(home_dir); set_up_ssh_public_key_file_dialog->connect(SNAME("file_selected"), callable_mp(this, &VersionControlEditorPlugin::_ssh_public_key_selected)); set_up_ssh_public_key_input_hbc->add_child(set_up_ssh_public_key_file_dialog); @@ -1183,8 +1182,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() { set_up_ssh_private_key_file_dialog->set_access(FileDialog::ACCESS_FILESYSTEM); set_up_ssh_private_key_file_dialog->set_file_mode(FileDialog::FILE_MODE_OPEN_FILE); set_up_ssh_private_key_file_dialog->set_show_hidden_files(true); - // TODO: Make this start at the user's home folder - set_up_ssh_private_key_file_dialog->set_current_dir(d->get_current_dir()); + set_up_ssh_private_key_file_dialog->set_current_dir(home_dir); set_up_ssh_private_key_file_dialog->connect("file_selected", callable_mp(this, &VersionControlEditorPlugin::_ssh_private_key_selected)); set_up_ssh_private_key_input_hbc->add_child(set_up_ssh_private_key_file_dialog); |