Skip to content

Commit

Permalink
Webview optimizations for Import
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
  • Loading branch information
paulober committed Sep 11, 2024
1 parent b122586 commit ca92b29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/pico_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def GDB_NAME():
"// UART defines",
"// By default the stdout UART is `uart0`, so we will use the second one",
"#define UART_ID uart1",
"#define BAUD_RATE 9600", "",
"#define BAUD_RATE 115200", "",
"// Use pins 4 and 5 for UART1",
"// Pins can be changed, see the GPIO function select table in the datasheet for information on GPIO assignments",
"#define UART_TX_PIN 4",
Expand Down
12 changes: 8 additions & 4 deletions src/webview/newProjectPanel.mts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@ export class NewProjectPanel {
this._isProjectImport = isProjectImport;
// set local property as it's an indicator for initial projectRoot update
// later during webview initialization
projectUri = projectUri ?? this._settings.getLastProjectRoot();
projectUri =
projectUri ??
(isProjectImport ? undefined : this._settings.getLastProjectRoot());
this._projectRoot = projectUri;
this._isCreateFromExampleOnly = createFromExample;

Expand Down Expand Up @@ -528,7 +530,9 @@ export class NewProjectPanel {
this._projectRoot.fsPath === ""
) {
void window.showErrorMessage(
"No project root selected. Please select a project root."
this._isProjectImport
? "No project to import selected. Please select a project folder."
: "No project root selected. Please select a project root."
);
await this._panel.webview.postMessage({
command: "submitDenied",
Expand Down Expand Up @@ -1670,10 +1674,10 @@ export class NewProjectPanel {
!this._isProjectImport
? isWindows
? "C:\\MyProject"
: "/home/user/MyProject"
: "/home/user/myproject"
: isWindows
? "C:\\Project\\To\\Import"
: "/home/user/Project/To/Import"
: "/project/to/import"
}" disabled value="${
// support folder names with backslashes on linux and macOS
this._projectRoot !== undefined
Expand Down

0 comments on commit ca92b29

Please sign in to comment.