/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
 
from gi.repository import GObject
18
17
from gi.repository import Gtk
19
18
 
20
19
import os
35
34
 
36
35
    def __init__(self, path, parent=None):
37
36
        """ 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))
 
37
        GObject.GObject.__init__(self, title="Initialize - Olive",
 
38
                                  parent=parent,
 
39
                                  flags=0,
 
40
                                  buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL))
41
41
        
42
42
        # Get arguments
43
43
        self.path = path
45
45
        # Create the widgets
46
46
        self._button_init = Gtk.Button(_i18n("_Initialize"), use_underline=True)
47
47
        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:"))
 
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:"))
52
50
        self._entry_custom = Gtk.Entry()
53
51
        self._hbox_custom = Gtk.HBox()
54
52
        
60
58
        self._entry_custom.set_sensitive(False)
61
59
        
62
60
        # Construct the dialog
63
 
        self.action_area.pack_end(self._button_init, False, False, 0)
64
 
        
65
 
        self._hbox_custom.pack_start(self._radio_custom, False, False, 0)
66
 
        self._hbox_custom.pack_start(self._entry_custom, True, True, 0)
67
 
        
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)
 
61
        self.action_area.pack_end(self._button_init)
 
62
        
 
63
        self._hbox_custom.pack_start(self._radio_custom, False, False)
 
64
        self._hbox_custom.pack_start(self._entry_custom, True, True)
 
65
        
 
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)
72
69
        
73
70
        # Display the dialog
74
 
        content_area.show_all()
 
71
        self.vbox.show_all()
75
72
    
76
73
    def _on_custom_toggled(self, widget):
77
74
        """ Occurs if the Custom radiobutton is toggled. """