From c7e4389d3bbb01cbf8ce57282757cb0853f023e2 Mon Sep 17 00:00:00 2001 From: AndresRohr Date: Sat, 6 Apr 2024 15:36:30 +0700 Subject: [PATCH] Dream Explorer ViewEnd function, saving current dir, bigger width - vEditor2: Added a View End function when pressing blue button. Specially useful for very long log files where the important stuff is at the end - vEditor2: Wider display on wide screens >= 1920 - Saving the last current directory when leaving Dream Explorer --- dreamexplorer/src/plugin.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/dreamexplorer/src/plugin.py b/dreamexplorer/src/plugin.py index b16231d3e..65f145c0c 100644 --- a/dreamexplorer/src/plugin.py +++ b/dreamexplorer/src/plugin.py @@ -720,6 +720,12 @@ def searchMusic(self): return slist,foundIndex def exitPlugin(self): + # Save the current directory as start dir + currentDir = self["filelist"].getCurrentDirectory() + if currentDir is not None: + config.plugins.DreamExplorer.startDir.value = currentDir + config.plugins.DreamExplorer.startDir.save() + self.close() ######## DREAM-EXPLORER END ####################### @@ -924,11 +930,11 @@ def saveBookmarks(self): class vEditor2(Screen): if getDesktop(0).size().width()>=1920: skin = """ - - + + {"template":[ - MultiContentEntryText(pos=(0,0), size=(900,35), text=0), ], + MultiContentEntryText(pos=(0,0), size=(1880,35), text=0), ], "fonts": [gFont("Regular",30)], "itemHeight": 35 } @@ -941,6 +947,7 @@ class vEditor2(Screen): + @@ -952,7 +959,7 @@ class vEditor2(Screen): {"template":[ - MultiContentEntryText(pos=(0,0), size=(900,30), text=0), ], + MultiContentEntryText(pos=(0,0), size=(1200,30), text=0), ], "fonts": [gFont("Regular",18)], "itemHeight": 25 } @@ -984,6 +991,7 @@ def __init__(self, session, filename): "red": self.deleteLine, "green": self.addLine, "yellow": self.editLine, + "blue": self.viewEnd, }, -1) self.lineIndex = 0 @@ -1009,6 +1017,10 @@ def deleteLine(self): self["filedata"].updateList(self.list) self.isChanged = True + def viewEnd(self): + if len(self.list) > 0: + self["filedata"].setCurrentIndex(len(self.list)-1) + def exitEditor(self): if self.isChanged: msg = self.session.openWithCallback(self.saveFile, MessageBox, _("You have changed %s. Do you want to save your changes?" %(self.filename)), MessageBox.TYPE_YESNO, windowTitle=_("Dream Explorer 3")) @@ -1495,4 +1507,4 @@ def runFinished(self, retval): self.run += 1 if self.run < len(self.cmdList) and self.run