Browse Source

Fix for Android SDK setup

Josh Engebretson 10 years ago
parent
commit
dff8dd7466

+ 2 - 1
Source/AtomicEditor/Source/AEPreferences.h

@@ -5,6 +5,7 @@
 #pragma once
 
 #include <Atomic/Core/Object.h>
+#include <Atomic/IO/FileSystem.h>
 
 using namespace Atomic;
 
@@ -34,7 +35,7 @@ public:
     const Vector<String>& GetRecentProjects() { return recentProjects_; }
 
     void SetAndroidSDKPath(const String& path) { androidSDKPath_ = path; Write(); }
-    const String& GetAndroidSDKPath() { return androidSDKPath_; }
+    String GetAndroidSDKPath() { return AddTrailingSlash(androidSDKPath_); }
 
     void Read();
     void Write();

+ 6 - 1
Source/AtomicEditor/Source/UI/Modal/UIBuildSettingsAndroid.cpp

@@ -172,6 +172,7 @@ void UIBuildSettingsAndroid::StoreSettings()
 void UIBuildSettingsAndroid::Refresh()
 {
     Editor* editor = context_->GetSubsystem<Editor>();
+
     TBEditField* sdk_path = delegate_->GetWidgetByIDAndType<TBEditField>(TBIDC("sdk_path"));
     sdk_path->SetText(editor->GetPreferences()->GetAndroidSDKPath().CString());
 
@@ -196,7 +197,11 @@ bool UIBuildSettingsAndroid::OnEvent(const TBWidgetEvent &ev)
         if (ev.target->GetID() == TBIDC("choose_sdk_path"))
         {
             String path = utils->GetAndroidSDKPath("");
-            editor->GetPreferences()->SetAndroidSDKPath(path);
+            if (path.Length())
+            {
+                editor->GetPreferences()->SetAndroidSDKPath(path);
+                Refresh();
+            }
             return true;
         }
         if (ev.target->GetID() == TBIDC("refresh_sdk_targets"))