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:
@@ -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;
|
||||
|
||||
@@ -9,6 +9,7 @@ FloatingWindow {
|
||||
id: win
|
||||
|
||||
property alias shouldBeVisible: win.visible
|
||||
property alias notepad: notepad
|
||||
|
||||
function show() {
|
||||
visible = true;
|
||||
|
||||
Reference in New Issue
Block a user