mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
Merge branch 'main' into feature/better-repack-modal
This commit is contained in:
commit
d8937b3672
@ -10,6 +10,10 @@
|
|||||||
"url": "https://github.com/hydralauncher/hydra.git"
|
"url": "https://github.com/hydralauncher/hydra.git"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"engines": {
|
||||||
|
"npm": "please-use-yarn",
|
||||||
|
"yarn": ">= 1.19.1"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format-check": "prettier --check .",
|
"format-check": "prettier --check .",
|
||||||
|
@ -17,7 +17,11 @@
|
|||||||
"downloading": "{{title}} ({{percentage}} - Pobieranie…)",
|
"downloading": "{{title}} ({{percentage}} - Pobieranie…)",
|
||||||
"filter": "Filtruj biblioteke",
|
"filter": "Filtruj biblioteke",
|
||||||
"follow_us": "Śledź nas",
|
"follow_us": "Śledź nas",
|
||||||
"home": "Główna"
|
"home": "Główna",
|
||||||
|
"discord": "Dołącz nasz Discord",
|
||||||
|
"telegram": "Dołącz nasz Telegram",
|
||||||
|
"x": "Śledź na X",
|
||||||
|
"github": "Przyczyń się na GitHub"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"search": "Szukaj",
|
"search": "Szukaj",
|
||||||
@ -66,6 +70,8 @@
|
|||||||
"copied_link_to_clipboard": "Skopiowano łącze",
|
"copied_link_to_clipboard": "Skopiowano łącze",
|
||||||
"hours": "godzin",
|
"hours": "godzin",
|
||||||
"minutes": "minut",
|
"minutes": "minut",
|
||||||
|
"amount_hours": "{{amount}} godzin",
|
||||||
|
"amount_minutes": "{{amount}} minut",
|
||||||
"accuracy": "{{accuracy}}% dokładność",
|
"accuracy": "{{accuracy}}% dokładność",
|
||||||
"add_to_library": "Dodaj do biblioteki",
|
"add_to_library": "Dodaj do biblioteki",
|
||||||
"remove_from_library": "Usuń z biblioteki",
|
"remove_from_library": "Usuń z biblioteki",
|
||||||
@ -80,12 +86,26 @@
|
|||||||
"playing_now": "Granie teraz",
|
"playing_now": "Granie teraz",
|
||||||
"change": "Zmień",
|
"change": "Zmień",
|
||||||
"repacks_modal_description": "Wybierz repack, który chcesz pobrać",
|
"repacks_modal_description": "Wybierz repack, który chcesz pobrać",
|
||||||
"downloads_path": "Ścieżka pobierania",
|
|
||||||
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
|
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
|
||||||
"settings": "Ustawienia Hydra",
|
"settings": "Ustawienia Hydra",
|
||||||
"download_now": "Pobierz teraz",
|
|
||||||
"multi_language": "Wielojęzyczny",
|
"multi_language": "Wielojęzyczny",
|
||||||
"multiplayer": "Wieloosobowy"
|
"multiplayer": "Wieloosobowy",
|
||||||
|
"download_now": "Pobierz teraz",
|
||||||
|
"installation_instructions": "Instrukcja instalacji",
|
||||||
|
"installation_instructions_description": "Do zainstalowania tej gry wymagane są dodatkowe kroki",
|
||||||
|
"online_fix_instruction": "Gry OnlineFix wymagają hasła do wyodrębnienia. W razie potrzeby użyj następującego hasła:",
|
||||||
|
"dodi_installation_instruction": "Po otwarciu instalatora DODI naciśnij klawisz <0 /> w górę, aby rozpocząć proces instalacji:",
|
||||||
|
"dont_show_it_again": "Nie pokazuj tego ponownie",
|
||||||
|
"copy_to_clipboard": "Skopiuj",
|
||||||
|
"copied_to_clipboard": "Skopiowano",
|
||||||
|
"got_it": "Rozumiem",
|
||||||
|
"no_shop_details": "Nie udało się pobrać danych sklepu.",
|
||||||
|
"download_options": "Opcje pobierania",
|
||||||
|
"download_path": "Ścieżka pobierania",
|
||||||
|
"previous_screenshot": "Poprzedni zrzut ekranu",
|
||||||
|
"next_screenshot": "Następny zrzut ekranu",
|
||||||
|
"screenshot": "Zrzut ekranu {{number}}",
|
||||||
|
"open_screenshot": "Otwórz zrzut ekranu {{number}}"
|
||||||
},
|
},
|
||||||
"activation": {
|
"activation": {
|
||||||
"title": "Aktywuj Hydra",
|
"title": "Aktywuj Hydra",
|
||||||
@ -116,7 +136,9 @@
|
|||||||
"remove_from_list": "Usuń",
|
"remove_from_list": "Usuń",
|
||||||
"delete_modal_title": "Czy na pewno?",
|
"delete_modal_title": "Czy na pewno?",
|
||||||
"delete_modal_description": "Spowoduje to usunięcie wszystkich plików instalacyjnych z komputera",
|
"delete_modal_description": "Spowoduje to usunięcie wszystkich plików instalacyjnych z komputera",
|
||||||
"install": "Instaluj"
|
"install": "Instaluj",
|
||||||
|
"real_debrid": "Real Debrid",
|
||||||
|
"torrent": "Torrent"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"downloads_path": "Ścieżka pobierania",
|
"downloads_path": "Ścieżka pobierania",
|
||||||
@ -125,7 +147,16 @@
|
|||||||
"enable_download_notifications": "Gdy pobieranie zostanie zakończone",
|
"enable_download_notifications": "Gdy pobieranie zostanie zakończone",
|
||||||
"enable_repack_list_notifications": "Gdy dodawany jest nowy repack",
|
"enable_repack_list_notifications": "Gdy dodawany jest nowy repack",
|
||||||
"telemetry": "Telemetria",
|
"telemetry": "Telemetria",
|
||||||
"telemetry_description": "Włącz anonimowe statystyki użycia"
|
"telemetry_description": "Włącz anonimowe statystyki użycia",
|
||||||
|
"real_debrid_api_token_label": "Real Debrid API token",
|
||||||
|
"quit_app_instead_hiding": "Zamknij Hydr zamiast minimalizować do zasobnika",
|
||||||
|
"launch_with_system": "Uruchom Hydra przy starcie systemu",
|
||||||
|
"general": "Ogólne",
|
||||||
|
"behavior": "Zachowania",
|
||||||
|
"enable_real_debrid": "Włącz Real Debrid",
|
||||||
|
"real_debrid": "Real Debrid",
|
||||||
|
"real_debrid_api_token_hint": "Możesz uzyskać swój klucz API <0>tutaj</0>.",
|
||||||
|
"save_changes": "Zapisz zmiany"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Pobieranie zakończone",
|
"download_complete": "Pobieranie zakończone",
|
||||||
@ -145,5 +176,8 @@
|
|||||||
"title": "Programy nie są zainstalowane",
|
"title": "Programy nie są zainstalowane",
|
||||||
"description": "Pliki wykonywalne Wine lub Lutris nie zostały znalezione na twoim systemie",
|
"description": "Pliki wykonywalne Wine lub Lutris nie zostały znalezione na twoim systemie",
|
||||||
"instructions": "Sprawdź prawidłowy sposób instalacji dowolnego z nich w swojej dystrybucji Linuksa, aby gra działała normalnie"
|
"instructions": "Sprawdź prawidłowy sposób instalacji dowolnego z nich w swojej dystrybucji Linuksa, aby gra działała normalnie"
|
||||||
|
},
|
||||||
|
"modal": {
|
||||||
|
"close": "Zamknij"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
import { BrowserWindow, Menu, Tray, app } from "electron";
|
import {
|
||||||
|
BrowserWindow,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
MenuItemConstructorOptions,
|
||||||
|
Tray,
|
||||||
|
app,
|
||||||
|
shell,
|
||||||
|
} from "electron";
|
||||||
import { is } from "@electron-toolkit/utils";
|
import { is } from "@electron-toolkit/utils";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import icon from "@resources/icon.png?asset";
|
import icon from "@resources/icon.png?asset";
|
||||||
import trayIcon from "@resources/tray-icon.png?asset";
|
import trayIcon from "@resources/tray-icon.png?asset";
|
||||||
import { userPreferencesRepository } from "@main/repository";
|
import { gameRepository, userPreferencesRepository } from "@main/repository";
|
||||||
|
import { IsNull, Not } from "typeorm";
|
||||||
|
|
||||||
export class WindowManager {
|
export class WindowManager {
|
||||||
public static mainWindow: Electron.BrowserWindow | null = null;
|
public static mainWindow: Electron.BrowserWindow | null = null;
|
||||||
@ -77,33 +86,66 @@ export class WindowManager {
|
|||||||
public static createSystemTray(language: string) {
|
public static createSystemTray(language: string) {
|
||||||
const tray = new Tray(trayIcon);
|
const tray = new Tray(trayIcon);
|
||||||
|
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const updateSystemTray = async () => {
|
||||||
{
|
const games = await gameRepository.find({
|
||||||
label: t("open", {
|
where: {
|
||||||
ns: "system_tray",
|
isDeleted: false,
|
||||||
lng: language,
|
executablePath: Not(IsNull()),
|
||||||
}),
|
lastTimePlayed: Not(IsNull()),
|
||||||
type: "normal",
|
|
||||||
click: () => {
|
|
||||||
if (this.mainWindow) {
|
|
||||||
this.mainWindow.show();
|
|
||||||
} else {
|
|
||||||
this.createMainWindow();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
take: 5,
|
||||||
{
|
order: {
|
||||||
label: t("quit", {
|
updatedAt: "DESC",
|
||||||
ns: "system_tray",
|
},
|
||||||
lng: language,
|
});
|
||||||
}),
|
|
||||||
type: "normal",
|
const recentlyPlayedGames: Array<MenuItemConstructorOptions | MenuItem> =
|
||||||
click: () => app.quit(),
|
games.map(({ title, executablePath }) => ({
|
||||||
},
|
label: title,
|
||||||
]);
|
type: "normal",
|
||||||
|
click: async () => {
|
||||||
|
if (!executablePath) return;
|
||||||
|
|
||||||
|
shell.openPath(executablePath);
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: t("open", {
|
||||||
|
ns: "system_tray",
|
||||||
|
lng: language,
|
||||||
|
}),
|
||||||
|
type: "normal",
|
||||||
|
click: () => {
|
||||||
|
if (this.mainWindow) {
|
||||||
|
this.mainWindow.show();
|
||||||
|
} else {
|
||||||
|
this.createMainWindow();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "separator",
|
||||||
|
},
|
||||||
|
...recentlyPlayedGames,
|
||||||
|
{
|
||||||
|
type: "separator",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: t("quit", {
|
||||||
|
ns: "system_tray",
|
||||||
|
lng: language,
|
||||||
|
}),
|
||||||
|
type: "normal",
|
||||||
|
click: () => app.quit(),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
return contextMenu;
|
||||||
|
};
|
||||||
|
|
||||||
tray.setToolTip("Hydra");
|
tray.setToolTip("Hydra");
|
||||||
tray.setContextMenu(contextMenu);
|
|
||||||
|
|
||||||
if (process.platform === "win32" || process.platform === "linux") {
|
if (process.platform === "win32" || process.platform === "linux") {
|
||||||
tray.addListener("click", () => {
|
tray.addListener("click", () => {
|
||||||
@ -117,6 +159,11 @@ export class WindowManager {
|
|||||||
|
|
||||||
this.createMainWindow();
|
this.createMainWindow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tray.addListener("right-click", async () => {
|
||||||
|
const contextMenu = await updateSystemTray();
|
||||||
|
tray.popUpContextMenu(contextMenu);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user