1 # Copyright (C) 2009, Thomas Leonard
2 # See the README file for details, or visit http://0install.net.
5 from zeroinstall
.gtkui
import gtkutils
, gtk
9 builderfile
= os
.path
.join(os
.path
.dirname(__file__
), 'zero-install.ui')
11 class Template(gtkutils
.Template
):
12 def __init__(self
, root
):
13 gtkutils
.Template
.__init
__(self
, builderfile
, root
)
15 class Dialog(gtk
.Dialog
):
17 gtk
.Dialog
.__init
__(self
)
18 self
.set_has_separator(False)
19 self
.set_position(gtk
.WIN_POS_CENTER
)
21 def add_mixed_button(self
, message
, stock
, response
):
22 button
= MixedButton(message
, stock
)
23 button
.set_flags(gtk
.CAN_DEFAULT
)
25 self
.add_action_widget(button
, response
)
29 def alert(parent
, message
, type = gtk
.MESSAGE_ERROR
):
30 if type == gtk
.MESSAGE_ERROR
:
34 gtkutils
.show_message_box(parent
, message
, type)
36 DialogResponse
= gtkutils
.DialogResponse
37 ButtonClickedBlocker
= gtkutils
.ButtonClickedBlocker
38 MixedButton
= gtkutils
.MixedButton