Skip to content

Commit

Permalink
Use Qt Widget Designer Name
Browse files Browse the repository at this point in the history
Change-Id: I6ef1b62e71927ced3c0be3af158f69d5b8ebc825
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
OrkunTokdemir committed Apr 12, 2024
1 parent 1f76f15 commit 2533b7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@
"description": "Do not ask for default Qt folder",
"scope": "machine"
},
"vscode-qt-tools.customUiDesignerExePath": {
"vscode-qt-tools.customWidgetDesignerExePath": {
"type": "string",
"default": "",
"description": "Specify the custom Qt Designer executable path",
"description": "Specify the custom Qt Widget Designer executable path",
"scope": "machine-overridable"
}
}
Expand Down
30 changes: 16 additions & 14 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,34 @@ export class Project {
this._designerServer.getPort()
);
}
const customUiDesignerExePath = vscode.workspace
const customWidgetDesignerExePath = vscode.workspace
.getConfiguration('vscode-qt-tools', this._folder)
.get<string>('customUiDesignerExePath');
if (customUiDesignerExePath) {
if (this.checkCustomDesignerExePath(customUiDesignerExePath)) {
.get<string>('customWidgetDesignerExePath');
if (customWidgetDesignerExePath) {
if (this.checkCustomDesignerExePath(customWidgetDesignerExePath)) {
this._designerClient = new DesignerClient(
customUiDesignerExePath,
customWidgetDesignerExePath,
this._designerServer.getPort()
);
}
}
vscode.workspace.onDidChangeConfiguration(async (event) => {
if (
event.affectsConfiguration(
'vscode-qt-tools.customUiDesignerExePath',
'vscode-qt-tools.customWidgetDesignerExePath',
this._folder
)
) {
const customUiDesignerExePathConfig = vscode.workspace
const customWidgetDesignerExePathConfig = vscode.workspace
.getConfiguration('vscode-qt-tools', this._folder)
.get<string>('customUiDesignerExePath');
.get<string>('customWidgetDesignerExePath');
if (
customUiDesignerExePathConfig &&
this.checkCustomDesignerExePath(customUiDesignerExePathConfig)
customWidgetDesignerExePathConfig &&
this.checkCustomDesignerExePath(customWidgetDesignerExePathConfig)
) {
this._designerClient?.detach();
this._designerClient = new DesignerClient(
customUiDesignerExePathConfig,
customWidgetDesignerExePathConfig,
this._designerServer.getPort()
);
} else {
Expand Down Expand Up @@ -100,10 +100,12 @@ export class Project {
return this._folder;
}

private checkCustomDesignerExePath(customUiDesignerExePath: string) {
if (!fs.existsSync(customUiDesignerExePath)) {
private checkCustomDesignerExePath(customWidgetDesignerExePath: string) {
if (!fs.existsSync(customWidgetDesignerExePath)) {
void vscode.window.showWarningMessage(
'Qt Designer executable not found at:"' + customUiDesignerExePath + '"'
'Qt Designer executable not found at:"' +
customWidgetDesignerExePath +
'"'
);
return false;
}
Expand Down

0 comments on commit 2533b7a

Please sign in to comment.