Skip to content

Commit

Permalink
subscription name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Sep 7, 2024
1 parent 8133464 commit cbc8c5d
Show file tree
Hide file tree
Showing 13 changed files with 144 additions and 68 deletions.
21 changes: 11 additions & 10 deletions src/app/shared/system-service/running.process.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@ export class RunningProcessService{
private _runningProcessesImages:Map<string, TaskBarPreviewImage[]>;
private _eventOriginator = '';

processListChangeNotify: Subject<void> = new Subject<void>();
closeProcessNotify: Subject<Process> = new Subject<Process>();
focusOnNextProcessNotify: Subject<void> = new Subject<void>();
focusOnCurrentProcessNotify: Subject<number> = new Subject<number>();
showOnlyCurrentProcessNotify: Subject<number> = new Subject<number>();
focusOutOtherProcessNotify: Subject<number> = new Subject<number>();
restoreOrMinimizeWindowNotify: Subject<number> = new Subject<number>();
maximizeWindowNotify: Subject<void> = new Subject<void>();
minimizeWindowNotify: Subject<number[]> = new Subject<number[]>();
showPreviewWindowNotify: Subject<unknown[]> = new Subject<unknown[]>();
hidePreviewWindowNotify: Subject<void> = new Subject<void>();
removeFocusOnOtherProcessesNotify: Subject<number> = new Subject<number>();
hideProcessPreviewWindowNotify: Subject<void> = new Subject<void>();
hideOtherProcessNotify: Subject<number> = new Subject<number>();
keepPreviewWindowNotify: Subject<void> = new Subject<void>();
keepProcessPreviewWindowNotify: Subject<void> = new Subject<void>();
maximizeProcessWindowNotify: Subject<void> = new Subject<void>();
minimizeProcessWindowNotify: Subject<number[]> = new Subject<number[]>();
showProcessPreviewWindowNotify: Subject<unknown[]> = new Subject<unknown[]>();
showOnlyCurrentProcessWindowNotify: Subject<number> = new Subject<number>();
processListChangeNotify: Subject<void> = new Subject<void>();
restoreOrMinimizeProcessWindowNotify: Subject<number> = new Subject<number>();
restoreProcessWindowNotify: Subject<number> = new Subject<number>();
restoreProcessesWindowNotify: Subject<void> = new Subject<void>();

constructor(){
this._runningProcesses = [];
Expand Down Expand Up @@ -98,7 +100,6 @@ export class RunningProcessService{
return process!;
}


getProcessImages(appName:string):TaskBarPreviewImage[]{
if(this._runningProcessesImages.has(appName))
return this._runningProcessesImages.get(appName) || [];
Expand Down
4 changes: 2 additions & 2 deletions src/app/system-apps/audioplayer/audioplayer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export class AudioPlayerComponent implements BaseComponent, OnInit, OnDestroy, A
this.retrievePastSessionData();

this._runningProcessService = runningProcessService;
this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow()});
this._minimizeWindowSub = this._runningProcessService.minimizeWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow()});
this._minimizeWindowSub = this._runningProcessService.minimizeProcessWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
this._runningProcessService.addProcess(this.getComponentDetail());
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/system-apps/desktop/desktop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ export class DesktopComponent implements OnInit, OnDestroy, AfterViewInit{
this._fileService = fileService;

this._showTaskBarMenuSub = this._menuService.showTaskBarMenu.subscribe((p) => { this.onShowTaskBarContextMenu(p)});
this._showTaskBarPreviewWindowSub = this._runningProcessService.showPreviewWindowNotify.subscribe((p) => { this.showTaskBarPreviewWindow(p)});
this._showTaskBarPreviewWindowSub = this._runningProcessService.showProcessPreviewWindowNotify.subscribe((p) => { this.showTaskBarPreviewWindow(p)});
this._hideContextMenuSub = this._menuService.hideContextMenus.subscribe(() => { this.hideContextMenu()});
this._hideTaskBarPreviewWindowSub = this._runningProcessService.hidePreviewWindowNotify.subscribe(() => { this.hideTaskBarPreviewWindow()});
this._keepTaskBarPreviewWindowSub = this._runningProcessService.keepPreviewWindowNotify.subscribe(() => { this.keepTaskBarPreviewWindow()});
this._hideTaskBarPreviewWindowSub = this._runningProcessService.hideProcessPreviewWindowNotify.subscribe(() => { this.hideTaskBarPreviewWindow()});
this._keepTaskBarPreviewWindowSub = this._runningProcessService.keepProcessPreviewWindowNotify.subscribe(() => { this.keepTaskBarPreviewWindow()});


this.processId = this._processIdService.getNewProcessId()
Expand Down
4 changes: 2 additions & 2 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
}
});

