diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index dd5f1d85..24187630 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -82,7 +82,11 @@ "Screen share dialog description": "This application requires permission to record the screen.\n\nClick 'Open Settings' and then select 'Privacy & Security' then 'Screen & System Audio Recording' from the list and enable the permission for 'NethLink'.", "Cancel button": "Cancel", "Open settings button": "Open Settings", - "Shortcut": "Define a keyboard shortcut" + "Shortcut": "Define a keyboard shortcut", + "PlusOther_one": "+ {{count}} other", + "PlusOther_other": "+ {{count}} others", + "Copy": "Copy", + "Copied": "Copied" }, "Login": { "Welcome": "Welcome", diff --git a/public/locales/it/translations.json b/public/locales/it/translations.json index e8807552..c4644779 100644 --- a/public/locales/it/translations.json +++ b/public/locales/it/translations.json @@ -82,7 +82,11 @@ "Screen share dialog description": "Questa applicazione richiede il permesso di registrare lo schermo.\n\nClicca su 'Apri Impostazioni', poi seleziona 'Privacy & Sicurezza' poi 'Registrazione Schermo e Audio di Sistema' dalla lista e abilita il permesso per 'NethLink'.", "Cancel button": "Annulla", "Open settings button": "Apri Impostazioni", - "Shortcut": "Scegli una combinazione di tasti" + "Shortcut": "Scegli una combinazione di tasti", + "PlusOther_one": "+ {{count}} altro", + "PlusOther_other": "+ {{count}} altri", + "Copy": "Copia", + "Copied": "Copiato" }, "Login": { "Welcome": "Benvenuto", diff --git a/src/main/lib/ipcEvents.ts b/src/main/lib/ipcEvents.ts index 09d59d14..a1375c41 100644 --- a/src/main/lib/ipcEvents.ts +++ b/src/main/lib/ipcEvents.ts @@ -9,7 +9,7 @@ import { Log } from '@shared/utils/logger' import { NethLinkController } from '@/classes/controllers/NethLinkController' import { AppController } from '@/classes/controllers/AppController' import { store } from './mainStore' -import { debouncer, getAccountUID, getPageFromQuery } from '@shared/utils/utils' +import { debouncer, getAccountUID, getPageFromQuery, isDev } from '@shared/utils/utils' import { NetworkController } from '@/classes/controllers/NetworkController' import { useLogin } from '@shared/useLogin' import { PhoneIslandWindow } from '@/classes/windows' @@ -212,8 +212,17 @@ export function registerIpcEvents() { shell.openExternal(join('https://' + account!.host, path)) }) - ipcMain.on(IPC_EVENTS.OPEN_EXTERNAL_PAGE, async (_, path) => { - shell.openExternal(join(path)) + ipcMain.on(IPC_EVENTS.OPEN_EXTERNAL_PAGE, async (event, path) => { + if (isDev()) { + const window = BrowserWindow.fromWebContents(event.sender); + window?.loadURL(join(path)) + } else { + shell.openExternal(join(path)) + } + }) + + ipcMain.on(IPC_EVENTS.COPY_TO_CLIPBOARD, async (_, text) => { + clipboard.writeText(text) }) ipcMain.on(IPC_EVENTS.PHONE_ISLAND_RESIZE, (_, size) => { diff --git a/src/preload/index.ts b/src/preload/index.ts index d207406a..af4031cc 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -40,6 +40,7 @@ export interface IElectronAPI { exitNethLink(): void hidePhoneIsland(): void showPhoneIsland(size: Size): void + copyToClipboard(text: string): void } @@ -98,6 +99,7 @@ const api: IElectronAPI = { exitNethLink: setEmitter(IPC_EVENTS.CLOSE_NETH_LINK), hidePhoneIsland: setEmitter(IPC_EVENTS.HIDE_PHONE_ISLAND), showPhoneIsland: setEmitter(IPC_EVENTS.SHOW_PHONE_ISLAND), + copyToClipboard: setEmitter(IPC_EVENTS.COPY_TO_CLIPBOARD), //LISTENERS - receive data async onUpdateAppNotification: addListener(IPC_EVENTS.UPDATE_APP_NOTIFICATION), diff --git a/src/renderer/public/locales/en/translations.json b/src/renderer/public/locales/en/translations.json index dd5f1d85..24187630 100644 --- a/src/renderer/public/locales/en/translations.json +++ b/src/renderer/public/locales/en/translations.json @@ -82,7 +82,11 @@ "Screen share dialog description": "This application requires permission to record the screen.\n\nClick 'Open Settings' and then select 'Privacy & Security' then 'Screen & System Audio Recording' from the list and enable the permission for 'NethLink'.", "Cancel button": "Cancel", "Open settings button": "Open Settings", - "Shortcut": "Define a keyboard shortcut" + "Shortcut": "Define a keyboard shortcut", + "PlusOther_one": "+ {{count}} other", + "PlusOther_other": "+ {{count}} others", + "Copy": "Copy", + "Copied": "Copied" }, "Login": { "Welcome": "Welcome", diff --git a/src/renderer/public/locales/it/translations.json b/src/renderer/public/locales/it/translations.json index e8807552..c4644779 100644 --- a/src/renderer/public/locales/it/translations.json +++ b/src/renderer/public/locales/it/translations.json @@ -82,7 +82,11 @@ "Screen share dialog description": "Questa applicazione richiede il permesso di registrare lo schermo.\n\nClicca su 'Apri Impostazioni', poi seleziona 'Privacy & Sicurezza' poi 'Registrazione Schermo e Audio di Sistema' dalla lista e abilita il permesso per 'NethLink'.", "Cancel button": "Annulla", "Open settings button": "Apri Impostazioni", - "Shortcut": "Scegli una combinazione di tasti" + "Shortcut": "Scegli una combinazione di tasti", + "PlusOther_one": "+ {{count}} altro", + "PlusOther_other": "+ {{count}} altri", + "Copy": "Copia", + "Copied": "Copiato" }, "Login": { "Welcome": "Benvenuto", diff --git a/src/renderer/src/components/ModuleTitle.tsx b/src/renderer/src/components/ModuleTitle.tsx index e6bd1be6..4e5977c7 100644 --- a/src/renderer/src/components/ModuleTitle.tsx +++ b/src/renderer/src/components/ModuleTitle.tsx @@ -3,13 +3,16 @@ import { Button } from "./Nethesis" import { IconProp } from "@fortawesome/fontawesome-svg-core" import { DefaultTFuncReturn } from "i18next" import { ReactNode } from "react" +import { ClassNames } from "@renderer/utils" +import { Tooltip } from 'react-tooltip' export interface ModuleTitleProps { - title: string | DefaultTFuncReturn, + title?: string | DefaultTFuncReturn | ReactNode, action?: () => void, actionText?: string | DefaultTFuncReturn, actionIcon?: IconProp - actionComponent?: ReactNode + actionComponent?: ReactNode, + className?: string } export const ModuleTitle = ({ @@ -17,15 +20,27 @@ export const ModuleTitle = ({ action, actionText, actionIcon, - actionComponent + actionComponent, + className }: ModuleTitleProps) => { return (
-
-

+
+ {title &&

{title} -

+

} + {action && (