Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
switch buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
mkloubert committed Nov 27, 2017
1 parent d70fef9 commit 9b0011c
Show file tree
Hide file tree
Showing 7 changed files with 328 additions and 78 deletions.
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30560,6 +30560,49 @@
"type": "string",
"description": "Switches between targets."
},
"button": {
"description": "Settings for a button for that switch.",
"oneOf": [
{
"type": "boolean",
"description": "Display a button for that switch or not.",
"default": false
},
{
"type": "object",
"description": "The settings for the button.",
"properties": {
"color": {
"type": "string",
"description": "The custom (text) color for the button.",
"default": "#ffffff"
},
"enabled": {
"type": "boolean",
"description": "Enable button or not.",
"default": true
},
"isRight": {
"type": "boolean",
"description": "Set button on the right side or not.",
"default": false
},
"priority": {
"type": "number",
"description": "The custom priority."
},
"text": {
"type": "string",
"description": "The custom text."
},
"tooltip": {
"type": "string",
"description": "The custom tooltip."
}
}
}
]
},
"options": {
"description": "One or more options for the switch.",
"oneOf": [
Expand Down
1 change: 1 addition & 0 deletions src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4184,6 +4184,7 @@ export class Deployer extends Events.EventEmitter implements vscode.Disposable {
.apply(ME, []);
}

deploy_switch.reloadButtons.apply(ME, []);
deploy_switch.printSwitchStates.apply(ME, []);
}
finally {
Expand Down
4 changes: 4 additions & 0 deletions src/i18.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ export interface Translation {
unknownEngine?: string;
},
switch?: {
button?: {
text?: string;
tooltip?: string;
},
defaultName?: string;
defaultOptionName?: string;
description?: string;
Expand Down
4 changes: 4 additions & 0 deletions src/lang/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ export const translation: Translation = {
unknownEngine: 'Unbekannter Typ {0:trim,surround}!',
},
switch: {
button: {
text: 'Schalter {0:trim,surround}',
tooltip: "Aktuelle Option: {0:trim}\n\nHier klicken, um die aktuelle Option zu wechseln...",
},
defaultName: 'Schalter #{0:trim}',
defaultOptionName: 'Schalter-Option #{0:trim}',
description: 'Schaltet zwischen anderen existierenden Zielen um',
Expand Down
4 changes: 4 additions & 0 deletions src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ export const translation: Translation = {
unknownEngine: 'Unknown engine {0:trim,surround}!',
},
switch: {
button: {
text: 'Switch {0:trim,surround}',
tooltip: "Current option: {0:trim}\n\nClick here to change the current option...",
},
defaultName: 'Switch #{0:trim}',
defaultOptionName: 'Switch option #{0:trim}',
description: 'Switches between existing targets',
Expand Down
34 changes: 34 additions & 0 deletions src/plugins/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,44 @@ import * as vscode from 'vscode';
import * as Workflows from 'node-workflows';


/**
* A button for a switch target.
*/
export interface DeploySwitchButton {
/**
* The custom (text) color for the button.
*/
color?: string;
/**
* Enable button or not.
*/
enabled?: boolean;
/**
* Put button on the right side or not.
*/
isRight?: boolean;
/**
* The priority.
*/
priority?: number;
/**
* The custom text.
*/
text?: string;
/**
* The custom tooltip.
*/
tooltip?: string;
}

/**
* A switch target.
*/
export interface DeployTargetSwitch extends deploy_contracts.DeployTarget {
/**
* A button for the switch.
*/
button?: DeploySwitchButton | boolean;
/**
* One or more options for the switch.
*/
Expand Down
Loading

0 comments on commit 9b0011c

Please sign in to comment.