Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fixing_bugs_and_polishing'
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Oct 10, 2024
2 parents 35891ad + 8da0d5b commit b95f886
Show file tree
Hide file tree
Showing 868 changed files with 689,650 additions and 966 deletions.
27 changes: 0 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,6 @@ This project was generated with [Angular CLI](https://github.com/angular/angular

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code setup

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

Run `npm run build` to generate the filesystem(osdrive.json). Once the filesystem is created, update the file by placing all the auto generated content within the tag {"osdrive": .................}.

It should look like this {"osdrive":{"Desktop":{"audioplayer.url":null,"fileexplorer.url":null,"heat.url":null,"hello.url":null,"taskmanager.url":null,"terminal.url":null,"videoplayer.url":null}}}

***Note - npm will throw an error that it is unable to find make_http_index.js. All you have to do, is to got `CheetahOs/node_modules/browserfs/dist/scripts folder` and make a copy of `make_xhrfs_index.js` and rename it to `make_http_index.js`

***Note Some other error might occur in browserfs as a result of missing libs.

We are not utilizing the DropBox feature, so we can comment it out
comment out this line `/// <reference types="dropboxjs" />` change it to `/* /// <reference types="dropboxjs" />*/`

|---> Cannot find namespace `Dropbox`: replace reference to `Dropbox` with `any`. like `client: Dropbox.Client; --> client: any;`

|---> Cannot find namespace `NodeBuffer` : replace reference to `NodeBuffer` with `any`. like `client: buffer: NodeBuffer; --> buffer: any;`

|---> Property `put` in type `IndexedDBRWTransaction` is not assignable to the same property in base type 'AsyncKeyValueRWTransaction'.

|---> change `(key: string, data: Buffer, overwrite: boolean, cb: BFSCallback<boolean>)` to `(key: string, data: Buffer, overwrite: boolean, cb: any)`

|---> Type `Stats` is missing the following properties from type `StatsBase<number>: atimeMs, mtimeMs, ctimeMs, birthtimeMs`

|---> add this line of code:`atimeMs: number; mtimeMs: number; ctimeMs: number; birthtimeMs: number;`

## Code scaffolding
## Build

Expand Down
12 changes: 6 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
"src/osdrive",
{
"glob": "**/*",
"input": "src/assets/js-dos",
"input": "src/osdrive/Program-Files/JS-DOS",
"output": "/"
},
{
"glob": "**/*",
"input": "src/assets/ruffle",
"output": "/assets/ruffle"
"input": "src/osdrive/Program-Files/Ruffle",
"output": "/osdrive/Program-Files/Ruffle"
},
{
"glob": "**/*",
"input": "src/assets/pdf",
"output": "/assets/pdf"
"input": "src/osdrive/Program-Files/PDF-JS",
"output": "/osdrive/Program-Files/PDF-JS"
},
{ "glob": "**/*",
"input": "node_modules/monaco-editor",
Expand All @@ -60,7 +60,7 @@
"node_modules/angular2-draggable/css/resizable.min.css"
],
"scripts": [
"./src/scripts/backgrounds/three.min.js"
"src/osdrive/Cheetah/System/ThreeJS/three.min.js"
]
},
"configurations": {
Expand Down
36 changes: 4 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "cheetah-os",
"version": "2.7.31",
"version": "2.10.05",
"description": "Desktop environment in the browser",
"author": "CM",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "npm run build:fs && ng build",
"build:fs": "cd src/osdrive && node ../../node_modules/browserfs/dist/scripts/make_http_index.js > ../osdrive.json",
"build:fs": "cd src/osdrive && node Cheetah/System/BrowserFS/scripts/make_http_index.js > ../osdrive.json",
"clean": "rm -rf node_modules",
"reinstall": "npm run clean && npm install",
"rebuild": "npm run clean && npm install && npm run build",
Expand Down Expand Up @@ -37,7 +37,6 @@
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"angular2-draggable": "^16.0.0",
"browserfs": "^1.4.3",
"emulators": "^0.73.7",
"emulators-ui": "^0.73.7",
"html-to-image": "^1.11.11",
Expand Down
2 changes: 1 addition & 1 deletion src/Things to do.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sudo n lts| stable | latest --(pick one)

32.) Aligon icond to grid on the desktop is broken

33.) Windows z-indexing is BROOOOKEN.
33.) Windows z-indexing is BROOOOKEN -- done.

34.) Creating a new folder from the termial/fileexplorer has broken back navigation

Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {TestBed} from '@angular/core/testing';
import {AppComponent} from './app.component';
import {TitleComponent } from './user-apps/title/title.component';
import {DesktopComponent} from './system-apps/desktop/desktop.component';
import {WindowComponent} from './system-apps/window/window.component'
import {WindowComponent} from './shared/system-component/window/window.component'

