30
30
"""The Ubuntu One launcher icon."""
32
32
def __init__(self):
33
"""Initialize this instance."""
34
33
self.entry = Unity.LauncherEntry.get_for_desktop_id(U1_DOTDESKTOP)
36
35
def show_progressbar(self):
37
"""The progressbar is shown."""
38
self.entry.props.progress_visible = True
36
"""Show the progress bar."""
37
self.entry.set_property('progress_visible', True)
40
39
def hide_progressbar(self):
41
"""The progressbar is hidden."""
42
self.entry.props.progress_visible = False
40
"""Hide the progress bar."""
41
self.entry.set_property('progress_visible', False)
44
43
def set_progress(self, value):
45
"""The progressbar value is changed."""
46
self.entry.props.progress = value
44
"""Change progressbar value."""
45
self.entry.set_property('progress', value)
48
47
def set_urgent(self, value=True):
49
48
"""Set the launcher to urgent."""
50
self.entry.props.urgent = value
49
self.entry.set_property('urgent', value)
51
def set_count(self, value):
52
"""Set the count value."""
53
self.entry.set_property('count', value)
57
self.entry.set_property('count_visible', True)
61
self.entry.set_property('count_visible', False)
53
64
class DummyLauncher(object):
68
79
def set_urgent(self, value=True):
69
80
"""Set the launcher to urgent."""
82
def set_count(self, value):
83
"""Set the count value."""
72
92
UbuntuOneLauncher = UbuntuOneLauncherUnity if use_libunity else DummyLauncher