/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: rodney.dawes at canonical
  • Date: 2008-10-25 06:02:09 UTC
  • Revision ID: rodney.dawes@canonical.com-20081025060209-irlizouino63cs1m
        * preferences/__init__.py:
        Remove the dialog separator
        Remove useless extra call to self._create_pages()
        Make the default window size smaller
        Set the default border width on various widgets
        Set the current notebook page to the first one

        * preferences/identity.py:
        Set various border widths appropriately
        Align the labels to the left
        Remove the unneeded bold markup from the labels
        Change the "User Id" label to "E-Mail"
        Align the radio group labels to the top of the groups

        * preferences/plugins.py:
        Set various border widths appropriately
        Set the default paned position to something more sensible
        Set the shadow type on the treeview's scrolled window to in
        Align the Author and Version labels to the left

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
"""Simple popup menu for revisions."""
17
17
 
18
 
from gi.repository import Gtk
19
 
from gi.repository import GObject
20
 
from bzrlib import ui
 
18
try:
 
19
    import pygtk
 
20
    pygtk.require("2.0")
 
21
except:
 
22
    pass
 
23
 
 
24
import bzrlib
 
25
import gtk
 
26
import gobject
 
27
from bzrlib import (errors, ui)
21
28
from bzrlib.revision import NULL_REVISION
22
29
 
23
 
class RevisionMenu(Gtk.Menu):
 
30
class RevisionMenu(gtk.Menu):
24
31
 
25
32
    __gsignals__ = {
26
33
            'tag-added': (
27
 
                GObject.SignalFlags.RUN_FIRST,
28
 
                None,
29
 
                (GObject.TYPE_STRING, GObject.TYPE_STRING)
 
34
                gobject.SIGNAL_RUN_FIRST,
 
35
                gobject.TYPE_NONE,
 
36
                (gobject.TYPE_STRING, gobject.TYPE_STRING)
30
37
            )
31
38
    }
32
39
 
47
54
 
48
55
    def create_items(self):
49
56
        if len(self.revids) == 1:
50
 
            item = Gtk.MenuItem.new_with_mnemonic("View _Changes")
 
57
            item = gtk.MenuItem("View _Changes")
51
58
            item.connect('activate', self.show_diff)
52
59
            self.append(item)
53
60
 
54
 
            item = Gtk.MenuItem.new_with_mnemonic("_Push")
 
61
            item = gtk.MenuItem("_Push")
55
62
            item.connect('activate', self.show_push)
56
63
            self.append(item)
57
64
 
58
 
            item = Gtk.MenuItem.new_with_mnemonic("_Tag Revision")
 
65
            item = gtk.MenuItem("_Tag Revision")
59
66
            item.connect('activate', self.show_tag)
60
67
            self.append(item)
61
68
 
62
 
            item = Gtk.MenuItem.new_with_mnemonic("_Merge Directive")
 
69
            item = gtk.MenuItem("_Merge Directive")
63
70
            item.connect('activate', self.store_merge_directive)
64
71
            # FIXME: self.append(item)
65
72
 
66
 
            item = Gtk.MenuItem.new_with_mnemonic("_Send Merge Directive")
 
73
            item = gtk.MenuItem("_Send Merge Directive")
67
74
            item.connect('activate', self.send_merge_directive)
68
75
            self.append(item)
69
 
 
 
76
            
70
77
            if self.wt:
71
 
                item = Gtk.MenuItem.new_with_mnemonic(
72
 
                    "_Revert to this revision")
 
78
                item = gtk.MenuItem("_Revert to this revision")
73
79
                item.connect('activate', self.revert)
74
80
                self.append(item)
75
81
 
84
90
        from bzrlib.plugins.gtk.mergedirective import SendMergeDirectiveDialog
85
91
        from cStringIO import StringIO
86
92
        window = SendMergeDirectiveDialog(self.branch, self.revids[0])
87
 
        if window.run() == Gtk.ResponseType.OK:
 
93
        if window.run() == gtk.RESPONSE_OK:
88
94
            outf = StringIO()
89
95
            outf.writelines(window.get_merge_directive().to_lines())
90
96
            mail_client = self.branch.get_config().get_mail_client()
110
116
        dialog = PushDialog(self.repository, self.revids[0], self.branch)
111
117
        response = dialog.run()
112
118
 
113
 
        if response != Gtk.ResponseType.NONE:
 
119
        if response != gtk.RESPONSE_NONE:
114
120
            dialog.destroy()
115
121
 
116
122
    def show_tag(self, item):
118
124
        dialog = AddTagDialog(self.repository, self.revids[0], self.branch)
119
125
        response = dialog.run()
120
126
 
121
 
        if response != Gtk.ResponseType.NONE:
 
127
        if response != gtk.RESPONSE_NONE:
122
128
            dialog.hide()
123
 
 
124
 
            if response == Gtk.ResponseType.OK:
 
129
        
 
130
            if response == gtk.RESPONSE_OK:
125
131
                self.emit('tag-added', dialog.tagname, dialog._revid)
126
 
 
 
132
            
127
133
            dialog.destroy()
128
 
 
 
134
    
129
135
    def revert(self, item):
130
136
        pb = ui.ui_factory.nested_progress_bar()
131
137
        revision_tree = self.branch.repository.revision_tree(self.revids[0])