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