-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemsTreeModule.lua
58 lines (43 loc) · 1.21 KB
/
ItemsTreeModule.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
local SModule = require('StateModule');
local Utils = require('common/Utils');
local fm = require("FilesModule");
local sm = require("SourcesModule");
local WManager = require('WindowsManager');
local STree = require('common/SortableTree');
local itm = SModule:subclass("ItemsTree");
itm.tree = STree(fm);
itm.playing = 0;
function itm:initialize(id)
SModule.initialize(self);
self.id = id;
WManager:register(self);
end
function itm:windowContent()
if fm.currentItem ~= nil then
Slab.Text(tostring(fm.currentItem));
else
Slab.Text("Click on file item to make it active.");
end
if sm.currentItem ~= nil then
Slab.Text(tostring(sm.currentItem));
else
Slab.Text("Click on source item to make it active.");
end
self.tree:Update();
Slab.Text("Playing now: "..tostring(sm.playing));
end
function itm:windowTitle()
return "Items tree";
end
function itm:DumpState()
local data = self:DumpSubmodulesState();
-- Utils.Dump(data.sources, 10);
return data;
end
function itm:LoadState(data)
if data == nil then return end
self:SetLoadPhase(true);
self:LoadSubmodulesState(data);
self:SetLoadPhase(false);
end
return itm("ItemsTree");