23
from gi.repository import Gtk
25
25
from bzrlib.plugins.gtk.branchbox import BranchSelectionBox
27
class CreateMergeDirectiveDialog(gtk.Dialog):
27
class CreateMergeDirectiveDialog(Gtk.Dialog):
28
28
def __init__(self, branch, stop_revid=None):
29
29
super(CreateMergeDirectiveDialog, self).__init__()
30
30
self.branch = branch
53
table = gtk.Table(rows=3, columns=2)
53
table = Gtk.Table(rows=3, columns=2)
54
54
self.vbox.add(table)
57
57
label.set_markup("<b>Branch to Submit:</b>")
58
table.attach(label, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
60
label = gtk.Label(str(self.branch))
61
table.attach(label, 1, 2, 0, 1, gtk.FILL, gtk.FILL)
58
table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
60
label = Gtk.Label(label=str(self.branch))
61
table.attach(label, 1, 2, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
64
64
label.set_markup("<b>Target Branch:</b>")
65
table.attach(label, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
65
table.attach(label, 0, 1, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
67
67
self.submit_branch = BranchSelectionBox(self.branch.get_submit_branch())
68
table.attach(self.submit_branch, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
68
table.attach(self.submit_branch, 1, 2, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
70
70
# TODO: Display number of revisions to be send whenever
71
71
# submit branch changes
74
74
label.set_markup("<b>Email To:</b>")
75
table.attach(label, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
75
table.attach(label, 0, 1, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
77
self.mail_to = gtk.ComboBoxEntry()
77
self.mail_to = Gtk.ComboBoxEntry()
78
78
mail_to = self.branch.get_config().get_user_option('submit_to')
79
79
if mail_to is None:
80
80
submit_branch = self.submit_branch.get_branch()
84
84
if mail_to is not None:
85
85
self.mail_to.get_child().set_text(mail_to)
86
table.attach(self.mail_to, 1, 2, 2, 3, gtk.FILL, gtk.FILL)
86
table.attach(self.mail_to, 1, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
88
self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
89
gtk.STOCK_OK, gtk.RESPONSE_OK)
88
self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
89
Gtk.STOCK_OK, Gtk.ResponseType.OK)