Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2010  |  syntax: None  |  size: 1.82 KB  |  hits: 23  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function generateConfig(widget)
  2. {
  3.     print("    {")
  4.     for (k in widget.configGroups) {
  5.       print("    widget.currentConfigGroup = '" + widget.configGroups[k] + "'")
  6.       widget.currentConfigGroup = widget.configGroups[k]
  7.       for (l in widget.configKeys) {
  8.         print("    widget.writeConfig('" + widget.configKeys[l] + "', '" + widget.readConfig(widget.configKeys[l]) + "')")
  9.       }
  10.     }
  11.    
  12.     for (k in widget.globalConfigGroups) {
  13.       print("    widget.globalCurrentConfigGroup = '" + widget.globalConfigGroups[k] + "'")
  14.       widget.globalCurrentConfigGroup = widget.globalConfigGroups[k]
  15.       for (l in widget.globalConfigGroups) {
  16.         print("    widget.writeConfig('" + widget.configKeys[l] + "', '" + widget.readConfig(widget.configKeys[l]) + "')")
  17.       }
  18.     }
  19.    
  20.     print("    }")
  21. }
  22.  
  23. function exportWidgets(containment)
  24. {
  25.     var widgets = containment.widgets()
  26.     if (widgets.length < 1) {
  27.       return;
  28.     }
  29.  
  30.     print('var widget')
  31.     for (j in widgets) {
  32.     var widget = widgets[j]
  33.     print('')
  34.     print("widget = panel.addWidget('" + widget.type + "')")
  35.     print('    # Generate configuration data')
  36.     generateConfig(widget)
  37.   }
  38. }
  39.  
  40. var a = activities()
  41. for (i in a) {
  42.   print('{')
  43.   print("var activity = new Activity('" + a[i].type + "')")
  44.   print('activity.screen = ' + a[i].screen)
  45.   print('activity.desktop = ' + a[i].desktop)
  46.   exportWidgets(a[i])
  47.   print('}')  
  48. }
  49.  
  50. var p = panels()
  51. for (i in p) {
  52.   //print("Name of panel " + p[i].id + " is " + p[i].type)
  53.   print('{')
  54.   print("var panel = new Panel('" + p[i].type + "')")
  55.   print('panel.location = ' + p[i].location)
  56.   //print("the relative width is: " +  (p[i].length / screenGeometry(p[i].screen).width))
  57.   print('panel.height = ' + p[i].height)
  58.   print('panel.length = ' + p[i].length)
  59.   print('panel.offset = ' + p[i].offset)
  60.   //exportWidgets(p[i])
  61.   print('}')
  62. }