this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow()});
this._minimizeWindowSub = this._runningProcessService.minimizeWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow()});
this._minimizeWindowSub = this._runningProcessService.minimizeProcessWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
this._sortByNotifySub = fileManagerService.sortByNotify.subscribe((p)=>{this.sortIcons(p)});
this._refreshNotifySub = fileManagerService.refreshNotify.subscribe(()=>{this.refreshIcons()});
this._hideContextMenuSub = this._menuService.hideContextMenus.subscribe(() => { this.hideIconContextMenu()});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class TaskBarEntriesComponent implements AfterViewInit, OnDestroy {
return;
}else{
const process = this._runningProcessService.getProcesses().filter(x => x.getProcessName === file.getOpensWith);
this._runningProcessService.restoreOrMinimizeWindowNotify.next(process[0].getProcessId);
this._runningProcessService.restoreOrMinimizeProcessWindowNotify.next(process[0].getProcessId);
}
}

Expand Down Expand Up @@ -236,15 +236,15 @@ export class TaskBarEntriesComponent implements AfterViewInit, OnDestroy {
const data:unknown[] = [rect, appName, iconPath];

if(this._runningProcessService.isProcessRunning(appName))
this._runningProcessService.showPreviewWindowNotify.next(data);
this._runningProcessService.showProcessPreviewWindowNotify.next(data);
}

onMouseLeave():void{
this._runningProcessService.hidePreviewWindowNotify.next();
this._runningProcessService.hideProcessPreviewWindowNotify.next();
}

restoreOrMinizeWindow(processId:number){
this._runningProcessService.restoreOrMinimizeWindowNotify.next(processId)
this._runningProcessService.restoreOrMinimizeProcessWindowNotify.next(processId)
}

private getComponentDetail():Process{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div [@fadeAnimation]="fadeState" class="taskbar-preview-main-container" (mouseenter)="keepTaskBarPreviewWindow()" (mouseleave)="hideTaskBarPreviewWindow()">
<div [@fadeAnimation]="fadeState" class="taskbar-preview-main-container" (mouseenter)="keepTaskBarPreviewWindow()" (mouseleave)="hideTaskBarPreviewWindowAndRestoreDesktop()">
<div class="taskbar-preview-content" *ngFor="let cmpntImage of componentImages" >
<div class="taskbar-preview-header-container" tabindex="0">
<div class="taskbar-preview-left-header-section">
Expand All @@ -19,7 +19,7 @@ <h1 class="taskbar-preview-h1">
</nav>
</div>
</div>
<div class="taskbar-preview-image-container" (contextmenu)="showTaskBarPreviewContextMenu($event, cmpntImage.pid)" (mouseenter)="setWindowToFocus(cmpntImage.pid)">
<div class="taskbar-preview-image-container" (contextmenu)="showTaskBarPreviewContextMenu($event, cmpntImage.pid)" (mouseenter)="setWindowToFocus(cmpntImage.pid)" (mouseleave)="restoreWindow(cmpntImage.pid)">
<figure class="taskbar-preview-figure1">
<img [ngClass]="cmpntImage.imageData ? 'taskbar-preview-img1-sec':'taskbar-preview-img1-pri'" [src]="cmpntImage.imageData || icon"/>
</figure>
Expand Down
15 changes: 10 additions & 5 deletions src/app/system-apps/taskbarpreview/taskbarpreview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,25 @@ export class TaskBarPreviewComponent implements OnChanges, AfterViewInit {
}

keepTaskBarPreviewWindow():void{
this._runningProcessService.keepPreviewWindowNotify.next();
this._runningProcessService.keepProcessPreviewWindowNotify.next();
}

hideTaskBarPreviewWindow():void{
this._runningProcessService.hidePreviewWindowNotify.next();
hideTaskBarPreviewWindowAndRestoreDesktop():void{
this._runningProcessService.hideProcessPreviewWindowNotify.next();

this._runningProcessService.restoreProcessesWindowNotify.next();
}

showTaskBarPreviewContextMenu(evt:MouseEvent, pid:number):void{
console.log('I will implement the TaskBarPreview Context Window.........later');
}


setWindowToFocus(pid:number):void{
this._runningProcessService.showOnlyCurrentProcessNotify.next(pid);
this._runningProcessService.showOnlyCurrentProcessWindowNotify.next(pid);
}

restoreWindow(pid:number):void{
this._runningProcessService.restoreProcessWindowNotify.next(pid);
}

}
2 changes: 1 addition & 1 deletion src/app/system-apps/taskmanager/taskmanager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte
this.processId = this._processIdService.getNewProcessId()
this._runningProcessService.addProcess(this.getComponentDetail());
this._processListChangeSub = this._runningProcessService.processListChangeNotify.subscribe(() =>{this.updateRunningProcess();})
this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow();})
this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow();})
this._currentSortingOrder = this._sorting.order;

