Back to index

unity  6.0.0
Public Member Functions | Static Public Attributes | Private Member Functions
unity.emulators.dash.FilterBar Class Reference
Inheritance diagram for unity.emulators.dash.FilterBar:
Inheritance graph
[legend]
Collaboration diagram for unity.emulators.dash.FilterBar:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def get_num_filters
def get_focused_filter
def expanded
def ensure_expanded
def ensure_collapsed

Static Public Attributes

string DBUS_SERVICE = "com.canonical.Unity"
string DBUS_OBJECT = "/com/canonical/Unity/Debug"

Private Member Functions

def _get_searchbar

Detailed Description

A filterbar, as shown inside a lens.

Definition at line 242 of file dash.py.


Member Function Documentation

Get the searchbar.

This hack exists because there's now more than one SearchBar in Unity,
and for some reason the FilterBar stuff is bundled in the SearchBar.

Definition at line 287 of file dash.py.

00287 
00288     def _get_searchbar(self):
00289         """Get the searchbar.
00290 
00291         This hack exists because there's now more than one SearchBar in Unity,
00292         and for some reason the FilterBar stuff is bundled in the SearchBar.
00293 
00294         """
00295         searchbar_state = self.get_state_by_path("//DashView/SearchBar")
00296         assert(len(searchbar_state) == 1)
00297         return make_introspection_object(searchbar_state[0])
00298 

Here is the caller graph for this function:

Collapse the filter bar, if it's not already.

Definition at line 276 of file dash.py.

00276 
00277     def ensure_collapsed(self):
00278         """Collapse the filter bar, if it's not already."""
00279         if self.expanded:
00280             searchbar = self._get_searchbar()
00281             tx = searchbar.filter_label_x + (searchbar.filter_label_width / 2)
00282             ty = searchbar.filter_label_y + (searchbar.filter_label_height / 2)
00283             m = Mouse()
00284             m.move(tx, ty)
00285             m.click()
00286             self.expanded.wait_for(False)

Here is the call graph for this function:

Expand the filter bar, if it's not already.

Definition at line 265 of file dash.py.

00265 
00266     def ensure_expanded(self):
00267         """Expand the filter bar, if it's not already."""
00268         if not self.expanded:
00269             searchbar = self._get_searchbar()
00270             tx = searchbar.filter_label_x + (searchbar.filter_label_width / 2)
00271             ty = searchbar.filter_label_y + (searchbar.filter_label_height / 2)
00272             m = Mouse()
00273             m.move(tx, ty)
00274             m.click()
00275             self.expanded.wait_for(True)

Here is the call graph for this function:

Return True if the filterbar on this lens is expanded, False otherwise.

Definition at line 259 of file dash.py.

00259 
00260     def expanded(self):
00261         """Return True if the filterbar on this lens is expanded, False otherwise.
00262         """
00263         searchbar = self._get_searchbar()
00264         return searchbar.showing_filters

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the id of the focused filter widget.

Definition at line 250 of file dash.py.

00250 
00251     def get_focused_filter(self):
00252         """Returns the id of the focused filter widget."""
00253         filters = self.get_children_by_type(FilterExpanderLabel)
00254         for filter_label in filters:
00255             if filter_label.expander_has_focus:
00256                 return filter_label
00257         return None

Get the number of filters in this filter bar.

Definition at line 245 of file dash.py.

00245 
00246     def get_num_filters(self):
00247         """Get the number of filters in this filter bar."""
00248         filters = self.get_children_by_type(FilterExpanderLabel)
00249         return len(filters)


Member Data Documentation

string unity.emulators.UnityIntrospectionObject.DBUS_OBJECT = "/com/canonical/Unity/Debug" [static, inherited]

Definition at line 19 of file __init__.py.

string unity.emulators.UnityIntrospectionObject.DBUS_SERVICE = "com.canonical.Unity" [static, inherited]

Definition at line 18 of file __init__.py.


The documentation for this class was generated from the following file: