From b6fb1984add5d1fbc08686d510d6aa46efa7f3bd Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 11 Jun 2007 20:10:31 +0000 Subject: add support for hotplug partitions. partitions/filesystems are dynamically added and removed by an external plugin. --- lib/python/Components/FileList.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/python/Components/FileList.py') diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index 3091436f..09756e3c 100644 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -190,3 +190,16 @@ class FileList(MenuList, HTMLComponent, GUIComponent): def postWidgetCreate(self, instance): instance.setContent(self.l) + + def execBegin(self): + harddiskmanager.on_partition_list_change.append(self.partitionListChanged) + + def execEnd(self): + harddiskmanager.on_partition_list_change.remove(self.partitionListChanged) + + def refresh(self): + self.changeDir(self.current_directory, self.getFilename()) + + def partitionListChanged(self, action, device): + if self.current_directory is None: + self.refresh() -- cgit v1.2.3