Skip to content

Commit

Permalink
Reverting all UI changes
Browse files Browse the repository at this point in the history
Use CMake Bin Path for building
  • Loading branch information
radurentea committed May 2, 2024
1 parent 0ccb9e5 commit 3bd570b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 85 deletions.
3 changes: 1 addition & 2 deletions src/build/buildTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ export class BuildTask {
compilerArgs.push("-DCCACHE_ENABLE=1");
}
}
const cmakeCommand = "cmake";
const compileExecution = new vscode.ProcessExecution(cmakeCommand, compilerArgs, this.processOptions);
const compileExecution = new vscode.ProcessExecution(canAccessCMake, compilerArgs, this.processOptions);
const compilePresentationOptions = {
reveal: showTaskOutput,
showReuseMessage: false,
Expand Down
8 changes: 2 additions & 6 deletions src/views/setup/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const isLinuxPlatform = computed(() => {
const openOCDRulesPathText = computed(() => {
return openOCDRulesPath.value !== ""
? `sudo cp -n "${openOCDRulesPath.value}" /etc/udev/rules.d`
? `sudo cp -n ${openOCDRulesPath.value} /etc/udev/rules.d`
: "";
});
</script>
Expand Down Expand Up @@ -66,7 +66,7 @@ const openOCDRulesPathText = computed(() => {
</p>
<p>Run this command in a terminal with sudo privileges:</p>
</div>
<div class="notification keep-spaces" v-if="openOCDRulesPathText">
<div class="notification" v-if="openOCDRulesPathText">
{{ openOCDRulesPathText }}
</div>
</div>
Expand Down Expand Up @@ -118,8 +118,4 @@ const openOCDRulesPathText = computed(() => {
.span-path {
color: var(--vscode-button-hoverBackground);
}
.keep-spaces {
white-space: pre-wrap;
}
</style>
20 changes: 1 addition & 19 deletions src/views/setup/ExistingSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ const setupMode = computed(() => {
return SetupMode;
});
const isVersionLowerThan5 = (version: string): boolean => {
if (!version) return false;
const versionParts = version.split(".");
const majorVersion = Number(versionParts[0]);
return majorVersion < 5;
};
function goTo(route: string, setupMode: SetupMode) {
router.push(route);
store.setupMode = setupMode;
Expand Down Expand Up @@ -60,19 +53,8 @@ function goTo(route: string, setupMode: SetupMode) {
<p>Python path: {{ prevSetup.python }}</p>
<p>IDF Tools path: {{ prevSetup.toolsPath }}</p>
<p>Git path: {{ prevSetup.gitPath }}</p>
<p v-if="isVersionLowerThan5(prevSetup.version)" class="warning-text">
Whitespaces in project, ESP-IDF and ESP Tools paths are not supported
in versions lower than 5.0
</p>
</div>
</div>
</div>
</template>
./types

<style scoped>
.warning-text {
color: var(--vscode-editorWarning-foreground);
font-size: small;
}
</style>
./types
67 changes: 10 additions & 57 deletions src/views/setup/Install.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,14 @@ import { IconClose } from "@iconify-prerendered/vue-codicon";
const store = useSetupStore();
const {
espIdfErrorStatus,
gitVersion,
pathSep,
pyExecErrorStatus,
toolsFolder,
setupMode,
selectedEspIdfVersion,
espIdf,
espIdfContainer,
} = storeToRefs(store);
const errMsgIdf =
"The ESP IDF folder path cannot contain spaces for ESP-IDF version lower than 5.0";
const errMsgTools =
"The ESP Tools folder path cannot contain spaces for ESP-IDF version lower than 5.0";
const isNotWinPlatform = computed(() => {
return pathSep.value.indexOf("/") !== -1;
});
Expand All @@ -34,43 +27,9 @@ const actionButtonText = computed(() => {
return setupMode.value === SetupMode.advanced ? "Configure Tools" : "Install";
});
const isVersionLowerThan5 = computed(() => {
const version = selectedEspIdfVersion.value.version;
if (version) {
const match = version.match(/v(\d+(\.\d+)?(\.\d+)?)/);
if (match) {
const versionNumber = parseFloat(match[1]);
return versionNumber < 5;
}
}
return false;
});
const whiteSpaceNotSupportedIdf = computed(() => {
if (isVersionLowerThan5.value) {
if (selectedEspIdfVersion.value.filename === "manual") {
return espIdf.value.includes(" ");
}
if (selectedEspIdfVersion.value.filename !== "manual") {
return espIdfContainer.value.includes(" ");
}
}
});
const whiteSpaceNotSupportedTools = computed(() => {
if (isVersionLowerThan5.value) {
return toolsFolder.value.includes(" ");
}
});
const buttonTooltip = computed(() => {
if (whiteSpaceNotSupportedIdf.value) {
return errMsgIdf;
} else if (whiteSpaceNotSupportedTools.value) {
return errMsgTools;
}
return ""; // No tooltip when the button is not disabled
});
function setEspIdfErrorStatus() {
store.espIdfErrorStatus = "";
}
function setPyExecErrorStatus() {
store.pyExecErrorStatus = "";
Expand All @@ -94,9 +53,12 @@ function setToolsFolder(newToolsPath: string) {

<div
class="notification is-danger error-message"
v-if="whiteSpaceNotSupportedIdf"
v-if="espIdfErrorStatus"
>
<span>{{ errMsgIdf }}</span>
<p>{{ espIdfErrorStatus }}</p>
<div class="icon is-large is-size-4" @click="setEspIdfErrorStatus">
<IconClose />
</div>
</div>

<folderOpen
Expand All @@ -106,13 +68,6 @@ function setToolsFolder(newToolsPath: string) {
:openMethod="store.openEspIdfToolsFolder"
/>

<div
class="notification is-danger error-message"
v-if="whiteSpaceNotSupportedTools"
>
<span>{{ errMsgTools }}</span>
</div>

<selectPyVersion v-if="isNotWinPlatform"></selectPyVersion>

<div
Expand All @@ -131,8 +86,6 @@ function setToolsFolder(newToolsPath: string) {
@click="store.installEspIdf"
class="button"
data-config-id="start-install-btn"
:disabled="whiteSpaceNotSupportedIdf || whiteSpaceNotSupportedTools"
:title="buttonTooltip"
>
{{ actionButtonText }}
</button>
Expand All @@ -150,7 +103,7 @@ function setToolsFolder(newToolsPath: string) {
.error-message {
padding: 0.5em;
margin: 0.5em;
display: inline-block;
display: flex;
justify-content: space-between;
align-items: center;
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/setup/components/folderOpen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function onKeyEnter() {
</script>

<template>
<div>
<div class="field">
<label class="label">{{ propLabel }}</label>
<div class="field has-addons align-center">
<div class="control expanded">
Expand Down

0 comments on commit 3bd570b

Please sign in to comment.