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

  • Committer: Jelmer Vernooij
  • Date: 2012-07-09 15:23:26 UTC
  • mto: This revision was merged to the branch mainline in revision 794.
  • Revision ID: jelmer@samba.org-20120709152326-dzxb8zoz0btull7n
Remove bzr-notify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
16
16
 
17
 
try:
18
 
    import pygtk
19
 
    pygtk.require("2.0")
20
 
except:
21
 
    pass
22
 
 
23
 
import bzrlib
24
 
import gtk
25
 
import os
 
17
from gi.repository import Gtk
26
18
 
27
19
from bzrlib.plugins.gtk.branchbox import BranchSelectionBox
28
20
 
29
 
class CreateMergeDirectiveDialog(gtk.Dialog):
 
21
class CreateMergeDirectiveDialog(Gtk.Dialog):
30
22
    def __init__(self, branch, stop_revid=None):
31
23
        super(CreateMergeDirectiveDialog, self).__init__()
32
24
        self.branch = branch
38
30
        # submittted
39
31
 
40
32
        # TODO: Create a frame with a the ability to select a branch
41
 
        
 
33
 
42
34
        # TODO: Create a frame with a button for selecting a file name 
43
35
        # for the bundle
44
36
        pass
45
37
 
46
38
 
47
 
class SendMergeDirectiveDialog(gtk.Dialog):
 
39
class SendMergeDirectiveDialog(Gtk.Dialog):
48
40
    def __init__(self, branch, parent=None):
49
41
        super(SendMergeDirectiveDialog, self).__init__(parent)
50
42
        self.branch = branch
52
44
        self._create()
53
45
 
54
46
    def _create(self):
55
 
        table = gtk.Table(rows=3, columns=2)
56
 
        self.vbox.add(table)
 
47
        table = Gtk.Table(rows=3, columns=2)
 
48
        self.get_content_area().add(table)
57
49
 
58
 
        label = gtk.Label()
 
50
        label = Gtk.Label()
59
51
        label.set_markup("<b>Branch to Submit:</b>")
60
 
        table.attach(label, 0, 1, 0, 1, gtk.FILL, gtk.FILL)
61
 
 
62
 
        label = gtk.Label(str(self.branch))
63
 
        table.attach(label, 1, 2, 0, 1, gtk.FILL, gtk.FILL)
64
 
 
65
 
        label = gtk.Label()
 
52
        table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
53
 
 
54
        label = Gtk.Label(label=str(self.branch))
 
55
        table.attach(label, 1, 2, 0, 1, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
 
56
 
 
57
        label = Gtk.Label()
66
58
        label.set_markup("<b>Target Branch:</b>")
67
 
        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
60
 
69
61
        self.submit_branch = BranchSelectionBox(self.branch.get_submit_branch())
70
 
        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
63
 
72
 
        # TODO: Display number of revisions to be send whenever 
 
64
        # TODO: Display number of revisions to be sent whenever 
73
65
        # submit branch changes
74
66
 
75
 
        label = gtk.Label()
 
67
        label = Gtk.Label()
76
68
        label.set_markup("<b>Email To:</b>")
77
 
        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
70
 
79
 
        self.mail_to = gtk.ComboBoxEntry()
 
71
        self.mail_to = Gtk.ComboBox.new_with_entry()
80
72
        mail_to = self.branch.get_config().get_user_option('submit_to')
81
73
        if mail_to is None:
82
74
            submit_branch = self.submit_branch.get_branch()
85
77
                            'child_submit_to')
86
78
        if mail_to is not None:
87
79
            self.mail_to.get_child().set_text(mail_to)
88
 
        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
81
 
90
 
        self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, 
91
 
                         gtk.STOCK_OK, gtk.RESPONSE_OK)
 
82
        self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, 
 
83
                         Gtk.STOCK_OK, Gtk.ResponseType.OK)
92
84
 
93
85
        self.show_all()
94
86
 
112
104
 
113
105
 
114
106
 
115
 
class ApplyMergeDirectiveDialog(gtk.Dialog):
 
107
class ApplyMergeDirectiveDialog(Gtk.Dialog):
116
108
    def __init__(self):
117
109
        super(ApplyMergeDirectiveDialog, self).__init__()