Remove WindowManager, separate functionality into smaller modules (#2682)
* Move sendToRenderer to respective singletons * Move to using ViewManager call for getting view by webContentsId * Move show and create logic to main window, handle deep linking seperately * Move resizing logic and event handing to mainWindow * Move server switching logic to main/app * Move tab switching logic to main/app, rely on showById for most usage * Migrate remaining functions, remove windowManager objects, set up imports for self-contained singletons * Fix E2E tests * Update src/main/app/servers.ts Co-authored-by: Elias Nahum <nahumhbl@gmail.com> --------- Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import {createMenu as createTrayMenu} from 'main/menus/tray';
|
||||
import {ServerInfo} from 'main/server/serverInfo';
|
||||
import {setTrayMenu} from 'main/tray/tray';
|
||||
import ViewManager from 'main/views/viewManager';
|
||||
import WindowManager from 'main/windows/windowManager';
|
||||
import MainWindow from 'main/windows/mainWindow';
|
||||
|
||||
import {mainProtocol} from './initialize';
|
||||
@@ -39,7 +38,8 @@ const log = new Logger('App.Utils');
|
||||
|
||||
export function openDeepLink(deeplinkingUrl: string) {
|
||||
try {
|
||||
WindowManager.showMainWindow(deeplinkingUrl);
|
||||
MainWindow.show();
|
||||
ViewManager.handleDeepLink(deeplinkingUrl);
|
||||
} catch (err) {
|
||||
log.error(`There was an error opening the deeplinking url: ${err}`);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ export function handleUpdateMenuEvent() {
|
||||
Menu.setApplicationMenu(aMenu);
|
||||
aMenu.addListener('menu-will-close', () => {
|
||||
ViewManager.focusCurrentView();
|
||||
WindowManager.sendToRenderer(APP_MENU_WILL_CLOSE);
|
||||
MainWindow.sendToRenderer(APP_MENU_WILL_CLOSE);
|
||||
});
|
||||
|
||||
// set up context menu for tray icon
|
||||
|
Reference in New Issue
Block a user