~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.findWidgets/contents/layout.js

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function findWidgetsIn(containment, type, callback)
 
2
{
 
3
    var widgetIds = containment.widgetIds
 
4
    for (id in widgetIds) {
 
5
        var widget = containment.widgetById(widgetIds[id])
 
6
            if (widget.type == type) {
 
7
                print("Found a " + type + " tray with id " + widget.id + " in " + containment.type + " with id " + containment.id)
 
8
                if (callback) {
 
9
                    callback(widget, containment)
 
10
                }
 
11
            }
 
12
    }
 
13
}
 
14
 
 
15
this.findWidgets = function(type, callback)
 
16
{
 
17
    for (i in panelIds) {
 
18
        findWidgetsIn(panelById(panelIds[i]), type, callback)
 
19
    }
 
20
 
 
21
    for (i in activityIds) {
 
22
        findWidgetsIn(activityById(activityIds[i]), type, callback)
 
23
    }
 
24
}
 
25