36
36
def __init__(self, path, parent=None):
37
37
""" Initialize the Initialize dialog. """
38
super(InitDialog, self).__init__(
39
title="Initialize - Olive", parent=parent, flags=0,
40
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
38
GObject.GObject.__init__(self, title="Initialize - Olive",
41
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
45
46
# Create the widgets
46
47
self._button_init = Gtk.Button(_i18n("_Initialize"), use_underline=True)
47
48
self._label_question = Gtk.Label(label=_i18n("Which directory do you want to initialize?"))
48
self._radio_current = Gtk.RadioButton.new_with_label(
49
None, _i18n("Current directory"))
50
self._radio_custom = Gtk.RadioButton.new_with_label_from_widget(
51
self._radio_current, _i18n("Create a new directory with the name:"))
49
self._radio_current = Gtk.RadioButton(None, _i18n("Current directory"))
50
self._radio_custom = Gtk.RadioButton(self._radio_current, _i18n("Create a new directory with the name:"))
52
51
self._entry_custom = Gtk.Entry()
53
52
self._hbox_custom = Gtk.HBox()
60
59
self._entry_custom.set_sensitive(False)
62
61
# Construct the dialog
63
self.action_area.pack_end(self._button_init, False, False, 0)
65
self._hbox_custom.pack_start(self._radio_custom, False, False, 0)
66
self._hbox_custom.pack_start(self._entry_custom, True, True, 0)
68
content_area = self.get_content_area()
69
content_area.pack_start(self._label_question, True, True, 0)
70
content_area.pack_start(self._radio_current, True, True, 0)
71
content_area.pack_start(self._hbox_custom, True, True, 0)
62
self.action_area.pack_end(self._button_init)
64
self._hbox_custom.pack_start(self._radio_custom, False, False)
65
self._hbox_custom.pack_start(self._entry_custom, True, True)
67
self.vbox.pack_start(self._label_question, True, True, 0)
68
self.vbox.pack_start(self._radio_current, True, True, 0)
69
self.vbox.pack_start(self._hbox_custom, True, True, 0)
73
71
# Display the dialog
74
content_area.show_all()
76
74
def _on_custom_toggled(self, widget):
77
75
""" Occurs if the Custom radiobutton is toggled. """