~mrooney/ecryptfs/nautilus-integration

« back to all changes in this revision

Viewing changes to src/python/nautilus/storage.py

  • Committer: Michael Rooney
  • Date: 2009-05-28 08:34:35 UTC
  • Revision ID: mrooney@ubuntu.com-20090528083435-zk6i6sgzv9oasqdx
added small lock icons and use them in the nautilus banner

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 
35
35
from ecryptfs import ecryptapi
36
36
 
 
37
LOCK_SECURE_SMALL = os.path.join(os.getcwd(), "ecryptfs/nautilus/lock-secure-small.png")
 
38
LOCK_INSECURE_SMALL = os.path.join(os.getcwd(), "ecryptfs/nautilus/lock-insecure-small.png")
 
39
 
37
40
class StorageBar(gtk.HBox):
38
41
    """The storage bar widget."""
39
42
 
46
49
        self.__label.show()
47
50
        self.add(self.__label)
48
51
        self.__button = gtk.Button()
 
52
        self.__button.set_property("image-position", gtk.POS_LEFT)
49
53
        self.__button.connect("clicked", self.__toggle_state)
50
54
        self.__button.show()
 
55
        self.__button_image = gtk.Image()
51
56
        self.pack_end(self.__button, expand=False, fill=False)
52
57
        self.__path = path
53
58
        self.__mounted = None
66
71
        """Update the label, and button when connection status changes."""
67
72
        self.__mounted = ecryptapi.getMounted()
68
73
        if self.__mounted:
69
 
            self.__button.set_label("Lock directory")
 
74
            label = "Lock directory"
 
75
            img = LOCK_SECURE_SMALL
70
76
        else:
71
 
            self.__button.set_label("Unlock directory")
 
77
            label = "Unlock directory"
 
78
            img = LOCK_INSECURE_SMALL
 
79
 
 
80
        self.__button_image.set_from_file(img)
 
81
        self.__button.set_image(self.__button_image)
 
82
        self.__button.set_label(label)
72
83
 
73
84
 
74
85
def is_storagefs(path):