示例#1
0
QString ControlPanel::statusText(const UserInfo &ui) const
{
    QString ret;

    if (!ui.exists()) {
        ret = "";
    } else if (ui.banned()) {
        ret = toBoldColor(tr("Banned"), Qt::red);
    } else if (ui.tempBanned()) {
        ret = toBoldColor(tr("Tempbanned"), QColor("orange"));
    } else if (ui.online()) {
        ret = toBoldColor(tr("Online"), Qt::green);
    } else {
        ret = tr("Offline");
    }

    if (ui.muted()) {
        ret += " ";
        ret += toBoldColor(tr("[Muted]"), Qt::red);
    }

    return ret;
}