/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: Jelmer Vernooij
  • Date: 2011-11-30 21:45:54 UTC
  • Revision ID: jelmer@samba.org-20111130214554-5kfx0b5y7t5zh033
Extend branch preferences, show location widget.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
 
18
from gi.repository import GObject
18
19
from gi.repository import Gtk
19
20
 
20
21
from errors import show_bzr_error
35
36
 
36
37
    def __init__(self, repository, revid, branch=None, parent=None):
37
38
        """Initialize the Push dialog. """
38
 
        GObject.GObject.__init__(self, title="Push",
39
 
                                  parent=parent,
40
 
                                  flags=0,
41
 
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
 
39
        super(PushDialog, self).__init__(
 
40
            title="Push", parent=parent, flags=0,
 
41
            buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
 
42
 
42
43
 
43
44
        # Get arguments
44
45
        self.repository = repository
47
48
 
48
49
        # Create the widgets
49
50
        self._label_location = Gtk.Label(label=_i18n("Location:"))
50
 
        self._combo = Gtk.ComboBoxEntry()
 
51
        self._combo = Gtk.ComboBox.new_with_entry()
51
52
        self._button_push = Gtk.Button(_i18n("_Push"), use_underline=True)
52
53
        self._hbox_location = Gtk.HBox()
53
54
 
57
58
        # Set properties
58
59
        self._label_location.set_alignment(0, 0.5)
59
60
        self._hbox_location.set_spacing(3)
60
 
        self.vbox.set_spacing(3)
 
61
        self.get_content_area().set_spacing(3)
61
62
 
62
63
        # Pack widgets
63
 
        self._hbox_location.pack_start(self._label_location, False, False)
64
 
        self._hbox_location.pack_start(self._combo, True, True)
65
 
        self.vbox.pack_start(self._hbox_location, True, True, 0)
66
 
        self.action_area.pack_end(self._button_push)
 
64
        self._hbox_location.pack_start(
 
65
            self._label_location, False, False, 0)
 
66
        self._hbox_location.pack_start(self._combo, True, True, 0)
 
67
        self.get_content_area().pack_start(self._hbox_location, True, True, 0)
 
68
        # XXX sinzui 2011-08-12: maybe False, False, 0
 
69
        self.get_action_area().pack_end(self._button_push, True, True, 0)
67
70
 
68
71
        # Show the dialog
69
 
        self.vbox.show_all()
 
72
        self.get_content_area().show_all()
70
73
 
71
74
        # Build location history
72
75
        self._history = UrlHistory(self.branch.get_config(), 'push_history')
78
81
        for item in self._history.get_entries():
79
82
            self._combo_model.append([ item ])
80
83
        self._combo.set_model(self._combo_model)
81
 
        self._combo.set_text_column(0)
 
84
        self._combo.set_entry_text_column(0)
82
85
 
83
86
        if self.branch is not None:
84
87
            location = self.branch.get_push_location()