/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: Jelmer Vernooij
  • Date: 2008-06-29 16:20:15 UTC
  • mto: This revision was merged to the branch mainline in revision 519.
  • Revision ID: jelmer@samba.org-20080629162015-amhe7xj4cdmup4id
Rename GtkProgressBarStack to GtkWindowProgressBarStack

Show diffs side-by-side

added added

removed removed

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