Skip to content

Commit

Permalink
start menu buttons are functional
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Oct 7, 2024
1 parent 030f4f1 commit f9a94f8
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/system-apps/desktop/desktop.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export class DesktopComponent implements OnInit, OnDestroy, AfterViewInit{
}

async createFolder():Promise<void>{
const folderName = 'New Folder';
const folderName = this._consts.NEW_FOLDER;
const result = await this._fileService.createFolderAsync(this.directory, folderName);
if(result){
this._fileService.addEventOriginator('filemanager');
Expand Down
10 changes: 8 additions & 2 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,14 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn

if(this._fileInfo){
// is this a URL or and Actual Folder
if(this._fileInfo.getOpensWith === 'fileexplorer' && !this._fileInfo.getIsFile) //Actual Folder
this.directory = this._fileInfo.getCurrentPath;
if(this._fileInfo.getOpensWith === 'fileexplorer' && !this._fileInfo.getIsFile){ //Actual Folder
this.directory = this._fileInfo.getCurrentPath;
const fileName = (this._fileInfo.getFileName === this._consts.EMPTY_STRING)? this._consts.NEW_FOLDER : this._fileInfo.getFileName;

this.populateHopsList();
this.setNavPathIcon(fileName, this._fileInfo.getCurrentPath);
this.storeAppState(this._fileInfo.getCurrentPath);
}
}

this.renameForm = this._formBuilder.nonNullable.group({
Expand Down
2 changes: 1 addition & 1 deletion src/app/system-apps/filemanager/filemanager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
}, this.SECONDS_DELAY[1]);
}

async runProcess(file:FileInfo):Promise<void>{
runProcess(file:FileInfo):void{

console.log('filemanager-runProcess:',file)
this._triggerProcessService.startApplication(file);
Expand Down
16 changes: 8 additions & 8 deletions src/app/system-apps/startmenu/startmenu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="start-menu-main-overlay-container">
<div class="start-menu-main-overlay-content">
<div class="start-menu-main-overlay-icon-text-container" id="sm-IconText-Overlay-Cntnr">
<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-overlay-icon">
<figure class="start-menu-overlay-figure">
<img class="start-menu-overlay-img" [src]="'osdrive/Cheetah/System/Imageres/sm_hamburger_menu.png'"/>
Expand All @@ -16,40 +16,40 @@

<div style="height: 280px;"> </div>

<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-main-overlay-icon-text-content" (click)="openFolderPath(Documents)" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-overlay-icon">
<figure class="start-menu-overlay-figure">
<img class="start-menu-overlay-img" [src]="'osdrive/Cheetah/System/Imageres/sm_file.png'"/>
</figure>
</div>
<div class="start-menu-overlay-text" [style]="txtOverlayMenuStyle">
<p class="start-menu-overlay-text-p">Documents</p>
<p class="start-menu-overlay-text-p">{{Documents}}</p>
</div>
</div>

<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-main-overlay-icon-text-content" (click)="openFolderPath(Pictures)" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-overlay-icon">
<figure class="start-menu-overlay-figure">
<img class="start-menu-overlay-img" [src]="'osdrive/Cheetah/System/Imageres/sm_picture.png'"/>
</figure>
</div>
<div class="start-menu-overlay-text" [style]="txtOverlayMenuStyle">
<p class="start-menu-overlay-text-p">Pictures</p>
<p class="start-menu-overlay-text-p">{{Pictures}}</p>
</div>
</div>

<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-main-overlay-icon-text-content" (click)="openFolderPath(Music)" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-overlay-icon">
<figure class="start-menu-overlay-figure">
<img class="start-menu-overlay-img" [src]="'osdrive/Cheetah/System/Imageres/sm_music.png'"/>
</figure>
</div>
<div class="start-menu-overlay-text" [style]="txtOverlayMenuStyle">
<p class="start-menu-overlay-text-p">Music</p>
<p class="start-menu-overlay-text-p">{{Music}}</p>
</div>
</div>

<div class="start-menu-main-overlay-icon-text-content" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-main-overlay-icon-text-content" (click)="power()" (mouseenter)="startMenuOverlaySlideOut()" (mouseleave)="startMenuOverlaySlideIn()">
<div class="start-menu-overlay-icon">
<figure class="start-menu-overlay-figure">
<img class="start-menu-overlay-img" [src]="'osdrive/Cheetah/System/Imageres/sm_power.png'"/>
Expand Down
22 changes: 21 additions & 1 deletion src/app/system-apps/startmenu/startmenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export class StartMenuComponent implements OnInit, AfterViewInit {

private SECONDS_DELAY = 250;

Documents= 'Documents';
Pictures = 'Pictures'
Music = 'Music';

delayStartMenuOverlayHideTimeoutId!: NodeJS.Timeout;
delayStartMenuOverlayShowTimeoutId!: NodeJS.Timeout;

Expand Down Expand Up @@ -190,10 +194,26 @@ export class StartMenuComponent implements OnInit, AfterViewInit {
}
}

async runProcess(file:FileInfo):Promise<void>{
runProcess(file:FileInfo):void{
console.log('startmanager-runProcess:',file)
this._triggerProcessService.startApplication(file);
}


openFolderPath(folderName:string):void{
const path = `/Users/${folderName}`;

const file = new FileInfo();
file.setFileName = folderName;
file.setOpensWith = 'fileexplorer';
file.setIsFile = false;
file.setCurrentPath = path;

this.runProcess(file);
}

power():void{
location.reload();
}


Expand Down
1 change: 1 addition & 0 deletions src/app/system-files/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class Constants{
readonly SHORTCUT = 'Shortcut';
readonly BASE = 'osdrive';
readonly IMAGE_BASE_PATH = 'osdrive/Cheetah/System/Imageres/';
readonly NEW_FOLDER = 'New Folder';

readonly DEFAULT_MENU_ORDER = 'DefaultMenuOrder';
readonly DEFAULT_FILE_MENU_ORDER = 'DefaultFileMenuOrder';
Expand Down

0 comments on commit f9a94f8

Please sign in to comment.