diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e569c9ee..05dac681 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -57,6 +57,7 @@ export class AppComponent implements OnDestroy, AfterViewInit { //appname private apps: {type: Type}[] =[ {type: FileexplorerComponent}, + {type: TaskmanagerComponent}, {type: TaskmanagerMiniComponent}, {type: TitleComponent}, {type: GreetingComponent}, diff --git a/src/app/system-apps/taskmanager/taskmanager.component.html b/src/app/system-apps/taskmanager/taskmanager.component.html index b645ada0..ba291093 100644 --- a/src/app/system-apps/taskmanager/taskmanager.component.html +++ b/src/app/system-apps/taskmanager/taskmanager.component.html @@ -106,7 +106,7 @@ -
+
Fewer details
diff --git a/src/app/system-apps/taskmanager/taskmanager.component.ts b/src/app/system-apps/taskmanager/taskmanager.component.ts index 03468954..9e0abae6 100644 --- a/src/app/system-apps/taskmanager/taskmanager.component.ts +++ b/src/app/system-apps/taskmanager/taskmanager.component.ts @@ -6,6 +6,9 @@ import { BaseComponent } from 'src/app/system-base/base/base.component'; import { ComponentType } from 'src/app/system-files/component.types'; import { Process } from 'src/app/system-files/process'; import { SortingInterface } from './sorting.interface'; +import { StateManagmentService } from 'src/app/shared/system-service/state.management.service'; +import { FileInfo } from 'src/app/system-files/fileinfo'; +import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service'; @Component({ selector: 'cos-taskmanager', @@ -22,6 +25,9 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte private _processIdService:ProcessIDService; private _runningProcessService:RunningProcessService; + private _stateManagmentService: StateManagmentService; + private _triggerProcessService:TriggerProcessService; + private _processListChangeSub!: Subscription; private _taskmgrTimerSubscription!: Subscription; private _currentSortingOrder!:any; @@ -51,9 +57,12 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte diskUtil = 0; networkUtil = 0; - constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService) { + constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService,stateManagmentService: StateManagmentService,triggerProcessService:TriggerProcessService) { this._processIdService = processIdService; this._runningProcessService = runningProcessService; + this._stateManagmentService = stateManagmentService; + this._triggerProcessService = triggerProcessService; + this.processId = this._processIdService.getNewProcessId() this._runningProcessService.addProcess(this.getComponentDetail()); this._processListChangeSub = this._runningProcessService.processListChangeNotify.subscribe(() =>{this.updateRunningProcess();}) @@ -258,6 +267,21 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte return groupedData; } + + onFewerDetailsBtnClick():void{ + const file:FileInfo = new FileInfo(); + file.setIcon = '/osdrive/icons/taskmanger.png'; + file.setOpensWith = 'taskmanagermini'; + file.setFileType ='.png'; + + const processToClose = this._runningProcessService.getProcess(this.processId); + this._stateManagmentService.removeState(this.processId); + this._triggerProcessService.startApplication(file); + + this._runningProcessService.closeProcessNotify.next(processToClose); + } + + setUtilColoumnColors(cellValue:number){ let baseStyle: Record = {}; if(cellValue <= 2.5){ diff --git a/src/app/system-apps/taskmanager/taskmanager.mini.component.html b/src/app/system-apps/taskmanager/taskmanager.mini.component.html index d452c0f4..bdc62e82 100644 --- a/src/app/system-apps/taskmanager/taskmanager.mini.component.html +++ b/src/app/system-apps/taskmanager/taskmanager.mini.component.html @@ -19,7 +19,7 @@ -
+
More details
diff --git a/src/app/system-apps/taskmanager/taskmanager.mini.component.ts b/src/app/system-apps/taskmanager/taskmanager.mini.component.ts index 0acbff27..4bd624f3 100644 --- a/src/app/system-apps/taskmanager/taskmanager.mini.component.ts +++ b/src/app/system-apps/taskmanager/taskmanager.mini.component.ts @@ -2,8 +2,11 @@ import { Component, OnInit,OnDestroy} from '@angular/core'; import { Subscription } from 'rxjs'; import { ProcessIDService } from 'src/app/shared/system-service/process.id.service'; import { RunningProcessService } from 'src/app/shared/system-service/running.process.service'; +import { StateManagmentService } from 'src/app/shared/system-service/state.management.service'; +import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service'; import { BaseComponent } from 'src/app/system-base/base/base.component'; import { ComponentType } from 'src/app/system-files/component.types'; +import { FileInfo } from 'src/app/system-files/fileinfo'; import { Process } from 'src/app/system-files/process'; @Component({ @@ -15,6 +18,9 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy private _processIdService:ProcessIDService; private _runningProcessService:RunningProcessService; + private _stateManagmentService: StateManagmentService; + private _triggerProcessService:TriggerProcessService; + private _processListChangeSub!: Subscription; processes:Process[] =[]; @@ -27,9 +33,12 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy displayName = 'Task Manager'; - constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService) { + constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService,stateManagmentService: StateManagmentService,triggerProcessService:TriggerProcessService) { this._processIdService = processIdService; this._runningProcessService = runningProcessService; + this._stateManagmentService = stateManagmentService; + this._triggerProcessService = triggerProcessService; + this.processId = this._processIdService.getNewProcessId() this._runningProcessService.addProcess(this.getComponentDetail()); this._processListChangeSub = this._runningProcessService.processListChangeNotify.subscribe(() =>{this.updateRunningProcess();}) @@ -44,6 +53,19 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy this._processListChangeSub?.unsubscribe(); } + onMoreDetailsBtnClick():void{ + const file:FileInfo = new FileInfo(); + file.setIcon = '/osdrive/icons/taskmanger.png'; + file.setOpensWith = 'taskmanager'; + file.setFileType ='.png'; + + const processToClose = this._runningProcessService.getProcess(this.processId); + this._stateManagmentService.removeState(this.processId); + this._triggerProcessService.startApplication(file); + + this._runningProcessService.closeProcessNotify.next(processToClose); + } + setTaskMangrMiniWindowToFocus(pid: number):void { this._runningProcessService.focusOnCurrentProcessNotify.next(pid); } diff --git a/src/app/system-files/app.directory.ts b/src/app/system-files/app.directory.ts index 3441b4d8..54d29a77 100644 --- a/src/app/system-files/app.directory.ts +++ b/src/app/system-files/app.directory.ts @@ -16,7 +16,7 @@ export class AppDirectory { } private fetchSystemApp(): string[]{ - this._systemProcessList = ['fileexplorer','taskmanager']; + this._systemProcessList = ['fileexplorer','taskmanager','taskmanagermini']; return this._systemProcessList; } diff --git a/src/osdrive/desktop/fileexplorer.url b/src/osdrive/desktop/fileexplorer.url index b34393de..acba9845 100644 --- a/src/osdrive/desktop/fileexplorer.url +++ b/src/osdrive/desktop/fileexplorer.url @@ -1,6 +1,6 @@ [InternetShortcut] -FileName=Task Manager -IconFile=/osdrive/icons/taskmanger.png -FileType=.png -ShortUrl=Task Manager -OpensWith=taskmanager +FileName=File Explorer +IconFile=/osdrive/icons/file_explorer.ico +FileType=folder +ShortUrl=File Explorer +OpensWith=fileexplorer diff --git a/src/osdrive/desktop/taskmanager.url b/src/osdrive/desktop/taskmanager.url index acba9845..588670b6 100644 --- a/src/osdrive/desktop/taskmanager.url +++ b/src/osdrive/desktop/taskmanager.url @@ -1,6 +1,6 @@ [InternetShortcut] -FileName=File Explorer -IconFile=/osdrive/icons/file_explorer.ico -FileType=folder -ShortUrl=File Explorer -OpensWith=fileexplorer +FileName=Task Manager +IconFile=/osdrive/icons/taskmanger.png +FileType=.png +ShortUrl=Task Manager +OpensWith=taskmanager \ No newline at end of file