def _set_label_text(obj, text, tooltip=None, replace_all=False):
    """
    Keep text before first colon and replace the rest with new text.

    If there is no colon in the
    :param obj:
    :param text:
    :param tooltip:
    :param replace_all: No colon is searched and whole text is replaced
    :return:
    """
    dlab = str(obj.text())
    index_of_colon = dlab.find(': ')
    if index_of_colon == -1:
        index_of_colon = 0
    else:
        index_of_colon += 2
    if replace_all:
        index_of_colon = 0
    obj.setText(dlab[:index_of_colon] + '%s' % text)
    if tooltip is not None:
        obj.setToolTip(tooltip)
