/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 checkout.py

  • Committer: Curtis Hovey
  • Date: 2011-07-31 15:52:43 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731155243-ln8istmxbryhb4pz
Mechanical changes made by pygi.convert.sh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
 
19
 
from gi.repository import GObject
 
19
try:
 
20
    import pygtk
 
21
    pygtk.require("2.0")
 
22
except:
 
23
    pass
 
24
 
20
25
from gi.repository import Gtk
21
26
 
22
27
from bzrlib.branch import Branch
33
38
 
34
39
    def __init__(self, path=None, parent=None, remote_path=None):
35
40
        """ Initialize the Checkout dialog. """
36
 
        super(CheckoutDialog, self).__init__(
37
 
            title="Checkout - Olive", parent=parent, flags=0,
38
 
            buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
 
41
        GObject.GObject.__init__(self, title="Checkout - Olive",
 
42
                                  parent=parent,
 
43
                                  flags=0,
 
44
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
39
45
 
40
46
        # Get arguments
41
47
        self.path = path
45
51
        self._button_revision = Gtk.Button('')
46
52
        self._image_browse = Gtk.Image()
47
53
        self._filechooser = Gtk.FileChooserButton(_i18n("Please select a folder"))
48
 
        self._combo = Gtk.ComboBox.new_with_entry()
 
54
        self._combo = Gtk.ComboBoxEntry()
49
55
        self._label_location = Gtk.Label(label=_i18n("Branch location:"))
50
56
        self._label_destination = Gtk.Label(label=_i18n("Destination:"))
51
57
        self._label_nick = Gtk.Label(label=_i18n("Branch nick:"))
84
90
        self._label_revision.set_alignment(0, 0.5)
85
91
        self._table.set_row_spacings(3)
86
92
        self._table.set_col_spacings(3)
87
 
        self.get_content_area().set_spacing(3)
 
93
        self.vbox.set_spacing(3)
88
94
        if self.path is not None:
89
95
            self._filechooser.set_filename(self.path)
90
96
        if remote_path is not None:
91
97
            self._combo.get_child().set_text(remote_path)
92
98
 
93
99
        # Pack some widgets
94
 
        self._hbox_revision.pack_start(self._entry_revision, True, True, 0)
95
 
        self._hbox_revision.pack_start(self._button_revision, False, False, 0)
96
 
        self.get_content_area().add(self._table)
97
 
        self.action_area.pack_end(self._button_checkout, False, False, 0)
 
100
        self._hbox_revision.pack_start(self._entry_revision, True, True)
 
101
        self._hbox_revision.pack_start(self._button_revision, False, False)
 
102
        self.vbox.add(self._table)
 
103
        self.action_area.pack_end(self._button_checkout)
98
104
 
99
105
        # Show the dialog
100
 
        self.get_content_area().show_all()
 
106
        self.vbox.show_all()
101
107
 
102
108
        # Build checkout history
103
109
        self._history = UrlHistory(GlobalConfig(), 'branch_history')
111
117
            self._combo_model.append([ item ])
112
118
 
113
119
        self._combo.set_model(self._combo_model)
114
 
        self._combo.set_entry_text_column(0)
 
120
        self._combo.set_text_column(0)
115
121
 
116
122
    def _get_last_revno(self):
117
123
        """ Get the revno of the last revision (if any). """