Skip to content

Commit

Permalink
Merge pull request #1849 from codefori/feature/deleteHotkey
Browse files Browse the repository at this point in the history
Add support for delete hotkey and multiple deletes in browsers
  • Loading branch information
sebjulliand authored Feb 27, 2024
2 parents 6a0ca29 + 5c8f587 commit 176b9ea
Show file tree
Hide file tree
Showing 8 changed files with 451 additions and 348 deletions.
74 changes: 34 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1229,13 +1229,6 @@
"category": "IBM i",
"icon": "$(files)"
},
{
"command": "code-for-ibmi.deleteMember",
"enablement": "code-for-ibmi:connected",
"title": "Delete...",
"category": "IBM i",
"icon": "$(symbol-file)"
},
{
"command": "code-for-ibmi.updateMemberText",
"enablement": "code-for-ibmi:connected",
Expand Down Expand Up @@ -1440,7 +1433,7 @@
"icon": "$(filter)"
},
{
"command": "code-for-ibmi.deleteFilter",
"command": "code-for-ibmi.objectBrowser.delete",
"enablement": "code-for-ibmi:connected",
"title": "Delete...",
"category": "IBM i",
Expand Down Expand Up @@ -1528,13 +1521,6 @@
"category": "IBM i",
"icon": "$(symbol-file)"
},
{
"command": "code-for-ibmi.deleteObject",
"enablement": "code-for-ibmi:connected",
"title": "Delete...",
"category": "IBM i",
"icon": "$(symbol-file)"
},
{
"command": "code-for-ibmi.renameObject",
"enablement": "code-for-ibmi:connected",
Expand Down Expand Up @@ -1660,6 +1646,21 @@
"key": "ctrl+r",
"mac": "cmd+r",
"when": "editorLangId == cl"
},
{
"command": "code-for-ibmi.deleteConnection",
"key": "delete",
"when": "focusedView === connectionBrowser && listHasSelectionOrFocus"
},
{
"command": "code-for-ibmi.deleteIFS",
"key": "delete",
"when": "focusedView === ifsBrowser && listHasSelectionOrFocus"
},
{
"command": "code-for-ibmi.objectBrowser.delete",
"key": "delete",
"when": "focusedView === objectBrowser && listHasSelectionOrFocus"
}
],
"viewsContainers": {
Expand Down Expand Up @@ -1914,10 +1915,6 @@
"command": "code-for-ibmi.moveFilterToBottom",
"when": "never"
},
{
"command": "code-for-ibmi.deleteFilter",
"when": "never"
},
{
"command": "code-for-ibmi.createMember",
"when": "never"
Expand All @@ -1926,10 +1923,6 @@
"command": "code-for-ibmi.copyMember",
"when": "never"
},
{
"command": "code-for-ibmi.deleteMember",
"when": "never"
},
{
"command": "code-for-ibmi.updateMemberText",
"when": "never"
Expand Down Expand Up @@ -1958,10 +1951,6 @@
"command": "code-for-ibmi.copyObject",
"when": "never"
},
{
"command": "code-for-ibmi.deleteObject",
"when": "never"
},
{
"command": "code-for-ibmi.renameObject",
"when": "never"
Expand Down Expand Up @@ -2175,7 +2164,7 @@
"view/item/context": [
{
"command": "code-for-ibmi.renameConnection",
"when": "view == connectionBrowser && viewItem == server",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "2_delete@1"
},
{
Expand All @@ -2185,22 +2174,22 @@
},
{
"command": "code-for-ibmi.showAdditionalSettings",
"when": "view == connectionBrowser && viewItem == server",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "1_manage@1"
},
{
"command": "code-for-ibmi.showLoginSettings",
"when": "view == connectionBrowser && viewItem == server",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "1_manage@2"
},
{
"command": "code-for-ibmi.connectTo",
"when": "view == connectionBrowser && viewItem == server",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "inline"
},
{
"command": "code-for-ibmi.connectToAndReload",
"when": "view == connectionBrowser && viewItem == server",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "3_connect@1"
},
{
Expand Down Expand Up @@ -2279,7 +2268,7 @@
"group": "4_filters@2"
},
{
"command": "code-for-ibmi.deleteFilter",
"command": "code-for-ibmi.objectBrowser.delete",
"when": "view == objectBrowser && viewItem =~ /^filter.*$/",
"group": "4_filters@3"
},
Expand Down Expand Up @@ -2323,10 +2312,15 @@
"when": "view == objectBrowser && viewItem =~ /^SPF.*$/",
"group": "4_sourceFileStuff@1"
},
{
"command": "code-for-ibmi.objectBrowser.delete",
"when": "view == objectBrowser && viewItem == SPF",
"group": "5_sourceFileStuff@1"
},
{
"submenu": "code-for-ibmi.sortMembers",
"when": "view == objectBrowser && (viewItem =~ /^SPF/ || viewItem =~ /^member/)",
"group": "5_sourceFileStuff@1"
"group": "6_sourceFileStuff@1"
},
{
"submenu": "code-for-ibmi.openMember",
Expand Down Expand Up @@ -2354,7 +2348,7 @@
"group": "2_memberStuff@2"
},
{
"command": "code-for-ibmi.deleteMember",
"command": "code-for-ibmi.objectBrowser.delete",
"when": "view == objectBrowser && viewItem == member",
"group": "2_memberStuff@4"
},
Expand Down Expand Up @@ -2524,18 +2518,18 @@
"group": "1_objActions@2"
},
{
"command": "code-for-ibmi.deleteObject",
"when": "view == objectBrowser && (viewItem =~ /^object/ || viewItem == SPF)",
"command": "code-for-ibmi.objectBrowser.delete",
"when": "view == objectBrowser && viewItem =~ /^object/",
"group": "1_objActions@5"
},
{
"command": "code-for-ibmi.renameObject",
"when": "view == objectBrowser && (viewItem =~ /^object/ || viewItem == SPF)",
"when": "view == objectBrowser && viewItem =~ /^object/",
"group": "1_objActions@3"
},
{
"command": "code-for-ibmi.moveObject",
"when": "view == objectBrowser && (viewItem =~ /^object(?!.lib)/ || viewItem == SPF)",
"when": "view == objectBrowser && viewItem =~ /^object(?!.lib)/",
"group": "1_objActions@4"
},
{
Expand Down Expand Up @@ -2607,4 +2601,4 @@
"HalcyonTechLtd.vscode-ibmi-walkthroughs",
"vscode.git"
]
}
}
13 changes: 6 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import { updateLocale } from "./locale";
import * as Sandbox from "./sandbox";
import { initialise } from "./testing";
import { CodeForIBMi, ConnectionData } from "./typings";
import { ObjectBrowserProvider } from "./views/ConnectionBrowser";
import { initializeConnectionBrowser } from "./views/ConnectionBrowser";
import { LibraryListProvider } from "./views/LibraryListView";
import { ProfilesView } from "./views/ProfilesView";
import { HelpView } from "./views/helpView";
import { initializeIFSBrowser } from "./views/ifsBrowser";
import { initializeObjectBrowser } from "./views/objectBrowser";
import { SettingsUI } from "./webviews/settings";

