def __init__(self, title, text, buttons=None, dlg_type=gtk.MESSAGE_WARNING): """ when passing buttons, use a format like this: {key: (response: stock)} -> where key should be an integer, so it will pack buttons in the order you want. """ HIGAlertDialog.__init__(self, type=dlg_type, buttons=gtk.BUTTONS_NONE, message_format=title, secondary_text=text) dlg_vbox = self.get_children()[0] buttons_box = dlg_vbox.get_children()[-1] if not buttons: buttons = { } # pack buttons in dialog's buttonsbox for resp_button in buttons.values(): resp = resp_button[0] button = resp_button[1] btn = gtk.Button(stock=button) btn.show() buttons_box.pack_start(btn, False, False, 0) btn.connect('clicked', self._send_response, resp)
def __init__(self, parent=None): title = _("Inventory without scheduling profile.") message = _( "This Inventory was created when a scan realized in UMIT " "was requested to be added to the Network Inventory Viewer, " "so there is no scheduling profile for it.\n\n" "This Inventory is not editable.\n\n" "(If the mentioned reason above is incorrect, either you have " "a database from somewhere else or report as bug)" ) HIGAlertDialog.__init__(self, parent, message_format=title, secondary_text=message)
def __init__(self, parent=None): title = _("Inventory without scheduling profile.") message = _( "This Inventory was created when a scan realized in UMIT " "was requested to be added to the Network Inventory Viewer, " "so there is no scheduling profile for it.\n\n" "This Inventory is not editable.\n\n" "(If the mentioned reason above is incorrect, either you have " "a database from somewhere else or report as bug)") HIGAlertDialog.__init__(self, parent, message_format=title, secondary_text=message)