/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to revisionmenu.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 19:07:23 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: jelmer@samba.org-20080629190723-l8mzg9x4oec0lhsl
Return cleartext from seahorse module

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
import bzrlib
25
25
import gtk
 
26
import gobject
26
27
from bzrlib import (errors, ui)
27
28
from bzrlib.revision import NULL_REVISION
28
29
 
29
30
class RevisionPopupMenu(gtk.Menu):
 
31
 
 
32
    __gsignals__ = {
 
33
            'tag-added': (
 
34
                gobject.SIGNAL_RUN_FIRST,
 
35
                gobject.TYPE_NONE,
 
36
                (gobject.TYPE_STRING, gobject.TYPE_STRING)
 
37
            )
 
38
    }
 
39
 
30
40
    def __init__(self, repository, revids, branch=None, wt=None):
31
41
        super(RevisionPopupMenu, self).__init__()
32
42
        self.branch = branch
37
47
 
38
48
    def create_items(self):
39
49
        if len(self.revids) == 1:
40
 
            item = gtk.MenuItem("View _Diff")
 
50
            item = gtk.MenuItem("View _Changes")
41
51
            item.connect('activate', self.show_diff)
42
52
            self.append(item)
43
53
            self.show_all()
86
96
    def show_push(self, item):
87
97
        from bzrlib.plugins.gtk.push import PushDialog
88
98
        dialog = PushDialog(self.repository, self.revids[0], self.branch)
89
 
        dialog.run()
 
99
        response = dialog.run()
 
100
 
 
101
        if response != gtk.RESPONSE_NONE:
 
102
            dialog.destroy()
90
103
 
91
104
    def show_tag(self, item):
92
105
        from bzrlib.plugins.gtk.tags import AddTagDialog
93
106
        dialog = AddTagDialog(self.repository, self.revids[0], self.branch)
94
107
        response = dialog.run()
 
108
 
95
109
        if response != gtk.RESPONSE_NONE:
96
110
            dialog.hide()
97
111
        
98
112
            if response == gtk.RESPONSE_OK:
99
 
                self.branch.lock_write()
100
 
                self.branch.tags.set_tag(dialog.tagname, dialog._revid)
101
 
                self.branch.unlock()
 
113
                self.emit('tag-added', dialog.tagname, dialog._revid)
102
114
            
103
115
            dialog.destroy()
104
116