diff --git a/uppsrc/CtrlCore/Ctrl.cpp b/uppsrc/CtrlCore/Ctrl.cpp index 37a11dbc7..bc127e3de 100644 --- a/uppsrc/CtrlCore/Ctrl.cpp +++ b/uppsrc/CtrlCore/Ctrl.cpp @@ -829,6 +829,8 @@ void Ctrl::SetUHDEnabled(bool set) bool Ctrl::IsUHDEnabled() { + if(GetEnv("UPP_DISABLE_UHD__") == "1") + return false; return ApplicationUHDEnabled; } diff --git a/uppsrc/ide/Build.cpp b/uppsrc/ide/Build.cpp index b2e6be138..55e0f44de 100644 --- a/uppsrc/ide/Build.cpp +++ b/uppsrc/ide/Build.cpp @@ -47,7 +47,7 @@ void Ide::BeginBuilding(bool sync_files, bool clear_console) if(clear_console) console.Clear(); build_time = GetTickCount(); - CreateHost(sync_files); + CreateHost(sync_files, disable_uhd); cmdout.Clear(); } @@ -56,7 +56,7 @@ void Ide::EndBuilding(bool ok) console.EndGroup(); console.Wait(); Vector errors = console.PickErrors(); - CreateHost(false)->DeleteFile(errors); + CreateHost(false, disable_uhd)->DeleteFile(errors); if(!errors.IsEmpty()) ok = false; PutConsole(""); @@ -183,7 +183,7 @@ void Ide::Preprocess(bool asmout) { const Workspace& wspc = IdeWorkspace(); if(pi >= wspc.GetCount()) return; - One host = CreateHost(true); + One host = CreateHost(true, disable_uhd); One b = CreateBuilder(~host); Vector linkfile; String linkopt; diff --git a/uppsrc/ide/Builders/Build.cpp b/uppsrc/ide/Builders/Build.cpp index 9e63bd1b9..0f4f87a69 100644 --- a/uppsrc/ide/Builders/Build.cpp +++ b/uppsrc/ide/Builders/Build.cpp @@ -89,7 +89,7 @@ String NoCr(const char *s) return out; } -One MakeBuild::CreateHost(bool sync_files) +One MakeBuild::CreateHost(bool sync_files, bool disable_uhd) { SetupDefaultMethod(); VectorMap bm = GetMethodVars(method); @@ -101,6 +101,8 @@ One MakeBuild::CreateHost(bool sync_files) env.GetAdd("PATH") = Join(host.exedirs, ";"); env.GetAdd("UPP_MAIN__") = GetFileDirectory(PackagePath(GetMain())); env.GetAdd("UPP_ASSEMBLY__") = GetVar("UPP"); + if(disable_uhd) + env.GetAdd("UPP_DISABLE_UHD__") = "1"; // setup LD_LIBRARY_PATH on target dir, needed for all shared builds on posix #ifdef PLATFORM_POSIX @@ -295,7 +297,7 @@ bool MakeBuild::BuildPackage(const Workspace& wspc, int pkindex, int pknumber, i ConsoleShow(); return false; } - One host = CreateHost(false); + One host = CreateHost(false, false); if(!IsNull(onefile)) { OneFileHost *h = new OneFileHost; h->host = pick(host); @@ -466,7 +468,7 @@ bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, b if(main_conf.GetCount()) { VectorMap bm = GetMethodVars(method); - One host = CreateHost(false); + One host = CreateHost(false, false); One b = CreateBuilder(~host); if(b) { Index mcfg = PackageConfig(wspc, 0, bm, mainparam, *host, *b, NULL); @@ -551,7 +553,7 @@ bool MakeBuild::Build() ConsoleShow(); return false; } - One host = CreateHost(false); + One host = CreateHost(false, false); One builder = CreateBuilder(~host); if(!builder) return false; @@ -565,7 +567,7 @@ bool MakeBuild::Build() void MakeBuild::CleanPackage(const Workspace& wspc, int package) { PutConsole(NFormat("Cleaning %s", wspc[package])); - One host = CreateHost(false); + One host = CreateHost(false, false); One builder = CreateBuilder(~host); if(!builder) return; @@ -581,7 +583,7 @@ void MakeBuild::Clean() { ConsoleClear(); - One host = CreateHost(false); + One host = CreateHost(false, false); One builder = CreateBuilder(~host); if(!builder) return; @@ -607,7 +609,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) BeginBuilding(false, true); VectorMap bm = GetMethodVars(method); - One host = CreateHost(false); + One host = CreateHost(false, false); One b = CreateBuilder(~host); if(!b) diff --git a/uppsrc/ide/Builders/Build.h b/uppsrc/ide/Builders/Build.h index 3bf7676e9..872052fa9 100644 --- a/uppsrc/ide/Builders/Build.h +++ b/uppsrc/ide/Builders/Build.h @@ -69,7 +69,7 @@ public: Index PackageConfig(const Workspace& wspc, int package, const VectorMap& bm, String mainparam, Host& host, Builder& b, String *target = NULL); // bool SyncHostFiles(RemoteHost& host); - One CreateHost(bool sync_files); + One CreateHost(bool sync_files, bool disable_uhd); One CreateBuilder(Host *host); String OutDir(const Index& cfg, const String& package, const VectorMap& bm, bool use_target = false); diff --git a/uppsrc/ide/Config.cpp b/uppsrc/ide/Config.cpp index 3e6776b45..763d5a604 100644 --- a/uppsrc/ide/Config.cpp +++ b/uppsrc/ide/Config.cpp @@ -4,7 +4,7 @@ void Ide::SerializeWorkspace(Stream& s) { int i; - int version = 16; + int version = 17; s / version; s.Magic(0x12354); if(s.IsStoring()) { @@ -57,6 +57,8 @@ void Ide::SerializeWorkspace(Stream& s) { s % consolemode; if(version >= 14) s % console_utf8; + if(version >= 17) + s % disable_uhd; s % editfile; for(i = 0; i < 10; i++) s % bookmark[i]; diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index 010bb85f3..28aaa5d88 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -36,6 +36,7 @@ void Ide::RunArgs() { dlg.consolemode = consolemode; dlg.utf8 <<= console_utf8; dlg.runmode <<= dlg.Breaker(222); + dlg.disable_uhd <<= disable_uhd; for(;;) { bool b = ~dlg.runmode == RUN_FILE; @@ -53,6 +54,7 @@ void Ide::RunArgs() { consolemode = dlg.consolemode; console_utf8 = ~dlg.utf8; stdout_file = ~dlg.stdout_file; + disable_uhd = ~dlg.disable_uhd; dlg.arg.AddHistory(); { StringStream ss; @@ -74,7 +76,7 @@ void Ide::RunArgs() { One Ide::CreateHostRunDir() { - One h = CreateHost(false); + One h = CreateHost(false, disable_uhd); if(IsNull(rundir)) h->ChDir(GetFileFolder(target)); else @@ -212,7 +214,7 @@ void Ide::ExecuteApk() if(!select.GetDeviceCount()) return; - One host = CreateHost(false); + One host = CreateHost(false, disable_uhd); Apk apk(target, sdk); String packageName = apk.FindPackageName(); String activityName = apk.FindLaunchableActivity(); @@ -401,7 +403,7 @@ void Ide::ConditionalBreak() brk = "1"; Index cfg = PackageConfig(IdeWorkspace(), 0, GetMethodVars(method), mainconfigparam, - *CreateHost(true), *CreateBuilder(~CreateHostRunDir())); + *CreateHost(true, disable_uhd), *CreateBuilder(~CreateHostRunDir())); #ifdef PLATFORM_WIN32 if(cfg.Find("MSC") >= 0) { if(EditPDBExpression("Conditional breakpoint", brk, NULL)) diff --git a/uppsrc/ide/Errors.cpp b/uppsrc/ide/Errors.cpp index 385a2003c..e86cca8d9 100644 --- a/uppsrc/ide/Errors.cpp +++ b/uppsrc/ide/Errors.cpp @@ -208,7 +208,7 @@ void Ide::FindPrevError() { return; int ln = console.GetLine(console.GetCursor()); int l = ln; - One host = CreateHost(false); + One host = CreateHost(false, disable_uhd); for(l = ln - 2; l >= 0; l--) if(FindLineError(l)) return; for(l = console.GetLineCount() - 1; l > ln; l--) diff --git a/uppsrc/ide/OutputMode.cpp b/uppsrc/ide/OutputMode.cpp index 931f2df52..f7117b407 100644 --- a/uppsrc/ide/OutputMode.cpp +++ b/uppsrc/ide/OutputMode.cpp @@ -314,7 +314,7 @@ void OutMode::CmdOptions() PromptOK("Invalid build method"); return; } - One host = ide.CreateHost(false); + One host = ide.CreateHost(false, false); One b = ide.CreateBuilder(~host); const String& p = wspc[pi]; String output = NativePath(ide.OutDir(ide.PackageConfig(wspc, pi, bm, ~config, *host, *b), p, bm, true)); diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index f83bfcea2..7d537ba3e 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -545,6 +545,7 @@ public: bool runexternal; bool console_utf8; int consolemode; + bool disable_uhd; String stdout_file; String recent_stdout_file; diff --git a/uppsrc/ide/ide.lay b/uppsrc/ide/ide.lay index 3e2bb9c33..fdafc8e24 100644 --- a/uppsrc/ide/ide.lay +++ b/uppsrc/ide/ide.lay @@ -56,7 +56,8 @@ LAYOUT(RunLayout, 560, 176) ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(8, 24)) ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(8, 24)) ITEM(Label, console_lable, SetLabel(t_("Open console:")).LeftPosZ(4, 112).TopPosZ(120, 20)) - ITEM(Option, utf8, SetLabel(t_("Output is UTF-8")).LeftPosZ(328, 104).TopPosZ(76, 20)) + ITEM(Option, utf8, SetLabel(t_("Output is UTF-8")).LeftPosZ(320, 104).TopPosZ(76, 20)) + ITEM(Option, disable_uhd, SetLabel(t_("Disable UHD mode")).LeftPosZ(432, 120).TopPosZ(76, 20)) END_LAYOUT LAYOUT(FindInFilesLayout, 568, 152) diff --git a/uppsrc/ide/idetool.cpp b/uppsrc/ide/idetool.cpp index 936882e37..c9400ccd2 100644 --- a/uppsrc/ide/idetool.cpp +++ b/uppsrc/ide/idetool.cpp @@ -552,18 +552,18 @@ void Ide::RemoveDs() void Ide::LaunchAndroidSDKManager(const AndroidSDK& androidSDK) { - One host = CreateHost(false); + One host = CreateHost(false, disable_uhd); IGNORE_RESULT(host->Execute(androidSDK.GetLauchSDKManagerCmd())); } void Ide::LaunchAndroidAVDManager(const AndroidSDK& androidSDK) { - One host = CreateHost(false); + One host = CreateHost(false, disable_uhd); IGNORE_RESULT(host->Execute(androidSDK.GetLauchAVDManagerCmd())); } void Ide::LauchAndroidDeviceMonitor(const AndroidSDK& androidSDK) { - One host = CreateHost(false); + One host = CreateHost(false, disable_uhd); IGNORE_RESULT(host->Execute(androidSDK.MonitorPath())); }