savant-scenes 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/src/SceneManager.rb +66 -10
- data/bin/src/glade/SceneManager.glade +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 987323baa5624ba5887e615bbd19ff6a9740814d
|
4
|
+
data.tar.gz: d61c474930a4a5922eb01bd844e742629a73cec6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3be051879d402a93ad320e55be83b129fa7ac1582bddfaa79d50893d5aceaa1c2e46c533b08d3dbf691e5019eccae024b3243719bf48b7a2896480226fedef79
|
7
|
+
data.tar.gz: 69b56038c9a6ce04920f3f48f22fc11092be50ca309e1c1152ba94f961e454fd5e51b5df628dea7e89a7d2b89dbf992dddd72b52e08165abc0aefa8e00f7c6f1
|
data/bin/src/SceneManager.rb
CHANGED
@@ -21,7 +21,7 @@ class SceneManager
|
|
21
21
|
@listviewSavantScenes.col_title(:modify => "", :scene => "Scene Name", :tags => "Zones Affected", :isGlobal => "Global", :isActive => "Active", :isScheduled => "Scheduled", :hasCustomImage => "Custom Image", :userSceneOrder => "User Order")
|
22
22
|
@listviewSavantScenes.col_xalign(:isGlobal => 0.5, :isActive => 0.5, :isScheduled => 0.5, :hasCustomImage => 0.5, :userSceneOrder => 0.5)
|
23
23
|
@listviewSavantScenes.col_width(:tags => 100, :image => 100)
|
24
|
-
@listviewSavantScenes.ren_editable(:scene => true, :
|
24
|
+
@listviewSavantScenes.ren_editable(:scene => true, :user => true, :id => true)
|
25
25
|
|
26
26
|
row = @listviewSavantScenes.add_row
|
27
27
|
row[:scene] = ""
|
@@ -45,10 +45,10 @@ class SceneManager
|
|
45
45
|
text == "this is never going to validate"
|
46
46
|
}
|
47
47
|
|
48
|
-
#Validate
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
#Validate Actively Scheduled to only be a 0 or 1
|
49
|
+
# @listviewSavantScenes.renderer(:isScheduled).validate_block = Proc.new { |text, model_sym, row, view|
|
50
|
+
# text == "0" || text == "1"
|
51
|
+
# }
|
52
52
|
|
53
53
|
# Capture user name change, save to SQL, and transfer SQL to host
|
54
54
|
# @listviewSavantScenes.renderer(:user).edited_callback = Proc.new { |model_sym, row, view |
|
@@ -283,7 +283,6 @@ class SceneManager
|
|
283
283
|
editScenes = []
|
284
284
|
editIDs = []
|
285
285
|
editUsers = []
|
286
|
-
editActive = []
|
287
286
|
count = 0
|
288
287
|
@listviewSavantScenes.each_row do |row|
|
289
288
|
if row[:modify]
|
@@ -291,7 +290,6 @@ class SceneManager
|
|
291
290
|
editScenes << row[:scene]
|
292
291
|
editIDs << row[:id]
|
293
292
|
editUsers << row[:user]
|
294
|
-
editActive << row[:isActive]
|
295
293
|
end
|
296
294
|
end
|
297
295
|
#make sure a scene was selected, else alert the user
|
@@ -307,10 +305,9 @@ class SceneManager
|
|
307
305
|
stm.bind_param 2, id
|
308
306
|
stm.execute
|
309
307
|
stm.close
|
310
|
-
stm = @db.prepare( "update scenes set name
|
308
|
+
stm = @db.prepare( "update scenes set name=? where identifier=?" )
|
311
309
|
stm.bind_param 1, editScenes[count]
|
312
|
-
stm.bind_param 2,
|
313
|
-
stm.bind_param 3, id
|
310
|
+
stm.bind_param 2, id
|
314
311
|
stm.execute
|
315
312
|
stm.close
|
316
313
|
|
@@ -364,6 +361,65 @@ class SceneManager
|
|
364
361
|
alert("Please select at least 1 row to modify.", :parent => self)
|
365
362
|
end
|
366
363
|
end
|
364
|
+
|
365
|
+
# Delete the selected scenes
|
366
|
+
# def buttonDuplicateScene__clicked(*argv)
|
367
|
+
# get_glade_variables()
|
368
|
+
#
|
369
|
+
# duplicateIDs = []
|
370
|
+
# duplicateScenes = []
|
371
|
+
# duplicateUserss = []
|
372
|
+
# duplicateImages = []
|
373
|
+
# duplicateTags = []
|
374
|
+
# duplicateGlobals = []
|
375
|
+
# duplicateActives = []
|
376
|
+
# duplicateScheduled = []
|
377
|
+
# duplicateCustomImages = []
|
378
|
+
# duplicateSceneOrders = []
|
379
|
+
#
|
380
|
+
# count = 0
|
381
|
+
# @listviewSavantScenes.each_row do |row|
|
382
|
+
# if row[:modify]
|
383
|
+
# count += 1
|
384
|
+
# duplicateIDs << row[:id]
|
385
|
+
# duplicateScenes << row[:scene]
|
386
|
+
# duplicateUsers << row[:user]
|
387
|
+
# duplicateImages << row[:image]
|
388
|
+
# duplicateTags << row[:tags]
|
389
|
+
# duplicateGlobals << row[:isGlobal]
|
390
|
+
# duplicateActives << row[:isActive]
|
391
|
+
# duplicateScheduled << row[:isScheduled]
|
392
|
+
# duplicateCustomImages << row[:HasCustomImage]
|
393
|
+
# duplicateSceneOrders << row[:userSceneOrder]
|
394
|
+
# end
|
395
|
+
# end
|
396
|
+
# make sure a scene was selected, else alert the user
|
397
|
+
# if count > 0
|
398
|
+
# confirm the edits should be made
|
399
|
+
# strAlert = "Do you want to delete the following scenes from the Savant host?\n\n" + deleteScenes.join("\n")
|
400
|
+
# if alert(strAlert, :headline => "Delete Scenes?", :button_yes => "Delete", :button_cancel => "Cancel", :parent => self)
|
401
|
+
# edit the database with the updated info
|
402
|
+
# deleteIDs.each do |id|
|
403
|
+
# stm = @db.prepare( "delete from sceneusermap where sceneIdentifier=?" )
|
404
|
+
# stm.bind_param 1, id
|
405
|
+
# stm.execute
|
406
|
+
# stm.close
|
407
|
+
# stm = @db.prepare( "delete from scenes where identifier=?" )
|
408
|
+
# stm.bind_param 1, id
|
409
|
+
# stm.execute
|
410
|
+
# stm.close
|
411
|
+
# stm = @db.prepare( "delete from scenedefinitions where sceneIdentifier=?" )
|
412
|
+
# stm.bind_param 1, id
|
413
|
+
# stm.execute
|
414
|
+
# stm.close
|
415
|
+
# end
|
416
|
+
# updateDatabase()
|
417
|
+
# buttonScanHost__clicked()
|
418
|
+
# end
|
419
|
+
# else
|
420
|
+
# alert("Please select at least 1 row to modify.", :parent => self)
|
421
|
+
# end
|
422
|
+
# end
|
367
423
|
|
368
424
|
# #
|
369
425
|
# BACKUP AND RESTORE #
|
@@ -280,7 +280,7 @@
|
|
280
280
|
<property name="margin_top">12</property>
|
281
281
|
<property name="margin_bottom">12</property>
|
282
282
|
<property name="label" translatable="yes"> Savant scene manager copies the dashboard.sqlite file from the host to a temporary folder and lists all scenes from all users on that host.
|
283
|
-
You can backup and restore this database, as well as delete scenes or edit certain properties: Scene Name
|
283
|
+
You can backup and restore this database, as well as delete scenes or edit certain properties: Scene Name and user email.
|
284
284
|
|
285
285
|
If the host is running at least 8.3, you can also activate scenes.</property>
|
286
286
|
<property name="justify">center</property>
|