describe('AppComponent', () => {
beforeEach(async () => {
Expand Down
44 changes: 36 additions & 8 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ComponentType } from './system-files/component.types';
import { NotificationType } from './system-files/notification.type';
import { Process } from './system-files/process';
import { AppDirectory } from './system-files/app.directory';
import { Constants } from 'src/app/system-files/constants';

import { BaseComponent } from './system-base/base/base.component';
import { TitleComponent } from './user-apps/title/title.component';
Expand All @@ -29,6 +30,9 @@ import { DialogComponent } from './shared/system-component/dialog/dialog.compone
import { TextEditorComponent } from './system-apps/texteditor/texteditor.component';
import { CodeEditorComponent } from './user-apps/codeeditor/codeeditor.component';
import { MarkDownViewerComponent } from './user-apps/markdownviewer/markdownviewer.component';
import { PropertiesComponent } from './shared/system-component/properties/properties.component';
import { MenuService } from './shared/system-service/menu.services';
import { FileInfo } from './system-files/file.info';

@Component({
selector: 'cos-root',
Expand All @@ -51,8 +55,10 @@ export class AppComponent implements OnDestroy, AfterViewInit {
private _sessionMangamentServices:SessionManagmentService;
private _notificationServices:NotificationService;
private _stateManagmentService:StateManagmentService;
private _menuService:MenuService;
private _componentRefView!:ViewRef;
private _appDirectory:AppDirectory;
private _consts:Constants = new Constants();

private _closeProcessSub!:Subscription;
private _closeMsgDialogSub!:Subscription;
Expand All @@ -61,6 +67,9 @@ export class AppComponent implements OnDestroy, AfterViewInit {
private _appIsRunningSub!:Subscription;
private _errorNotifySub!:Subscription;
private _infoNotifySub!:Subscription;
private _warnNotifySub!:Subscription;
private _showPropertiesViewSub!:Subscription;
private _closePropertiesViewSub!:Subscription;

private userOpenedAppsList:string[] = [];
private retreivedKeys:string[] = [];
Expand All @@ -69,7 +78,7 @@ export class AppComponent implements OnDestroy, AfterViewInit {
private SECONDS_DELAY:number[] =[1500, 1500];

hasWindow = false;
icon = 'osdrive/icons/generic-program.ico';
icon = `${this._consts.IMAGE_BASE_PATH}generic_program.png`;
name = 'system';
processId = 0;
type = ComponentType.System;
Expand All @@ -96,7 +105,7 @@ export class AppComponent implements OnDestroy, AfterViewInit {


constructor( processIdService:ProcessIDService, runningProcessService:RunningProcessService,componentReferenceService:ComponentReferenceService, triggerProcessService:TriggerProcessService,
sessionMangamentServices:SessionManagmentService, notificationServices:NotificationService, stateManagmentService:StateManagmentService){
sessionMangamentServices:SessionManagmentService, notificationServices:NotificationService, stateManagmentService:StateManagmentService, menuService:MenuService){
this._processIdService = processIdService
this.processId = this._processIdService.getNewProcessId()

Expand All @@ -106,14 +115,18 @@ export class AppComponent implements OnDestroy, AfterViewInit {
this._sessionMangamentServices = sessionMangamentServices;
this._notificationServices = notificationServices;
this._stateManagmentService = stateManagmentService;
this._menuService = menuService;

this._startProcessSub = this._triggerProcessService.startProcessNotify.subscribe((appName) =>{this.loadApps(appName)})
this._appNotFoundSub = this._triggerProcessService.appNotFoundNotify.subscribe((appName) =>{this.showDialogMsgBox(NotificationType.Error,appName)})
this._appIsRunningSub = this._triggerProcessService.appIsRunningNotify.subscribe((appName) =>{this.showDialogMsgBox(NotificationType.Info,appName)})
this._errorNotifySub = this._notificationServices.errorNotify.subscribe((appName) =>{this.showDialogMsgBox(NotificationType.Error,appName)})
this._infoNotifySub = this._notificationServices.InfoNotify.subscribe((appName) =>{this.showDialogMsgBox(NotificationType.Info,appName)})
this._warnNotifySub = this._notificationServices.warningNotify.subscribe((appName) =>{this.showDialogMsgBox(NotificationType.Warning,appName)})
this._closeProcessSub = this._runningProcessService.closeProcessNotify.subscribe((p) =>{this.onCloseBtnClicked(p)})
this._closeMsgDialogSub = this._notificationServices.closeDialogBoxNotify.subscribe((i) =>{this.closeDialogMsgBox(i)})
this._closeMsgDialogSub = this._notificationServices.closeDialogBoxNotify.subscribe((i) =>{this.closeDialogMsgBoxOrPropertiesView(i)})
this._showPropertiesViewSub = this._menuService.showPropertiesView.subscribe((p) => this.showPropertiesWindow(p));
this._closePropertiesViewSub = this._menuService.closePropertiesView.subscribe((p) => this.closeDialogMsgBoxOrPropertiesView(p));
this._runningProcessService.addProcess(this.getComponentDetail());

this._appDirectory = new AppDirectory();
Expand All @@ -127,16 +140,21 @@ export class AppComponent implements OnDestroy, AfterViewInit {
this._appIsRunningSub?.unsubscribe();
this._errorNotifySub?.unsubscribe();
this._infoNotifySub?.unsubscribe();
this._warnNotifySub?.unsubscribe();
this._showPropertiesViewSub?.unsubscribe();
this._closePropertiesViewSub?.unsubscribe();
}

ngAfterViewInit():void{
// This quiets the - Expression has changed after it was checked.
//TODO: change detection is the better solution TBD
setTimeout(()=> {
const priorSessionInfo = this.fetchPriorSessionInfo();
const sessionKeys = this.getSessionKey(priorSessionInfo);
this.restorePriorSession(sessionKeys);
setTimeout(()=> {
const priorSessionInfo = this.fetchPriorSessionInfo();
const sessionKeys = this.getSessionKey(priorSessionInfo);
this.restorePriorSession(sessionKeys);
}, this.SECONDS_DELAY[0]);

//this.showPropertiesWindow();
}

async loadApps(appName:string):Promise<void>{
Expand Down Expand Up @@ -165,10 +183,20 @@ export class AppComponent implements OnDestroy, AfterViewInit {
}else if(dialogMsgType === NotificationType.Info){
componentRef.setInput('inputMsg', msg);
componentRef.setInput('notificationType', dialogMsgType);
}else{
componentRef.setInput('inputMsg', msg);
componentRef.setInput('notificationType', dialogMsgType);
}
}

private closeDialogMsgBox(dialogId:number):void{
private showPropertiesWindow(fileInput:FileInfo):void{
const componentRef = this.itemViewContainer.createComponent(PropertiesComponent);
const propertyId = componentRef.instance.propertyId;
this._componentReferenceService.addComponentReference(propertyId, componentRef);
componentRef.setInput('fileInput',fileInput);
}

private closeDialogMsgBoxOrPropertiesView(dialogId:number):void{
const componentToDelete = this._componentReferenceService.getComponentReference(dialogId);
this._componentRefView = componentToDelete.hostView;
const iVCntr = this.itemViewContainer.indexOf(this._componentRefView);
Expand Down
8 changes: 6 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import { DesktopComponent } from './system-apps/desktop/desktop.component';
import { TaskbarComponent } from './system-apps/taskbar/taskbar.component';
import { ClockComponent } from './system-apps/clock/clock.component';
import { StartButtonComponent } from './system-apps/startbutton/startbutton.component';
import { StartMenuComponent } from './system-apps/startmenu/startmenu.component';
import { TaskBarPreviewComponent } from './system-apps/taskbarpreview/taskbarpreview.component';
import { TaskBarEntriesComponent } from './system-apps/taskbarentries/taskbarentries.component';
import { TaskBarEntryComponent } from './system-apps/taskbarentry/taskbarentry.component';
import { FileExplorerComponent } from './system-apps/fileexplorer/fileexplorer.component';
import { WindowComponent } from './system-apps/window/window.component';
import { WindowComponent } from './shared/system-component/window/window.component';
import { FileManagerComponent } from './system-apps/filemanager/filemanager.component';
import { GreetingComponent } from './user-apps/greeting/greeting.component';
import { TaskmanagerComponent } from './system-apps/taskmanager/taskmanager.component';
Expand All @@ -33,11 +34,12 @@ import { DialogComponent } from './shared/system-component/dialog/dialog.compone
import { CodeEditorComponent } from './user-apps/codeeditor/codeeditor.component';
import { PropertiesComponent } from './shared/system-component/properties/properties.component';
import { MarkDownViewerComponent } from './user-apps/markdownviewer/markdownviewer.component';
import { FileTreeViewComponent } from './shared/system-component/filetreeview/filetreeview.component';

import { SafeUrlPipe } from './shared/system-pipes/safe.resource.url.pipe';
import { TruncatePipe } from './shared/system-pipes/string.shorten.pipe';

import { HighlightDirective } from './system-apps/window/window.btn.highlight.directives';
import { HighlightDirective } from './shared/system-component/window/window.btn.highlight.directives';
import { TaskBarEntryHighlightDirective } from './system-apps/taskbarentries/taskbar.entry.highlight.directives';
import { LongPressDirective } from './system-apps/audioplayer/long.press.directive';
import { ColumnResizeDirective } from './system-apps/taskmanager/taskmanager.column-resize.directive';
Expand All @@ -52,6 +54,7 @@ import { KeyPressCaptureDirective } from './system-apps/terminal/key.press.captu
TaskbarComponent,
ClockComponent,
StartButtonComponent,
StartMenuComponent,
TaskBarPreviewComponent,
TaskBarEntriesComponent,
TaskBarEntryComponent,
Expand All @@ -73,6 +76,7 @@ import { KeyPressCaptureDirective } from './system-apps/terminal/key.press.captu
DialogComponent,
CodeEditorComponent,
MarkDownViewerComponent,
FileTreeViewComponent,


HighlightDirective,
Expand Down
Loading

0 comments on commit b95f886

Please sign in to comment.