export async function activate(context: ExtensionContext): Promise<CodeForIBMi> {
// Use the console to output diagnostic information (console.log) and errors (console.error)
Expand All @@ -41,15 +42,13 @@ export async function activate(context: ExtensionContext): Promise<CodeForIBMi>
GlobalStorage.get().setLastConnections(lastConnections);
commands.executeCommand(`setContext`, `code-for-ibmi:hasPreviousConnection`, lastConnections.length > 0);
};


SettingsUI.init(context);
initializeConnectionBrowser(context);
initializeObjectBrowser(context)
initializeIFSBrowser(context);

context.subscriptions.push(
window.registerTreeDataProvider(
`connectionBrowser`,
new ObjectBrowserProvider(context)
),
context.subscriptions.push(
window.registerTreeDataProvider(
`helpView`,
new HelpView()
Expand Down
12 changes: 5 additions & 7 deletions src/locale/ids/da.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const da: Locale = {
'connectionBrowser.renameConnection.noConnParmsFound': `Ingen parametre til forbindelsen '{0}' blev fundet`,
'connectionBrowser.renameConnection.error': `Fejl ved omdøbning af forbindelsen '{0}'! {1}`,
'connectionBrowser.deleteConnection.warning': `Er du sikker på at du vil slette forbindelsen '{0}'?`,
'connectionBrowser.deleteConnection.multiple.warning': `Er du sikker på at du vil slette disse {0} forbindelser?`,
'connectionBrowser.ServerItem.tooltip': ` (forrige forbindelse)`,
'connectionBrowser.ServerItem.title': `Forbind`,
// helpView:
Expand Down Expand Up @@ -96,7 +97,7 @@ export const da: Locale = {
'ifsBrowser.deleteIFS.multi.warningMessage': `Er du sikker på at du vil slette de {0} valgte filer?`,
'ifsBrowser.deleteIFS.deletionPrompt': `Når du har slettet mappen, kan den ikke retableres.\nVenligst tast \"{0}\" for at bekræfte sletning.`,
'ifsBrowser.deleteIFS.deletionPrompt2': ` (Tryk \'Escape\' for at afbryde)`,
'ifsBrowser.deleteIFS.infoMessage': `Slettede {0}.`,
'ifsBrowser.deleteIFS.progress': `Sletning af {0} element(er)...`,
'ifsBrowser.deleteIFS.errorMessage': `Fejl ved sletning af streamfile! {0}`,
'ifsBrowser.deleteIFS.cancelled': `Sletning afbrudt.`,
'ifsBrowser.deleteIFS.default.home.dir':'{0} var den aktuelle mappe; det er nu {1}.',
Expand Down Expand Up @@ -143,7 +144,9 @@ export const da: Locale = {
'LibraryListView.cleanupLibraryList.removedLibs': `De følgende biblioteker blev fjernet fra den opdaterede biblioteksliste, da de ikke er gyldige: {0}`,
'LibraryListView.cleanupLibraryList.validated': `Bibliotekslisten blev valideret uden fejl.`,
// objectBrowser:
'objectBrowser.deleteFilter.infoMessage': `Slet filter '{0}'?`,
'objectBrowser.delete.confirm':'Er du sikker på at du vil slette {0}?',
'objectBrowser.delete.multiple.confirm':'Er du sikker på at du vil slette de {0} valgte elementer?',
'objectBrowser.delete.progress':'Sletter',
'objectBrowser.createMember.prompt': `Navn på nyt member (member.ext)`,
'objectBrowser.createMember.progressTitle': `Opretter member {0}...`,
'objectBrowser.createMember.errorMessage': `Fejl ved oprettelse af member {0}: {1}`,
Expand All @@ -153,8 +156,6 @@ export const da: Locale = {
'objectBrowser.copyMember.overwrite': `Vil du overskrive member {0}?`,
'objectBrowser.copyMember.errorMessage2': `Member {0} eksisterer allerede!`,
'objectBrowser.copyMember.errorMessage3': `Fejl ved oprettelse af member {0}: {1}`,
'objectBrowser.deleteMember.warningMessage': `Er du sikker på at du vil slette member {0}?`,
'objectBrowser.deleteMember.infoMessage': `Slettede member {0}.`,
'objectBrowser.deleteMember.errorMessage': `Fejl ved sletning af member! {0}`,
'objectBrowser.updateMemberText.prompt': `Opdater beskrivelse af member {0}, *BLANK for ingen beskrivelse`,
'objectBrowser.updateMemberText.errorMessage': `Fejl ved ændring af member beskrivelse! {0}`,
Expand Down Expand Up @@ -194,10 +195,7 @@ export const da: Locale = {
'objectBrowser.copyObject.infoMessage': `Kopierede objekt {0} {1} til {2}.`,
'objectBrowser.copyObject.infoMessage2': `Kopierede objekt {0} {1} til {2}. Opfrisk object browser.`,
'objectBrowser.copyObject.errorMessage4': `Fejl ved kopiering af objekt {0}! {1}`,
'objectBrowser.deleteObject.warningMessage': `Er du sikker på at du vil slette {0} {1}?`,
'objectBrowser.deleteObject.infoMessage': `Slettede {0} {1}.`,
'objectBrowser.deleteObject.errorMessage': `Fejl ved sletning af objekt! {0}`,
'objectBrowser.deleteObject.progress':'Sletter objekt {0} {1}...',
'objectBrowser.renameObject.prompt': `Omdøb objekt`,
'objectBrowser.renameObject.errorMessage': `Objektnavn må være 10 tegn eller mindre.`,
'objectBrowser.renameObject.infoMessage': `Omdøbte objekt {0} {1} til {2}.`,
Expand Down
12 changes: 5 additions & 7 deletions src/locale/ids/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const en: Locale = {
'connectionBrowser.renameConnection.noConnParmsFound': `No parameters for connection '{0}' was found`,
'connectionBrowser.renameConnection.error': `Error renaming connection '{0}'! {1}`,
'connectionBrowser.deleteConnection.warning': `Are you sure you want to delete the connection '{0}'?`,
'connectionBrowser.deleteConnection.multiple.warning': `Are you sure you want to delete these {0} connections?`,
'connectionBrowser.ServerItem.tooltip': ` (previous connection)`,
'connectionBrowser.ServerItem.title': `Connect`,
// helpView:
Expand Down Expand Up @@ -96,7 +97,7 @@ export const en: Locale = {
'ifsBrowser.deleteIFS.multi.warningMessage': `Are you sure you want to delete the {0} selected files?`,
'ifsBrowser.deleteIFS.deletionPrompt': `Once you delete the directory, it cannot be restored.\nPlease type \"{0}\" to confirm deletion.`,
'ifsBrowser.deleteIFS.deletionPrompt2': ` (Press \'Escape\' to cancel)`,
'ifsBrowser.deleteIFS.infoMessage': `Deleted {0}.`,
'ifsBrowser.deleteIFS.progress': `Deleting {0} element(s)...`,
'ifsBrowser.deleteIFS.errorMessage': `Error deleting streamfile! {0}`,
'ifsBrowser.deleteIFS.cancelled': `Deletion canceled.`,
'ifsBrowser.deleteIFS.default.home.dir':'{0} was the working directory; it is now {1}.',
Expand Down Expand Up @@ -143,7 +144,9 @@ export const en: Locale = {
'LibraryListView.cleanupLibraryList.removedLibs': `The following libraries were removed from the updated library list as they are invalid: {0}`,
'LibraryListView.cleanupLibraryList.validated': `Library list were validated without any errors.`,
// objectBrowser:
'objectBrowser.deleteFilter.infoMessage': `Delete filter '{0}'?`,
'objectBrowser.delete.confirm':'Are you sure you want to delete {0}?',
'objectBrowser.delete.multiple.confirm':'Are you sure you want to delete these {0} elements?',
'objectBrowser.delete.progress':'Deleting',
'objectBrowser.createMember.prompt': `Name of new source member (member.ext)`,
'objectBrowser.createMember.progressTitle': `Creating member {0}...`,
'objectBrowser.createMember.errorMessage': `Error creating member {0}: {1}`,
Expand All @@ -153,8 +156,6 @@ export const en: Locale = {
'objectBrowser.copyMember.overwrite': `Are you sure you want overwrite member {0}?`,
'objectBrowser.copyMember.errorMessage2': `Member {0} already exists!`,
'objectBrowser.copyMember.errorMessage3': `Error creating member {0}: {1}`,
'objectBrowser.deleteMember.warningMessage': `Are you sure you want to delete {0}?`,
'objectBrowser.deleteMember.infoMessage': `Deleted {0}.`,
'objectBrowser.deleteMember.errorMessage': `Error deleting member! {0}`,
'objectBrowser.updateMemberText.prompt': `Change member description for {0}, *BLANK for no description`,
'objectBrowser.updateMemberText.errorMessage': `Error changing member description! {0}`,
Expand Down Expand Up @@ -194,10 +195,7 @@ export const en: Locale = {
'objectBrowser.copyObject.infoMessage': `Copied object {0} {1} to {2}.`,
'objectBrowser.copyObject.infoMessage2': `Copied object {0} {1} to {2}. Refresh object browser.`,
'objectBrowser.copyObject.errorMessage4': `Error copying object {0}! {1}`,
'objectBrowser.deleteObject.warningMessage': `Are you sure you want to delete {0} {1}?`,
'objectBrowser.deleteObject.infoMessage': `Deleted {0} {1}.`,
'objectBrowser.deleteObject.errorMessage': `Error deleting object! {0}`,
'objectBrowser.deleteObject.progress':'Deleting object {0} {1}...',
'objectBrowser.renameObject.prompt': `Rename object`,
'objectBrowser.renameObject.errorMessage': `Object name must be 10 chars or less.`,
'objectBrowser.renameObject.infoMessage': `Renamed object {0} {1} to {2}.`,
Expand Down
12 changes: 5 additions & 7 deletions src/locale/ids/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const fr: Locale = {
'connectionBrowser.renameConnection.noConnParmsFound': `Aucun paramètre pour la connexion '{0}' n'a été trouvé`,
'connectionBrowser.renameConnection.error': `Erreur lors du renommage de la connexion '{0}'! {1}`,
'connectionBrowser.deleteConnection.warning': `Êtes vous sûr de vouloir supprimer la connexion '{0}'?`,
'connectionBrowser.deleteConnection.multiple.warning': `Êtes vous sûr de vouloir supprimer ces {0} connexions?`,
'connectionBrowser.ServerItem.tooltip': ` (précédente connexion)`,
'connectionBrowser.ServerItem.title': `Se Connecter`,
// helpView:
Expand Down Expand Up @@ -96,7 +97,7 @@ export const fr: Locale = {
'ifsBrowser.deleteIFS.multi.warningMessage': `Êtes-vous sûr de vouloir suprimer les {0} fichiers sélectionnés?`,
'ifsBrowser.deleteIFS.deletionPrompt': `La suppression du répertoire est irréversible!\nEntrez \"{0}\" pour confirmer la suppression.`,
'ifsBrowser.deleteIFS.deletionPrompt2': ` (Appuyer sur \'Escape\' pour annuler)`,
'ifsBrowser.deleteIFS.infoMessage': `{0} supprimé.`,
'ifsBrowser.deleteIFS.progress': `Suppression de {0} élément(s)...`,
'ifsBrowser.deleteIFS.errorMessage': `Erreur lors de la suppression du fichier! {0}`,
'ifsBrowser.deleteIFS.cancelled': `Suppression annulée.`,
'ifsBrowser.deleteIFS.default.home.dir':'{0} était le répertoire de travail; c\'est désormais {1}.',
Expand Down Expand Up @@ -143,7 +144,9 @@ export const fr: Locale = {
'LibraryListView.cleanupLibraryList.removedLibs': `Les bibliothèques suivantes ont été retirées de la liste des bibliothèques mise à jour car elles sont invalides: {0}`,
'LibraryListView.cleanupLibraryList.validated': `La liste des bibliothèques a été validée avec succès.`,
// objectBrowser:
'objectBrowser.deleteFilter.infoMessage': `Supprimer le filtre '{0}'?`,
'objectBrowser.delete.confirm':'Êtes-vous sûr de vouloir supprimer {0}?',
'objectBrowser.delete.multiple.confirm':'Êtes-vous sûr de vouloir supprimer les {0} éléments sélectionnés?',
'objectBrowser.delete.progress':'Suppression',
'objectBrowser.createMember.prompt': `Nom du nouveau membre source (membre.ext)`,
'objectBrowser.createMember.progressTitle': `Creation du membre {0}...`,
'objectBrowser.createMember.errorMessage': `Erreur lors de la creation du membre {0}: {1}`,
Expand All @@ -153,8 +156,6 @@ export const fr: Locale = {
'objectBrowser.copyMember.overwrite': `Êtes-vous sûr de vouloir écraser le membre {0}?`,
'objectBrowser.copyMember.errorMessage2': `Le membre {0} existe déjà!`,
'objectBrowser.copyMember.errorMessage3': `Erreur lors de la création du membre {0}: {1}`,
'objectBrowser.deleteMember.warningMessage': `Êtes-vous sûr de vouloir supprimer {0}?`,
'objectBrowser.deleteMember.infoMessage': `Membre {0} supprimé.`,
'objectBrowser.deleteMember.errorMessage': `Erreur lors de la suppression du membre! {0}`,
'objectBrowser.updateMemberText.prompt': `Changer la description du membre {0}, *BLANK pour effacer la description`,
'objectBrowser.updateMemberText.errorMessage': `Erreur lors de la mise à jour du texte du membre! {0}`,
Expand Down Expand Up @@ -194,10 +195,7 @@ export const fr: Locale = {
'objectBrowser.copyObject.infoMessage': `Objet {0} {1} copié vers {2}.`,
'objectBrowser.copyObject.infoMessage2': `Objet {0} {1} copié vers {2}. Rafraîchissement de l'explorateur d'objet.`,
'objectBrowser.copyObject.errorMessage4': `Erreur lors de la copie de l'objet {0}! {1}`,
'objectBrowser.deleteObject.warningMessage': `Êtes-vous sûr de vouloir supprimer {0} {1}?`,
'objectBrowser.deleteObject.infoMessage': `{0} {1} supprimé.`,
'objectBrowser.deleteObject.errorMessage': `Erreur lors de la suppression de l'objet! {0}`,
'objectBrowser.deleteObject.progress':`Suppression de l'objet {0} {1}...`,
'objectBrowser.renameObject.prompt': `Renamer l'objet`,
'objectBrowser.renameObject.errorMessage': `Le nom de l'objet doit faire au maximum 10 caractères de long.`,
'objectBrowser.renameObject.infoMessage': `Objet {0} {1} renommé {2}.`,
Expand Down
Loading

0 comments on commit 176b9ea

Please sign in to comment.