File AppWindow.xml changed (mode: 100755) (index 688580a..2256855) |
15 |
15 |
<item/> |
<item/> |
16 |
16 |
<item id="menu_hide" notify="selected" shortcut="H">Hide all</item> |
<item id="menu_hide" notify="selected" shortcut="H">Hide all</item> |
17 |
17 |
<item id="menu_expand" notify="selected">Expand all</item> |
<item id="menu_expand" notify="selected">Expand all</item> |
18 |
|
<item id="menu_save" notify="selected" shortcut="S">Save arragement</item> |
|
|
18 |
|
<!-- <item id="menu_save" notify="selected" shortcut="S">Save arragement</item> --> |
19 |
19 |
<item/> |
<item/> |
20 |
20 |
<item id="menu_fetchall" notify="selected" shortcut="F">Fetch all</item> |
<item id="menu_fetchall" notify="selected" shortcut="F">Fetch all</item> |
21 |
21 |
</menu> |
</menu> |
|
35 |
35 |
<item/> |
<item/> |
36 |
36 |
<item id="fdtm_hide" notify="selected">Hide all</item> |
<item id="fdtm_hide" notify="selected">Hide all</item> |
37 |
37 |
<item id="fdtm_expand" notify="selected">Expand all</item> |
<item id="fdtm_expand" notify="selected">Expand all</item> |
38 |
|
<item id="fdtm_save" notify="selected">Save arragement</item> |
|
|
38 |
|
<!-- <item id="fdtm_save" notify="selected">Save arragement</item>--> |
39 |
39 |
<item/> |
<item/> |
40 |
40 |
<item id="fdtm_fetch" notify="selected">Fetch current</item> |
<item id="fdtm_fetch" notify="selected">Fetch current</item> |
41 |
41 |
<item id="fdtm_fetchall" notify="selected">Fetch all</item> |
<item id="fdtm_fetchall" notify="selected">Fetch all</item> |
File IvoRSS.hws changed (mode: 100755) (index ba15c31..4c0cfe6) |
12 |
12 |
|
|
13 |
13 |
@FILE 1, "AppWindow.xml" |
@FILE 1, "AppWindow.xml" |
14 |
14 |
|
|
15 |
|
@INCLUDE "feeds.hws" |
|
|
15 |
|
; Generates default feeds |
|
16 |
|
; and puts to feeds.json |
|
17 |
|
;@INCLUDE "feeds.hws" |
|
18 |
|
|
16 |
19 |
@INCLUDE "feedtree.hws" |
@INCLUDE "feedtree.hws" |
17 |
20 |
|
|
18 |
21 |
@BRUSH 1, "128px-Feed-icon.png", {LoadAlpha=True, ScaleHeight=32, ScaleWidth=32} |
@BRUSH 1, "128px-Feed-icon.png", {LoadAlpha=True, ScaleHeight=32, ScaleWidth=32} |
|
... |
... |
Function p_MUIEvent(msg) |
33 |
36 |
Case "Window": |
Case "Window": |
34 |
37 |
Switch msg.Attribute |
Switch msg.Attribute |
35 |
38 |
Case "CloseRequest": |
Case "CloseRequest": |
36 |
|
End |
|
|
39 |
|
p_SaveFeeds() |
|
40 |
|
End |
37 |
41 |
EndSwitch |
EndSwitch |
38 |
42 |
Case "Menuitem": |
Case "Menuitem": |
39 |
43 |
Switch msg.ID |
Switch msg.ID |
|
... |
... |
Function p_MUIEvent(msg) |
45 |
49 |
Case "menu_about_muiroyale": |
Case "menu_about_muiroyale": |
46 |
50 |
mui.DoMethod("app", "AboutMUIRoyale") |
mui.DoMethod("app", "AboutMUIRoyale") |
47 |
51 |
Case "menu_quit": |
Case "menu_quit": |
|
52 |
|
p_SaveFeeds() |
48 |
53 |
End |
End |
49 |
54 |
Case "menu_muisettings": |
Case "menu_muisettings": |
50 |
55 |
mui.DoMethod("app", "OpenConfigWindow") |
mui.DoMethod("app", "OpenConfigWindow") |
|
... |
... |
EndFunction |
119 |
124 |
|
|
120 |
125 |
;č stáhnout soubor |
;č stáhnout soubor |
121 |
126 |
Function p_Download(url$, filename$) |
Function p_Download(url$, filename$) |
122 |
|
err_code, _empty_str$, count = ?DownloadFile(url$, |
|
|
127 |
|
Local err_code, _empty_str$, count = ?DownloadFile(url$, |
123 |
128 |
{File=filename$, Adapter = "hurl", Fail404=True, Encoded=True}, |
{File=filename$, Adapter = "hurl", Fail404=True, Encoded=True}, |
124 |
129 |
p_callback, url$) |
p_callback, url$) |
125 |
130 |
p_Replay(err_code, count .. "bytes from " .. url$ .. " transmitted") |
p_Replay(err_code, count .. "bytes from " .. url$ .. " transmitted") |
126 |
131 |
CheckEvents() ; keep MUI even more responsive |
CheckEvents() ; keep MUI even more responsive |
|
132 |
|
Return(err_code) |
127 |
133 |
EndFunction |
EndFunction |
128 |
134 |
|
|
129 |
135 |
|
|
|
... |
... |
Function p_CopyText() |
161 |
167 |
p_Replay(err_code, "Text is copied") |
p_Replay(err_code, "Text is copied") |
162 |
168 |
EndFunction |
EndFunction |
163 |
169 |
|
|
164 |
|
mui.CreateGUI(ReadString(1)) |
|
165 |
|
InstallEventHandler({MUIRoyale = p_MUIEvent}) |
|
166 |
170 |
|
|
167 |
171 |
|
|
168 |
|
Function p_SaveFeeds() |
|
169 |
|
cFeeds = p_DumpFeedTree("feedtree") |
|
170 |
|
prf = {feeds=cFeeds, feedsdata={}} |
|
171 |
|
err_code = ?SavePrefs(prf) |
|
172 |
|
p_Replay(err_code, "Tree arrangement saved") |
|
|
172 |
|
|
|
173 |
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
|
Function p_StartUpLoading() |
|
177 |
|
; default feeds are generated by feeds.hws |
|
178 |
|
Local err_code, s$, _len = ?FileToString("feeds.json") |
|
179 |
|
p_Replay(err_code, "Program started") |
|
180 |
|
|
|
181 |
|
err_code = ?p_FillListTree("feedtree", DeserializeTable(s$)) |
|
182 |
|
p_Replay(err_code, "Feeds are imported") |
|
183 |
|
|
|
184 |
|
feedsdata = {} ; Global |
|
185 |
|
err_code = ?LoadPrefs(feedsdata) |
|
186 |
|
p_Replay(err_code, "Settings loaded") |
173 |
187 |
EndFunction |
EndFunction |
174 |
188 |
|
|
|
189 |
|
|
|
190 |
|
Function p_SaveFeeds() |
|
191 |
|
Local err_code = ?StringToFile(SerializeTable( |
|
192 |
|
p_DumpFeedTree("feedtree")), "feeds.json") |
|
193 |
|
p_Replay(err_code, "Tree arrangement saved") |
175 |
194 |
|
|
|
195 |
|
err_code = ?SavePrefs(feedsdata) |
|
196 |
|
p_Replay(err_code, "Settings saved") |
|
197 |
|
EndFunction |
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
176 |
201 |
Function p_HideFeeds() |
Function p_HideFeeds() |
177 |
202 |
mui.DoMethod("feedtree", "close", "root", "all") |
mui.DoMethod("feedtree", "close", "root", "all") |
178 |
203 |
EndFunction |
EndFunction |
|
... |
... |
EndFunction |
199 |
224 |
|
|
200 |
225 |
|
|
201 |
226 |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
|
; dFeeds is imported from feeds.hws |
|
205 |
|
prf = {feeds=dFeeds, feedsdata={}} |
|
206 |
|
err_code = ?LoadPrefs(prf) |
|
207 |
|
p_Replay(err_code, "Program started") |
|
208 |
|
|
|
209 |
|
err_code = ?p_FillListTree("feedtree", prf.feeds) |
|
210 |
|
p_Replay(err_code, "Settings loaded") |
|
211 |
227 |
|
|
212 |
228 |
|
|
|
229 |
|
mui.CreateGUI(ReadString(1)) |
|
230 |
|
InstallEventHandler({MUIRoyale = p_MUIEvent}) |
213 |
231 |
|
|
|
232 |
|
p_StartUpLoading() |
214 |
233 |
|
|
215 |
|
|
|
216 |
|
|
|
217 |
|
|
|
|
234 |
|
DebugPrint(err_code) |
218 |
235 |
|
|
219 |
236 |
url$ = "https://www.powerpc-notebook.org/en/feed/" |
url$ = "https://www.powerpc-notebook.org/en/feed/" |
220 |
237 |
StartTimer(1) |
StartTimer(1) |
221 |
238 |
;DownloadFile(url$, {File = "Feeds/feed.xml", Adapter = "hurl"}) |
;DownloadFile(url$, {File = "Feeds/feed.xml", Adapter = "hurl"}) |
222 |
239 |
p_FetchFeed(url$, {}) |
p_FetchFeed(url$, {}) |
223 |
|
DebugPrint("This took", GetTimer(1), "ms") |
|
|
240 |
|
DebugPrint("This took", GetTimer(1), "ms", err_code) |
224 |
241 |
text$ = FileToString("feed.xml") |
text$ = FileToString("feed.xml") |
225 |
242 |
;mui.Set("textfield", "Text", text$) |
;mui.Set("textfield", "Text", text$) |
226 |
243 |
|
|