/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 push.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:
21
21
except:
22
22
    pass
23
23
 
24
 
import gtk
 
24
from gi.repository import Gtk
25
25
 
26
26
from errors import show_bzr_error
27
27
 
36
36
from bzrlib.plugins.gtk.i18n import _i18n
37
37
 
38
38
 
39
 
class PushDialog(gtk.Dialog):
 
39
class PushDialog(Gtk.Dialog):
40
40
    """New implementation of the Push dialog."""
41
41
 
42
42
    def __init__(self, repository, revid, branch=None, parent=None):
43
43
        """Initialize the Push dialog. """
44
 
        gtk.Dialog.__init__(self, title="Push",
 
44
        GObject.GObject.__init__(self, title="Push",
45
45
                                  parent=parent,
46
46
                                  flags=0,
47
 
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
 
47
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
48
48
 
49
49
        # Get arguments
50
50
        self.repository = repository
52
52
        self.branch = branch
53
53
 
54
54
        # Create the widgets
55
 
        self._label_location = gtk.Label(_i18n("Location:"))
56
 
        self._combo = gtk.ComboBoxEntry()
57
 
        self._button_push = gtk.Button(_i18n("_Push"), use_underline=True)
58
 
        self._hbox_location = gtk.HBox()
 
55
        self._label_location = Gtk.Label(label=_i18n("Location:"))
 
56
        self._combo = Gtk.ComboBoxEntry()
 
57
        self._button_push = Gtk.Button(_i18n("_Push"), use_underline=True)
 
58
        self._hbox_location = Gtk.HBox()
59
59
 
60
60
        # Set callbacks
61
61
        self._button_push.connect('clicked', self._on_push_clicked)
68
68
        # Pack widgets
69
69
        self._hbox_location.pack_start(self._label_location, False, False)
70
70
        self._hbox_location.pack_start(self._combo, True, True)
71
 
        self.vbox.pack_start(self._hbox_location)
 
71
        self.vbox.pack_start(self._hbox_location, True, True, 0)
72
72
        self.action_area.pack_end(self._button_push)
73
73
 
74
74
        # Show the dialog
80
80
 
81
81
    def _build_history(self):
82
82
        """Build up the location history. """
83
 
        self._combo_model = gtk.ListStore(str)
 
83
        self._combo_model = Gtk.ListStore(str)
84
84
        for item in self._history.get_entries():
85
85
            self._combo_model.append([ item ])
86
86
        self._combo.set_model(self._combo_model)
102
102
        except errors.DivergedBranches:
103
103
            response = question_dialog(_i18n('Branches have been diverged'),
104
104
                                       _i18n('You cannot push if branches have diverged.\nOverwrite?'))
105
 
            if response == gtk.RESPONSE_YES:
 
105
            if response == Gtk.ResponseType.YES:
106
106
                revs = do_push(self.branch, location=location, overwrite=True)
107
107
 
108
108
        if self.branch is not None and self.branch.get_push_location() is None:
112
112
        info_dialog(_i18n('Push successful'),
113
113
                    _i18n("%d revision(s) pushed.") % revs)
114
114
 
115
 
        self.response(gtk.RESPONSE_OK)
 
115
        self.response(Gtk.ResponseType.OK)
116
116
 
117
117
 
118
118
def do_push(br_from, location, overwrite):
143
143
        except errors.NoSuchFile:
144
144
            response = question_dialog(_i18n('Non existing parent directory'),
145
145
                         _i18n("The parent directory (%s)\ndoesn't exist. Create?") % location)
146
 
            if response == gtk.RESPONSE_OK:
 
146
            if response == Gtk.ResponseType.OK:
147
147
                transport.create_prefix()
148
148
            else:
149
149
                return