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 GObject
18
from gi.repository import Gtk
33
from bzrlib.plugins.gtk import _i18n
28
34
from bzrlib.plugins.gtk.dialog import error_dialog
29
35
from bzrlib.plugins.gtk.errors import show_bzr_error
30
from bzrlib.plugins.gtk.i18n import _i18n
33
class InitDialog(Gtk.Dialog):
38
class InitDialog(gtk.Dialog):
34
39
""" Initialize dialog. """
36
41
def __init__(self, path, parent=None):
37
42
""" Initialize the Initialize dialog. """
38
GObject.GObject.__init__(self, title="Initialize - Olive",
43
gtk.Dialog.__init__(self, title="Initialize - Olive",
41
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
46
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
46
51
# Create the widgets
47
self._button_init = Gtk.Button(_i18n("_Initialize"), use_underline=True)
48
self._label_question = Gtk.Label(label=_i18n("Which directory do you want to initialize?"))
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:"))
51
self._entry_custom = Gtk.Entry()
52
self._hbox_custom = Gtk.HBox()
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()
55
60
self._button_init.connect('clicked', self._on_init_clicked)
64
69
self._hbox_custom.pack_start(self._radio_custom, False, False)
65
70
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)
72
self.vbox.pack_start(self._label_question)
73
self.vbox.pack_start(self._radio_current)
74
self.vbox.pack_start(self._hbox_custom)
71
76
# Display the dialog
72
77
self.vbox.show_all()