~ubuntu-branches/ubuntu/vivid/blueman/vivid-proposed

« back to all changes in this revision

Viewing changes to blueman/gui/manager/ManagerStats.py

  • Committer: Package Import Robot
  • Author(s): Artur Rona
  • Date: 2014-12-24 18:33:36 UTC
  • mfrom: (2.3.8 sid)
  • Revision ID: package-import@ubuntu.com-20141224183336-cyb82ot0y8tz8flq
Tags: 1.99~alpha1-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - debian/patches/01_dont_autostart_lxde.patch:
    + Don't autostart the applet in LXDE.
  - debian/patches/03_filemanager_fix.patch:
    + Add support for more filemanagers.
* debian/patches/02_dont_crash_on_non-bluetooth_card.patch:
  - Dropped, no longer applicable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import blueman.Lib as Lib
2
 
import gobject
3
 
import gtk
 
2
from gi.repository import GObject
 
3
from gi.repository import Gtk
4
4
 
5
5
from blueman.gui.Animation import Animation
6
6
from blueman.main.SpeedCalc import SpeedCalc
18
18
        blueman.List.connect("adapter-changed", self.on_adapter_changed)
19
19
 
20
20
        if blueman.List.Adapter:
21
 
            self.hci = adapter_path_to_name(blueman.List.Adapter.GetObjectPath())
 
21
            self.hci = adapter_path_to_name(blueman.List.Adapter.get_object_path())
22
22
        else:
23
23
            self.hci = None
24
24
 
29
29
 
30
30
        up = get_icon("blueman-up-inactive", 15)
31
31
        down = get_icon("blueman-down-inactive", 15)
32
 
        self.im_upload = gtk.Image()
 
32
        self.im_upload = Gtk.Image()
33
33
        self.im_upload.set_tooltip_text(_("Data activity indication"))
34
34
        self.im_upload.set_from_pixbuf(up)
35
 
        self.im_download = gtk.Image()
 
35
        self.im_download = Gtk.Image()
36
36
        self.im_download.set_tooltip_text(_("Data activity indication"))
37
37
        self.im_download.set_from_pixbuf(down)
38
38
        self.im_upload.set_alignment(1, 0.5)
39
39
        self.im_download.set_alignment(1, 0.5)
40
40
 
41
 
        self.down_rate = gtk.Label()
 
41
        self.down_rate = Gtk.Label()
42
42
        self.down_rate.show()
43
43
        self.down_rate.set_alignment(1, 0.5)
44
44
        self.down_rate.set_tooltip_text(_("Total data received and rate of transmission"))
45
45
 
46
 
        self.up_rate = gtk.Label()
 
46
        self.up_rate = Gtk.Label()
47
47
        self.up_rate.show()
48
48
        self.up_rate.set_alignment(1, 0.5)
49
49
        self.up_rate.set_tooltip_text(_("Total data sent and rate of transmission"))
50
50
 
51
 
        self.uparrow = gtk.Image()
 
51
        self.uparrow = Gtk.Image()
52
52
        self.uparrow.set_tooltip_text(_("Total data sent and rate of transmission"))
53
 
        self.uparrow.set_from_stock(gtk.STOCK_GO_UP, 1)
 
53
        self.uparrow.set_from_stock(Gtk.STOCK_GO_UP, 1)
54
54
        self.uparrow.set_alignment(1, 0.5)
55
55
 
56
 
        self.downarrow = gtk.Image()
 
56
        self.downarrow = Gtk.Image()
57
57
        self.downarrow.set_tooltip_text(_("Total data received and rate of transmission"))
58
 
        self.downarrow.set_from_stock(gtk.STOCK_GO_DOWN, 1)
 
58
        self.downarrow.set_from_stock(Gtk.STOCK_GO_DOWN, 1)
59
59
 
60
60
        self.hbox = hbox = blueman.Builder.get_object("statusbar2")
61
61
 
62
 
        hbox.pack_start(self.uparrow, True, False)
63
 
        hbox.pack_start(self.up_rate, False, False)
64
 
 
65
 
        hbox.pack_start(self.downarrow, False, False)
66
 
        hbox.pack_start(self.down_rate, False, False)
67
 
 
68
 
        hbox.pack_start(gtk.VSeparator(), False, False)
69
 
 
70
 
        hbox.pack_start(self.im_upload, False, False)
71
 
        hbox.pack_start(self.im_download, False, False)
 
62
        hbox.pack_start(self.uparrow, True, False, 0)
 
63
        hbox.pack_start(self.up_rate, False, False, 0)
 
64
 
 
65
        hbox.pack_start(self.downarrow, False, False, 0)
 
66
        hbox.pack_start(self.down_rate, False, False, 0)
 
67
 
 
68
        hbox.pack_start(Gtk.VSeparator(), False, False, 0)
 
69
 
 
70
        hbox.pack_start(self.im_upload, False, False, 0)
 
71
        hbox.pack_start(self.im_download, False, False, 0)
72
72
        hbox.show_all()
73
73
        self.on_adapter_changed(blueman.List, blueman.List.GetAdapterPath())
74
74
 
138
138
 
139
139
    def start_update(self):
140
140
        self._update()
141
 
        self.timer = gobject.timeout_add(1000, self._update)
 
141
        self.timer = GObject.timeout_add(1000, self._update)
142
142
 
143
143
    def stop_update(self):
144
144
        if self.timer:
145
 
            gobject.source_remove(self.timer)
 
145
            GObject.source_remove(self.timer)
146
146
 
147
147
    def set_data(self, uploaded, u_name, downloaded, d_name, u_speed, us_name, d_speed, ds_name):
148
148
        self.down_rate.set_markup(