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

  • Committer: Curtis Hovey
  • Date: 2011-07-31 16:50:29 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731165029-9gixuqypi3lwapzm
Removed import_pygtk because gi does not impicitly call Main(). Inlined checks for gtk availablility.

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 gtk
 
17
from gi.repository import Gtk
24
18
 
25
19
import os
26
20
 
35
29
from bzrlib.plugins.gtk.i18n import _i18n
36
30
 
37
31
 
38
 
class InitDialog(gtk.Dialog):
 
32
class InitDialog(Gtk.Dialog):
39
33
    """ Initialize dialog. """
40
34
 
41
35
    def __init__(self, path, parent=None):
42
36
        """ Initialize the Initialize dialog. """
43
 
        gtk.Dialog.__init__(self, title="Initialize - Olive",
 
37
        GObject.GObject.__init__(self, title="Initialize - Olive",
44
38
                                  parent=parent,
45
39
                                  flags=0,
46
 
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
 
40
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
47
41
        
48
42
        # Get arguments
49
43
        self.path = path
50
44
        
51
45
        # Create the widgets
52
 
        self._button_init = gtk.Button(_i18n("_Initialize"), use_underline=True)
53
 
        self._label_question = gtk.Label(_i18n("Which directory do you want to initialize?"))
54
 
        self._radio_current = gtk.RadioButton(None, _i18n("Current directory"))
55
 
        self._radio_custom = gtk.RadioButton(self._radio_current, _i18n("Create a new directory with the name:"))
56
 
        self._entry_custom = gtk.Entry()
57
 
        self._hbox_custom = gtk.HBox()
 
46
        self._button_init = Gtk.Button(_i18n("_Initialize"), use_underline=True)
 
47
        self._label_question = Gtk.Label(label=_i18n("Which directory do you want to initialize?"))
 
48
        self._radio_current = Gtk.RadioButton(None, _i18n("Current directory"))
 
49
        self._radio_custom = Gtk.RadioButton(self._radio_current, _i18n("Create a new directory with the name:"))
 
50
        self._entry_custom = Gtk.Entry()
 
51
        self._hbox_custom = Gtk.HBox()
58
52
        
59
53
        # Set callbacks
60
54
        self._button_init.connect('clicked', self._on_init_clicked)
69
63
        self._hbox_custom.pack_start(self._radio_custom, False, False)
70
64
        self._hbox_custom.pack_start(self._entry_custom, True, True)
71
65
        
72
 
        self.vbox.pack_start(self._label_question)
73
 
        self.vbox.pack_start(self._radio_current)
74
 
        self.vbox.pack_start(self._hbox_custom)
 
66
        self.vbox.pack_start(self._label_question, True, True, 0)
 
67
        self.vbox.pack_start(self._radio_current, True, True, 0)
 
68
        self.vbox.pack_start(self._hbox_custom, True, True, 0)
75
69
        
76
70
        # Display the dialog
77
71
        self.vbox.show_all()
120
114
                branch = existing_bzrdir.create_branch()
121
115
                existing_bzrdir.create_workingtree()
122
116
        
123
 
        self.response(gtk.RESPONSE_OK)
 
117
        self.response(Gtk.ResponseType.OK)