This repository was archived by the owner on Nov 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsynoSync.xojo_code
More file actions
321 lines (257 loc) · 15.8 KB
/
synoSync.xojo_code
File metadata and controls
321 lines (257 loc) · 15.8 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#tag Class
Protected Class synoSync
Inherits Application
#tag Event
Sub Open()
// Config Load
Dim cnlState as String
Dim chUpdate as String
Dim dDest as String
if Config.fileExists = true then
Config.addlog("Configuration loaded", "OK")
frm_main.txt_url.text = Config.get("url")
frm_main.txt_port.text = Config.get("port")
frm_main.txt_user.text = Config.get("username")
frm_main.txt_pw.text = Config.cryptGet("password")
chUpdate = Config.get("chkupdate")
cnlState = Config.get("cnl")
dDest = Config.get("destination")
if dDest = "true" then
frm_main.cb_downFolder.State = CheckBox.CheckedStates.Checked
frm_main.txt_downFolder.text = Config.get("downloadfolder")
frm_main.txt_downFolder.Enabled = true
else
frm_main.cb_downFolder.State = CheckBox.CheckedStates.Unchecked
frm_main.txt_downFolder.text = ""
frm_main.txt_downFolder.Enabled = false
end if
if chUpdate = "true" then
frm_main.cb_update.State = CheckBox.CheckedStates.Checked
else
Config.addlog("Update-Check done", "NOK")
frm_main.cb_update.State = CheckBox.CheckedStates.Unchecked
end if
if cnlState = "true" then
frm_main.cb_cnl.State = CheckBox.CheckedStates.Checked
else
frm_main.cb_cnl.State = CheckBox.CheckedStates.Unchecked
end if
else
frm_main.txt_url.text = "192.168.0.254"
frm_main.txt_port.text = "7878"
frm_main.txt_user.text = "admin"
frm_main.txt_pw.text = "admin"
frm_main.cb_update.State = CheckBox.CheckedStates.Checked
end if
// UpdateCheck
If frm_main.cb_update.Value then
Dim oVersion As new HTTPSocket
oVersion.Yield = True
Dim result As String = oVersion.get("http://updates.sys-worx.net/?app=synosync&version",10)
result = DefineEncoding(result, Encodings.UTF8)
System.DebugLog ("Online-Version: " + result)
oVersion.close
Config.addlog("Update-Check done","OK")
Config.addlog("Upate-Server Verion: " + result,"-")
dim int_result as double = val(result)
dim int_synoSync as double = val(synoSync.version)
if int_result > int_synoSync then
synoSync.onVersion = result
frm_update.Show
end if
end if
//CnL Server starten
if cnlState = "true" then
If cnl_server = Nil Then
cnl_server = New HttpServer
end if
cnl_server.port = 9666
cnl_server.MinimumSocketsAvailable = 10
cnl_server.listen
Config.addlog("Click'n'Load Server started", "OK")
end if
// MBS Cocoa
dim x as integer = 100
dim s as string = "MBS "
dim n as string = decodeBase64("some licence key", encodings.UTF8)
dim y as integer = -54
// MBS Encryption
dim xs as integer = 100
dim ss as string = "MBS "
dim ns as string = decodeBase64("some licence key", encodings.UTF8)
dim ys as integer = -47
if not registerMBSPlugin(ns, ss+"Encryption", 2016*xs+01, -4077043*xs+ys) then
MsgBox "MBS Plugin serial not valid?"
end if
if not registerMBSPlugin(n, s+"Cocoa", 2016*x+01, -1780059*x+y) then
MsgBox "MBS Plugin serial not valid?"
end if
// Sprache
mbi_about.Text = synoSync.lng_about_window
End Sub
#tag EndEvent
#tag MenuHandler
Function mbi_about() As Boolean Handles mbi_about.Action
frm_about.Show
Return True
End Function
#tag EndMenuHandler
#tag Property, Flags = &h21
Private cnl_server As HttpServer
#tag EndProperty
#tag Property, Flags = &h0
Shared onVersion As string
#tag EndProperty
#tag Property, Flags = &h0
Shared version As String = "0.9"
#tag EndProperty
#tag Constant, Name = kEditClear, Type = String, Dynamic = False, Default = \"&Delete", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"&Delete"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"&Delete"
#tag EndConstant
#tag Constant, Name = kFileQuit, Type = String, Dynamic = False, Default = \"&Quit", Scope = Public
#Tag Instance, Platform = Windows, Language = Default, Definition = \"E&xit"
#tag EndConstant
#tag Constant, Name = kFileQuitShortcut, Type = String, Dynamic = False, Default = \"", Scope = Public
#Tag Instance, Platform = Mac OS, Language = Default, Definition = \"Cmd+Q"
#Tag Instance, Platform = Linux, Language = Default, Definition = \"Ctrl+Q"
#tag EndConstant
#tag Constant, Name = lng_about_window, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"About synoSync"
#Tag Instance, Platform = Any, Language = de, Definition = \"\xC3\x9Cber synoSync"
#Tag Instance, Platform = Any, Language = Default, Definition = \"About synoSync"
#tag EndConstant
#tag Constant, Name = lng_btn_save, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Save"
#Tag Instance, Platform = Any, Language = de, Definition = \"Speichern"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Save"
#tag EndConstant
#tag Constant, Name = lng_btn_sendToDS, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"send to DS"
#Tag Instance, Platform = Any, Language = de, Definition = \"an DS senden"
#Tag Instance, Platform = Any, Language = Default, Definition = \"send to DS"
#tag EndConstant
#tag Constant, Name = lng_btn_upload, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"decrypt DLC"
#Tag Instance, Platform = Any, Language = de, Definition = \"DLC entschl\xC3\xBCsseln"
#Tag Instance, Platform = Any, Language = Default, Definition = \"decrypt DLC"
#tag EndConstant
#tag Constant, Name = lng_cb_cnl, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Activate Click\xE2\x80\x99n\xE2\x80\x99Load (experimental)"
#Tag Instance, Platform = Any, Language = de, Definition = \"Click\xC2\xB4n\xC2\xB4Load aktivieren (Experimentell)"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Activate Click\xE2\x80\x99n\xE2\x80\x99Load (experimental)"
#tag EndConstant
#tag Constant, Name = lng_cb_pw, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Password"
#Tag Instance, Platform = Any, Language = de, Definition = \"Passwort"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Password"
#tag EndConstant
#tag Constant, Name = lng_cb_update, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Check for updates at start"
#Tag Instance, Platform = Any, Language = de, Definition = \"Auf Updates pr\xC3\xBCfen beim starten"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Check for updates at start"
#tag EndConstant
#tag Constant, Name = lng_lbl_folder, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \"Download Folder:"
#Tag Instance, Platform = Any, Language = en, Definition = \"Download Folder:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Download-Verzeichnis:"
#tag EndConstant
#tag Constant, Name = lng_lbl_passwort, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Password:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Passwort:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Password:"
#tag EndConstant
#tag Constant, Name = lng_lbl_pw, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Please enter the password for the archived files in the DLC."
#Tag Instance, Platform = Any, Language = de, Definition = \"Bitte geben Sie hier das Passwort f\xC3\xBCr die im DLC archivierten Dateien an."
#Tag Instance, Platform = Any, Language = Default, Definition = \"Please enter the password for the archived files in the DLC."
#tag EndConstant
#tag Constant, Name = lng_lbl_supportus, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Support us:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Unterst\xC3\xBCtze uns:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Support us:"
#tag EndConstant
#tag Constant, Name = lng_lbl_title, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Update available"
#Tag Instance, Platform = Any, Language = de, Definition = \"Update verf\xC3\xBCgbar"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Update available"
#tag EndConstant
#tag Constant, Name = lng_lbl_url, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"DiskStation Address:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Adresse zur Diskstation:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"DiskStation Address:"
#tag EndConstant
#tag Constant, Name = lng_lbl_username, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Username:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Benutzername:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Username:"
#tag EndConstant
#tag Constant, Name = lng_lbl_version_load, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Download the update from here:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Lade das Update hier herunter:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Download the update from here:"
#tag EndConstant
#tag Constant, Name = lng_lbl_version_text, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"Current Version:"
#Tag Instance, Platform = Any, Language = de, Definition = \"Aktuelle Version:"
#Tag Instance, Platform = Any, Language = Default, Definition = \"Current Version:"
#tag EndConstant
#tag Constant, Name = lng_listbox_contex_remove, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \"Remove row(s)"
#Tag Instance, Platform = Any, Language = en, Definition = \"Remove row(s)"
#Tag Instance, Platform = Any, Language = de, Definition = \"Link(s) entfernen"
#tag EndConstant
#tag Constant, Name = lng_noLinks, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"There are no links available."
#Tag Instance, Platform = Any, Language = de, Definition = \"Es sind keine Links vorhanden."
#Tag Instance, Platform = Any, Language = Default, Definition = \"There are no links available."
#tag EndConstant
#tag Constant, Name = lng_noPW, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"There was no password specified!"
#Tag Instance, Platform = Any, Language = de, Definition = \"Es wurde kein Passwort angegeben!"
#Tag Instance, Platform = Any, Language = Default, Definition = \"There was no password specified!"
#tag EndConstant
#tag Constant, Name = lng_noResponse, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"The DiskStation is not responding\x2C maybe the ip address is wrong\?"
#Tag Instance, Platform = Any, Language = de, Definition = \"Die Diskstation antwortet nicht\x2C eventuell ist die IP-Adresse falsch\?"
#Tag Instance, Platform = Any, Language = Default, Definition = \"The DiskStation is not responding\x2C maybe the ip address is wrong\?"
#tag EndConstant
#tag Constant, Name = lng_notify_message_nok, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \"Could not add the link(s)\x2C please check the Debug-Log!"
#Tag Instance, Platform = Any, Language = en, Definition = \"Could not add the link(s)\x2C please check the Debug-Log!"
#Tag Instance, Platform = Any, Language = de, Definition = \"Fehler bei Link(s) hinzuf\xC3\xBCgen\x2C bitte kontrolliere das Debug-Log!"
#tag EndConstant
#tag Constant, Name = lng_notify_message_ok, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \" link(s) were added to the DownloadStation!"
#Tag Instance, Platform = Any, Language = en, Definition = \" link(s) were added to the DownloadStation!"
#Tag Instance, Platform = Any, Language = de, Definition = \" Link(s) zur DownloadStation hinzugef\xC3\xBCgt!"
#tag EndConstant
#tag Constant, Name = lng_notify_title_nok, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \"Link(s) not added"
#Tag Instance, Platform = Any, Language = en, Definition = \"Link(s) not added"
#Tag Instance, Platform = Any, Language = de, Definition = \"Link(s) nicht hinzugef\xC3\xBCgt"
#tag EndConstant
#tag Constant, Name = lng_notify_title_ok, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = Default, Definition = \"Link(s) successfully added"
#Tag Instance, Platform = Any, Language = en, Definition = \"Link(s) successfully added"
#Tag Instance, Platform = Any, Language = de, Definition = \"Link(s) erfolgreich hinzugef\xC3\xBCgt"
#tag EndConstant
#tag Constant, Name = lng_synoSyncRestart, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"For Click\'n\'Load synoSync have to be restarted."
#Tag Instance, Platform = Any, Language = de, Definition = \"F\xC3\xBCr Click\'n\'Load muss synoSync neugestartet werden."
#Tag Instance, Platform = Any, Language = Default, Definition = \"For Click\'n\'Load synoSync have to be restarted."
#tag EndConstant
#tag Constant, Name = lng_update_url, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"http://www.sys-worx.net/software/osx-synosync-en/"
#Tag Instance, Platform = Any, Language = de, Definition = \"http://www.sys-worx.net/software/osx-synosync/"
#Tag Instance, Platform = Any, Language = Default, Definition = \"http://www.sys-worx.net/software/osx-synosync-en/"
#tag EndConstant
#tag Constant, Name = lng_wrongLogin, Type = String, Dynamic = True, Default = \"", Scope = Public
#Tag Instance, Platform = Any, Language = en, Definition = \"The login failed\x2C incorrect login information were used."
#Tag Instance, Platform = Any, Language = de, Definition = \"Der Login ist fehlgeschlagen\x2C es wurden falsche Login-Informationen benutzt."
#Tag Instance, Platform = Any, Language = Default, Definition = \"The login failed\x2C incorrect login information were used."
#tag EndConstant
#tag ViewBehavior
#tag EndViewBehavior
End Class
#tag EndClass