1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

feat(Notepad): add notepad desktop entry & IPC commands file handling

This commit is contained in:
purian23
2026-07-04 16:10:56 -04:00
parent bfda5f2d66
commit 81a4d3b4e0
23 changed files with 129 additions and 1 deletions
+19
View File
@@ -212,6 +212,25 @@ Item {
});
}
function openExternalFile(path) {
if (!path)
return;
for (var i = 0; i < NotepadStorageService.tabs.length; i++) {
var tab = NotepadStorageService.tabs[i];
if (tab && !tab.isTemporary && tab.filePath === path) {
textEditor.autoSaveToSession();
switchToTab(i);
return;
}
}
textEditor.autoSaveToSession();
NotepadStorageService.createTabForFile(path);
root.currentFileName = path.split('/').pop();
root.currentFileUrl = "file://" + path;
}
function loadFromFile(fileUrl) {
if (hasUnsavedChanges()) {
root.pendingFileUrl = fileUrl;