14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from gi.repository import Gtk
26
19
from bzrlib.plugins.gtk.branchbox import BranchSelectionBox
28
class CreateMergeDirectiveDialog(gtk.Dialog):
21
class CreateMergeDirectiveDialog(Gtk.Dialog):
29
22
def __init__(self, branch, stop_revid=None):
30
23
super(CreateMergeDirectiveDialog, self).__init__()
31
24
self.branch = branch
39
32
# TODO: Create a frame with a the ability to select a branch
41
34
# TODO: Create a frame with a button for selecting a file name
46
class SendMergeDirectiveDialog(gtk.Dialog):
39
class SendMergeDirectiveDialog(Gtk.Dialog):
47
40
def __init__(self, branch, parent=None):
48
41
super(SendMergeDirectiveDialog, self).__init__(parent)
49
42
self.branch = branch
54
table = gtk.Table(rows=3, columns=2)
47
table = Gtk.Table(rows=3, columns=2)
48
self.get_content_area().add(table)
58
51
label.set_markup("<b>Branch to Submit:</b>")
59
table.attach(label, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
61
label = gtk.Label(str(self.branch))
62
table.attach(label, 1, 2, 0, 1, gtk.FILL, gtk.FILL)
52
table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
54
label = Gtk.Label(label=str(self.branch))
55
table.attach(label, 1, 2, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
65
58
label.set_markup("<b>Target Branch:</b>")
66
table.attach(label, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
59
table.attach(label, 0, 1, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
68
61
self.submit_branch = BranchSelectionBox(self.branch.get_submit_branch())
69
table.attach(self.submit_branch, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
62
table.attach(self.submit_branch, 1, 2, 1, 2, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
71
# TODO: Display number of revisions to be send whenever
64
# TODO: Display number of revisions to be sent whenever
72
65
# submit branch changes
75
68
label.set_markup("<b>Email To:</b>")
76
table.attach(label, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
69
table.attach(label, 0, 1, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
78
self.mail_to = gtk.ComboBoxEntry()
71
self.mail_to = Gtk.ComboBox.new_with_entry()
79
72
mail_to = self.branch.get_config().get_user_option('submit_to')
80
73
if mail_to is None:
81
74
submit_branch = self.submit_branch.get_branch()
85
78
if mail_to is not None:
86
79
self.mail_to.get_child().set_text(mail_to)
87
table.attach(self.mail_to, 1, 2, 2, 3, gtk.FILL, gtk.FILL)
80
table.attach(self.mail_to, 1, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
89
self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
90
gtk.STOCK_OK, gtk.RESPONSE_OK)
82
self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
83
Gtk.STOCK_OK, Gtk.ResponseType.OK)