this._chnageTaskmgrRefreshIntervalSub = new Subject<number>();
Expand Down
4 changes: 2 additions & 2 deletions src/app/system-apps/terminal/terminal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export class TerminalComponent implements BaseComponent, OnInit, AfterViewInit,

this.processId = this._processIdService.getNewProcessId()
this._runningProcessService.addProcess(this.getComponentDetail());
this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow()})
this._minimizeWindowSub = this._runningProcessService.minimizeWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow()})
this._minimizeWindowSub = this._runningProcessService.minimizeProcessWindowNotify.subscribe((p) =>{this.minimizeWindow(p)})
}

ngOnInit():void{
Expand Down
4 changes: 2 additions & 2 deletions src/app/system-apps/videoplayer/videoplayer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export class VideoPlayerComponent implements BaseComponent, OnInit, OnDestroy, A

this.retrievePastSessionData();

this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow()})
this._minimizeWindowSub = this._runningProcessService.minimizeWindowNotify.subscribe((p) =>{this.minmizeWindow(p)})
this._maximizeWindowSub = this._runningProcessService.maximizeProcessWindowNotify.subscribe(() =>{this.maximizeWindow()})
this._minimizeWindowSub = this._runningProcessService.minimizeProcessWindowNotify.subscribe((p) =>{this.minmizeWindow(p)})
this._runningProcessService.addProcess(this.getComponentDetail());
}

Expand Down
9 changes: 6 additions & 3 deletions src/app/system-apps/window/animation/animations.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import {trigger, transition, state, animate, style, keyframes} from '@angular/animations';

const HIDDEN_Z_INDEX = 1;
const MAX_Z_INDEX = 2;

// Routable animations
export const openCloseAnimation =
trigger('openClose', [
state('open', style({
opacity: 1,
zIndex: 2,
zIndex: MAX_Z_INDEX,
})),
state('close', style({
opacity: 0
Expand Down Expand Up @@ -35,11 +38,11 @@ import {trigger, transition, state, animate, style, keyframes} from '@angular/an
trigger('hideShow', [
state('hidden', style({
opacity: 0,
zIndex: 2,
zIndex: HIDDEN_Z_INDEX,
})),
state('visible', style({
opacity: 1,
zIndex: 2,
zIndex: MAX_Z_INDEX,
})),
transition('visible => hidden', [
animate("0.30s ease-out", keyframes([
Expand Down
Loading

0 comments on commit cbc8c5d

Please sign in to comment.