Пример #1
0
void PokePersonal::setMove(int moveNum, int moveSlot, bool check) throw(QString)
{
    if (moveNum == move(moveSlot))
        return;

    if (check && moveNum != 0) {
        m_moves[moveSlot] = Move::NoMove;

        if (hasMove(moveNum))
            throw QObject::tr("%1 already has move %2.").arg(nickname(), MoveInfo::Name(moveNum));
        else if (gen() > 1 && !PokemonInfo::Moves(num(), gen()).contains(moveNum))
            throw QObject::tr("%1 can't learn %2.").arg(nickname(), MoveInfo::Name(moveNum));
    }

    m_moves[moveSlot] = moveNum;

    if (check) {
        QSet<int> invalid_moves;
        QString error;
        if (!MoveSetChecker::isValid(num(), gen(), m_moves[0],m_moves[1],m_moves[2],m_moves[3],ability(),gender(),level(),false,&invalid_moves, &error)) {
            m_moves[moveSlot] = Move::NoMove;
            throw error;
        }
    }
}
Пример #2
0
void CMainFrame::OnPostCreate()
{
	if(!this->InitFromXmlFile(_T("MainFrame.xml"),this))
		throw CGJWndError::LOAD_ERROR;  
	m_pBuddyList= static_cast<CBuddyListUI*>(m_pm.FindControl(pstrBuddyListName));
	m_pRecentList=static_cast<CBuddyListUI*>(m_pm.FindControl(pstrRecentBuddyListName));
	m_pOptTabBuddyList=static_cast<COptionUI*>(m_pm.FindControl(pstrOptTabBuddyListName));
	m_pOptTabRecentList=static_cast<COptionUI*>(m_pm.FindControl(pstrOptTabRecentListName));
	m_pListTable=static_cast<CTabLayoutUI*>(m_pm.FindControl(pstrListTableName));

	m_pBtnHeader=static_cast<CButtonUI*>(m_pm.FindControl(pstrButtonHeaderName));
	m_pBtnSearch=FindControl<CButtonUI>(pstrButtonSearchName);
	m_pBtnStatus=FindControl<CButtonUI>(pstrButtonStatusName);



	m_pEditSignaure=static_cast<CEditUI*>(m_pm.FindControl(pstrEditSignatureName));
	m_pLabelName=static_cast<CLabelUI*>(m_pm.FindControl(pstrLabelNameName));

	ASSERT(m_pOptTabBuddyList);
	ASSERT(m_pOptTabRecentList);
	ASSERT(m_pListTable);
	ASSERT(m_pBuddyList);
	ASSERT(m_pRecentList);
	ASSERT(m_pBtnHeader);
	ASSERT(m_pBtnStatus);
	ASSERT(m_pEditSignaure);
	ASSERT(m_pLabelName);

	m_pBuddyList->OnItemAction+= CDelegate<CMainFrame,CMainFrame>(this,&CMainFrame::OnBuddyItemAction);

	/*m_pBuddyList->AddGroup(_T("test"));
	m_pBuddyList->AddGroup(_T("test2"));
	CBuddyListItem *item;

	for (int i = 0; i < 10; i++)
	{
	item=new CBuddyListItem(); 
	CString str;
	str.Format(_T("item %d"),i);
	item->SetName(str);
	item->SetHeader(_T("header.jpg"));
	str.Format(_T("signature %d"),i);
	item->SetSignature(str);
	JID jid;
	jid.setUsername(cstr_str(str));
	item->SetJid(jid);

	m_pBuddyList->GetGroup(i%m_pBuddyList->GetCount()).Add(*item);
	}*/
	ASSERT(GetContext());
	LoadUser();
	GetContext()->GetClient()->rosterManager()->registerRosterListener(this);  
	ASSERT(GetContext()->GetSelfVCard());
	auto vcard=GetContext()->GetSelfVCard();
	m_pLabelName->SetText( utf8dec(vcard->nickname()));
	m_pEditSignaure->SetText(utf8dec(vcard->desc()));
	m_pBtnHeader->SetBkImage(GetContext()->GetHeaderManager().GetHeader(*GetContext()->GetSelf(),true));
	UpdateDock();
}
void PokeTeam::load()
{
    PokeGeneral::load();
    /*set the default gender & ability */
    if (genderAvail() == Pokemon::NeutralAvail)
    {
        gender() = Pokemon::Neutral;
    }
    else if (genderAvail() == Pokemon::FemaleAvail)
    {
        gender() = Pokemon::Female;
    }
    else if (genderAvail() == Pokemon::MaleAvail)
    {
        gender() = Pokemon::Male;
    } else
    {
        gender() = true_rand() % 2 ? Pokemon::Male : Pokemon::Female;
    }

    ability() = abilities().ab(0);
    nickname() = PokemonInfo::Name(num());
    PokeGraphics::load(gender(), false);
    PokeGraphics::loadIcon(num());
}
Пример #4
0
void PokePersonal::reset()
{
    num() = Pokemon::NoPoke;
    level() = 100;
    for (int i = 0; i < 4; i++)
        m_moves[i] = 0;
    happiness() = 0;
    shiny() = false;
    gender() = Pokemon::Neutral;
    ability() = 0;
    nickname() = "";
    nature() = 0;
    item() = 0;

    for (int i = 0; i < 6; i ++) {
        if (gen() >= 3) {
            m_EVs[i] = 0;
            m_DVs[i] = 31;
        }
        else {
            m_EVs[i] = 255;
            m_DVs[i] = 15;
        }
    }
}
Пример #5
0
void ContactUser::onConnected()
{
    m_settings->write("lastConnected", QDateTime::currentDateTime());

    if (m_contactRequest && m_connection->purpose() == Protocol::Connection::Purpose::OutboundRequest) {
        qDebug() << "Sending contact request for" << uniqueID << nickname();
        m_contactRequest->sendRequest(m_connection);
    }

    if (!m_settings->read("sentUpgradeNotification").isNull())
        m_settings->unset("sentUpgradeNotification");

    /* The 'rejected' mark comes from failed authentication to someone who we thought was a known
     * contact. Normally, it would mean that you were removed from that person's contacts. It's
     * possible for this to be undone; for example, if that person sends you a new contact request,
     * it will be automatically accepted. If this happens, unset the 'rejected' flag for correct UI.
     */
    if (m_settings->read("rejected").toBool()) {
        qDebug() << "Contact had marked us as rejected, but now they've connected again. Re-enabling.";
        m_settings->unset("rejected");
    }

    updateStatus();
    if (isConnected())
        emit connected();

    if (m_status != Online && m_status != RequestPending) {
        BUG() << "Contact has a connection while in status" << m_status << "which is not expected.";
        m_connection->close();
    }
}
Пример #6
0
char*		exec_cmd(char* cmd, t_client* client, t_data* data)
{
  char*		res;
  char**	parse;

  parse = cut_cmd(data, cmd);
  if (channel(parse, client, data) == 1)
    return (NULL);
  else if (strcmp(parse[0], "/nick") == 0)
    return (nickname(data, client, parse));
  else if (strcmp(parse[0], "/quit") == 0)
    return (quit(data, client));
  else if (strcmp(parse[0], "/msg") == 0)
    return (msg_private(data, client, parse));
  else if (strcmp(parse[0], "/server") == 0)
    return (quit(data, client));
  else if (strcmp(parse[0], "/send_file") == 0)
    return (NULL);
  else if (strcmp(parse[0], "/accept_file") == 0)
    return (NULL);
  else if (parse[0][0] != '/')
    return (msg_general(data, client, parse));
  else
    return (new_str(NULL, strcat(parse[0], " : command not found"), data));
  return (res);
}
Пример #7
0
void NodeFriendCircleComment::setCommentInfoShow(std::vector<msg::CommentInfo> commentInfo ,int index )
{
    int i=index;
    auto allInfo=commentInfo;
    auto userinfo=commentInfo[i].userinfo();
    userID=userinfo.userid();
    auto nickname =userinfo.nickname();
    auto infoma=commentInfo.at(i);
    auto type =infoma.type();
    this->setCommentID(infoma.commentid());
    this->setParentID(infoma.parentcomment());
    this->setIfDelete(infoma.isdelete());
    
    std::map<int,std::string> alluserinfo;
    for(auto itor:commentInfo)
    {
        if(itor.type()!=msg::CommentType::LIKE)
        {
            alluserinfo[itor.commentid()]=itor.userinfo().nickname();
        }
    }
    if(type==1)
    {
        textReplay->setString(nickname+":");
    }
    else if(type ==3)
    {
        std::string replyName=alluserinfo[infoma.parentcomment()];
    textReplay->setString(nickname+" "+tools::local_string("reply","回复")+" "+replyName+" :");
    }
    auto info = commentInfo[i];
    textDate->setString(getStringFromInt(commentInfo[i].time()));
    textComment->setString(commentInfo[i].content());
    textComment->setContentSize(Size(117,38));
    std::string time = getStringFromInt(commentInfo[i].time());
    std::string text = "";
    const std::string& text1=time;
    double time2 = tools::stod(text1);
    time2 /= 1000;
    text = tools::time_display(time2);
    texthour->setString(text);
    textDate->setVisible(false);
    
    auto imgName=userinfo.picname();
    
    if(imgName == "")
    {
        imgName = "Default/image_defualt_user_icon_small48X48.png";
    }
    ShaderSprite *imgIcon = ShaderSprite::createAndDownload(imgName, "Default/image_defualt_user_icon_small48X48.png", "Default/image_defualt_user_icon_small48X48.png");
    imgIcon->setAnchorPoint(Vec2(0,0.5));
    imgIcon->setPosition(headImage->getPosition());
    headImage->setVisible(false);
    this->addChild(imgIcon);
    
    
}
Пример #8
0
void NetworkDialog::savePreferences()
{
    Settings::setNickname(nickname());
    if (m_hostname) {
        Settings::setHostname(hostname());
    }
    Settings::setPort(port());
    Settings::self()->save();
}
void MusicUserRecordWidget::confirmButtonClickedF()
{
    QString nickname(ui->nicknameEdit->text());
    if(nickname != m_userModel->getUserName(ui->userIDLabel_F->text()))
    {
        emit resetUserName(ui->nicknameEdit->text());
    }
    m_userModel->updateUser(ui->userIDLabel_F->text(), nickname,
                            ui->maleRadioButton_F->isChecked() ? "0" : "1",
                            ui->birthDateEdit_F->text(),
                            ui->cityComboBox_F->currentText(),
                            ui->countryComboBox_F->currentText(),
                            ui->signatureEdit_F->toPlainText());
    close();
}
Пример #10
0
INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)
{
	ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
	setTString("Nick", nickname);

	if (IsOnline())
	{
		T2Utf szNick8(nickname);
		TOX_ERR_SET_INFO error;
		if (!tox_self_set_name(toxThread->tox, szNick8, mir_strlen(szNick8), &error))
			logger->Log(__FUNCTION__": failed to set nick name");
	}

	return 0;
}
Пример #11
0
QDomElement & PokeTeam::toXml(QDomElement &el) const
{
    const_cast<PokeTeam*>(this)->sanityCheck();

    QDomDocument doc;

    el.setAttribute("Nickname", nickname());
    el.setAttribute("Num", num().pokenum);
    el.setAttribute("Item", item());
    el.setAttribute("Ability", ability());
    el.setAttribute("Nature", nature());
    el.setAttribute("Gender", gender());
    el.setAttribute("Shiny", shiny());
    el.setAttribute("Happiness", happiness());
    el.setAttribute("Forme", num().subnum);
    el.setAttribute("Lvl", level());
    el.setAttribute("Gen", gen().num);
    el.setAttribute("SubGen", gen().subnum);

    for(int i = 0; i < 4; i++)
    {
        QDomElement move = doc.createElement("Move");
        el.appendChild(move);

        QDomText name = doc.createTextNode(QString("%1").arg(this->move(i)));
        move.appendChild(name);
    }
    for(int i = 0; i < 6; i++)
    {
        QDomElement Dv = doc.createElement("DV");
        el.appendChild(Dv);

        QDomText Dvname = doc.createTextNode(QString("%1").arg(DV(i)));
        Dv.appendChild(Dvname);
    }
    for(int i = 0; i < 6; i++)
    {
        QDomElement Ev = doc.createElement("EV");
        el.appendChild(Ev);

        QDomText Evname = doc.createTextNode(QString("%1").arg(EV(i)));
        Ev.appendChild(Evname);
    }

    return el;
}
Пример #12
0
int main()
{
    int *sortingarray;
    int i,a,b,c;
    srand(time(NULL)*time(NULL));
    printf("Enter size of array: valid values 1-35533\n");
    scanf("%d",&a);
    sortingarray=(int *) malloc(a*sizeof(int));
    a=a-1;
    arraygenerate(sortingarray,&a);
    i=0;
    printf("What sorting mechanism?\n Bubble/shaker -1\nSelection -2\nInsertion -3");
    scanf("%d",&c);
    if(c==1){
    bubblesort(sortingarray,&a);}
    if(c==2){selectionsort(sortingarray,&a);}
    if(c==3){insertionsort(sortingarray,&a);}
    while(i<=a){printf("%d\t",sortingarray[i]);i++;}
    nickname();
    return 0;
}
Пример #13
0
// Component Character
void 
CEntityBuilder::buildCharacter ( TiXmlElement *pNode, Entity *e, Resources*){
  if ( pNode ){
    // Check nickname to identify entity
    std::string nickname ("XXX");
    pNode->QueryValueAttribute( "nickname", &nickname);
    // Parse stats
    TiXmlElement *pChar = pNode->FirstChildElement("stats");
    if ( pChar ){
      Character *character = new Character( nickname);
      for(; pChar; pChar= pChar->NextSiblingElement()){
        std::string name;
        long        value(0);
        if ( TIXML_SUCCESS == pChar->QueryValueAttribute( "name", &name) &&
            TIXML_SUCCESS == pChar->QueryValueAttribute( "value", &value)){
          buildStats( character, name, CVariant( value));
        }
      }
      e->addComponent( character);
    }
  }
}
Пример #14
0
void NetworkDialog::slotOkClicked()
{
        m_okButton->setEnabled(false);
        m_feedback->show();
       
        if (m_client) {
            m_feedback->setText(i18n("Connecting to remote host..."));
            m_socket = new QTcpSocket;
            connect(m_socket, &QTcpSocket::connected, this, &NetworkDialog::clientOK);
            connect(m_socket, static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error), this, &NetworkDialog::clientError);
            m_socket->connectToHost(m_hostname->text(), m_port->value());
        }
        else {
            m_feedback->setText(i18n("Waiting for an incoming connection..."));        
            QTcpServer* server = new QTcpServer;
            connect(server, &QTcpServer::newConnection, this, &NetworkDialog::serverOK);
            m_publisher=new KDNSSD::PublicService(nickname(), QLatin1Literal("_kbattleship._tcp"), m_port->value());
            m_publisher->publishAsync();
            
            server->listen(QHostAddress::Any, static_cast<quint16>(m_port->value()));
        }
}
Пример #15
0
SECStatus
AddCertificateFromFile(const char* basePath, const char* filename)
{
  char buf[16384] = { 0 };
  SECStatus rv = ReadFileToBuffer(basePath, filename, buf);
  if (rv != SECSuccess) {
    return rv;
  }
  SECItem certDER;
  rv = CERT_DecodeCertPackage(buf, strlen(buf), DecodeCertCallback, &certDER);
  if (rv != SECSuccess) {
    PrintPRError("CERT_DecodeCertPackage failed");
    return rv;
  }
  ScopedCERTCertificate cert(CERT_NewTempCertificate(CERT_GetDefaultCertDB(),
                                                     &certDER, nullptr, false,
                                                     true));
  PORT_Free(certDER.data);
  if (!cert) {
    PrintPRError("CERT_NewTempCertificate failed");
    return SECFailure;
  }
  ScopedPK11SlotInfo slot(PK11_GetInternalKeySlot());
  if (!slot) {
    PrintPRError("PK11_GetInternalKeySlot failed");
    return SECFailure;
  }
  // The nickname is the filename without '.pem'.
  std::string nickname(filename, strlen(filename) - 4);
  rv = PK11_ImportCert(slot, cert, CK_INVALID_HANDLE, nickname.c_str(), false);
  if (rv != SECSuccess) {
    PrintPRError("PK11_ImportCert failed");
    return rv;
  }
  return SECSuccess;
}
Пример #16
0
void PokeTeam::loadFromXml(const QDomElement &poke, int version)
{
    if (poke.hasAttribute("Gen")) {
        setGen(Pokemon::gen(poke.attribute("Gen", QString::number(GenInfo::GenMax())).toInt(),
                            poke.attribute("SubGen", QString::number(GenInfo::NumberOfSubgens(poke.attribute("Gen", QString::number(GenInfo::GenMax())).toInt())-1)).toInt()));
    }

    reset();

    /* Code to import old teams which had different formes registered as different pokemon numbers */
    int num = poke.attribute("Num").toInt();
    int forme = poke.attribute("Forme").toInt();

    if (gen().num == 4 && num > 493 && forme == 0 && !PokemonInfo::Exists(Pokemon::uniqueId(num, 0), 4)) {
        //Old way
        int indexes[] = {
            479,479,479,479,479,386,386,386,413,413,492,487
        };
        int formes[] = {
            1,2,3,4,5,1,2,3,1,2,1,1
        };

        int i = num - 494;

        setNum(Pokemon::uniqueId(indexes[i], formes[i]));
    } else {
        setNum(Pokemon::uniqueId(num, forme));
    }

    bool outdated = gen() < 5 && version < 1;

    load();
    nickname() = poke.attribute("Nickname");
    item() = poke.attribute("Item").toInt();
    ability() = poke.attribute("Ability").toInt();
    if (outdated) {
        ability() = AbilityInfo::ConvertFromOldAbility(ability());
    }
    nature() = poke.attribute("Nature").toInt();
    gender() = poke.attribute("Gender").toInt();
    shiny() = QVariant(poke.attribute("Shiny")).toBool();
    happiness() = poke.attribute("Happiness").toInt();
    level() = poke.attribute("Lvl").toInt();

    int cptMove=0;

    QDomElement moveElement = poke.firstChildElement("Move");
    while(!moveElement.isNull())
    {
        int movenum = moveElement.text().toInt();
        if (outdated) {
            movenum = MoveInfo::ConvertFromOldMove(movenum);
        }
        setMove(movenum,cptMove,false);
        cptMove++;
        moveElement = moveElement.nextSiblingElement("Move");
    }
    int cptDV=0;
    QDomElement DVElement = poke.firstChildElement("DV");
    while(!DVElement.isNull())
    {
        setDV(outdated ? NatureInfo::ConvertToStat(cptDV) : cptDV,DVElement.text().toInt());
        cptDV++;
        DVElement = DVElement.nextSiblingElement("DV");
    }
    int cptEV=0;
    QDomElement EVElement = poke.firstChildElement("EV");
    while(!EVElement.isNull())
    {
        setEV(outdated ? NatureInfo::ConvertToStat(cptEV) : cptEV,EVElement.text().toInt());
        cptEV++;
        EVElement = EVElement.nextSiblingElement("EV");
    }
}
Пример #17
0
void PokeTeam::sanityCheck()
{
    if (nickname().length() > 20) {
        nickname().resize(20);
    }
}
Пример #18
0
/*!
  Returns a rich text formatted QString representing the contents the contact.
*/
QString OPimContact::toRichText() const
{
    QString text;
    QString value, comp, state;
    QString str;
    bool marker = false;

    Config cfg( "qpe" );
    cfg.setGroup( "Appearance" );
    int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );

    // name, jobtitle and company
    if ( !( value = fullName() ).isEmpty() )
        text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString( value ) + "</h3></b>";

    if ( !( value = jobTitle() ).isEmpty() )
        text += Qtopia::escapeString( value ) + " ";

    comp = company();
    if ( !( value = department() ).isEmpty() )
    {
        text += Qtopia::escapeString( value );
        if ( comp )
            text += ", " + Qtopia::escapeString( comp );
    }
    else if ( comp )
        text += "<br>" + Qtopia::escapeString( comp );
    text += "<br><hr>";

    // defailt email
    QString defEmail = defaultEmail();
    if ( !defEmail.isEmpty() )
    {
        text += "<b><img src=\"addressbook/email\"> " + QObject::tr( "Default Email: " ) + "</b>"
                + Qtopia::escapeString( defEmail );
        marker = true;
    }

    // business address
    if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
            !businessZip().isEmpty() || !businessCountry().isEmpty() )
    {
        text += QObject::tr( "<br><b>Work Address:</b>" );
        marker = true;
    }

    if ( !( value = businessStreet() ).isEmpty() )
    {
        text += "<br>" + Qtopia::escapeString( value );
        marker = true;
    }

    switch ( addressformat )
    {
    case Zip_City_State:
        { //  Zip_Code City, State
            state = businessState();
            if ( !( value = businessZip() ).isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( value ) + " ";
                marker = true;

            }
            if ( !( value = businessCity() ).isEmpty() )
            {
                marker = true;
                if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
                    text += "<br>";
                text += Qtopia::escapeString( value );
                if ( state )
                    text += ", " + Qtopia::escapeString( state );
            }
            else if ( !state.isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( state );
                marker = true;
            }
            break;
        }
    case City_State_Zip:
        { // City, State Zip_Code
            state = businessState();
            if ( !( value = businessCity() ).isEmpty() )
            {
                marker = true;
                text += "<br>" + Qtopia::escapeString( value );
                if ( state )
                    text += ", " + Qtopia::escapeString( state );
            }
            else if ( !state.isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( state );
                marker = true;
            }
            if ( !( value = businessZip() ).isEmpty() )
            {
                text += " " + Qtopia::escapeString( value );
                marker = true;
            }
            break;
        }
    }

    if ( !( value = businessCountry() ).isEmpty() )
    {
        text += "<br>" + Qtopia::escapeString( value );
        marker = true;
    }

    // rest of Business data
    str = office();
    if ( !str.isEmpty() )
    {
        text += "<br><b>" + QObject::tr( "Office: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = businessWebpage();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr( "Business Web Page: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = businessPhone();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr( "Business Phone: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = businessFax();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr( "Business Fax: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = businessMobile();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr( "Business Mobile: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = businessPager();
    if ( !str.isEmpty() )
    {
        text += "<br><b>" + QObject::tr( "Business Pager: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }

    // text += "<br>";

    // home address
    if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
            !homeZip().isEmpty() || !homeCountry().isEmpty() )
    {
        text += QObject::tr( "<br><b>Home Address:</b>" );
        marker = true;
    }

    if ( !( value = homeStreet() ).isEmpty() )
    {
        text += "<br>" + Qtopia::escapeString( value );
        marker = true;
    }

    switch ( addressformat )
    {
    case Zip_City_State:
        { //  Zip_Code City, State
            state = homeState();
            if ( !( value = homeZip() ).isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( value ) + " ";
                marker = true;
            }
            if ( !( value = homeCity() ).isEmpty() )
            {
                marker = true;
                if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
                    text += "<br>";
                text += Qtopia::escapeString( value );
                if ( !state.isEmpty() )
                    text += ", " + Qtopia::escapeString( state );
            }
            else if ( !state.isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( state );
                marker = true;
            }
            break;
        }
    case City_State_Zip:
        { // City, State Zip_Code
            state = homeState();
            if ( !( value = homeCity() ).isEmpty() )
            {
                marker = true;
                text += "<br>" + Qtopia::escapeString( value );
                if ( state )
                    text += ", " + Qtopia::escapeString( state );
            }
            else if ( !state.isEmpty() )
            {
                text += "<br>" + Qtopia::escapeString( state );
                marker = true;
            }
            if ( !( value = homeZip() ).isEmpty() )
            {
                text += " " + Qtopia::escapeString( value );
                marker = true;
            }
            break;
        }
    }

    if ( !( value = homeCountry() ).isEmpty() )
    {
        text += "<br>" + Qtopia::escapeString( value );
        marker = true;
    }

    // rest of Home data
    str = homeWebpage();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr( "Home Web Page: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = homePhone();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr( "Home Phone: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = homeFax();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr( "Home Fax: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }
    str = homeMobile();
    if ( !str.isEmpty() )
    {
        text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr( "Home Mobile: " ) + "</b>"
                + Qtopia::escapeString( str );
        marker = true;
    }

    if ( marker )
        text += "<br><hr>";

    // the rest...
    str = emails();
    if ( !str.isEmpty() && ( str != defEmail ) )
        text += "<br><b>" + QObject::tr( "All Emails: " ) + "</b>"
                + Qtopia::escapeString( str );
    str = profession();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Profession: " ) + "</b>"
                + Qtopia::escapeString( str );
    str = assistant();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Assistant: " ) + "</b>"
                + Qtopia::escapeString( str );
    str = manager();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Manager: " ) + "</b>"
                + Qtopia::escapeString( str );
    str = gender();
    if ( !str.isEmpty() && str.toInt() != 0 )
    {
        text += "<br>";
        if ( str.toInt() == 1 )
            str = QObject::tr( "Male" );
        else if ( str.toInt() == 2 )
            str = QObject::tr( "Female" );
        text += "<b>" + QObject::tr( "Gender: " ) + "</b>" + str;
    }
    str = spouse();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Spouse: " ) + "</b>"
                + Qtopia::escapeString( str );
    if ( birthday().isValid() )
    {
        str = TimeString::numberDateString( birthday() );
        text += "<br><b>" + QObject::tr( "Birthday: " ) + "</b>"
                + Qtopia::escapeString( str );
    }
    if ( anniversary().isValid() )
    {
        str = TimeString::numberDateString( anniversary() );
        text += "<br><b>" + QObject::tr( "Anniversary: " ) + "</b>"
                + Qtopia::escapeString( str );
    }
    str = children();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Children: " ) + "</b>"
                + Qtopia::escapeString( str );

    str = nickname();
    if ( !str.isEmpty() )
        text += "<br><b>" + QObject::tr( "Nickname: " ) + "</b>"
                + Qtopia::escapeString( str );

    // categories
    if ( categoryNames( "Contacts" ).count() )
    {
        text += "<br><b>" + QObject::tr( "Category:" ) + "</b> ";
        text += categoryNames( "Contacts" ).join( ", " );
    }

    // notes last
    if ( !( value = notes() ).isEmpty() )
    {
        text += "<br><hr><b>" + QObject::tr( "Notes:" ) + "</b> ";
        QRegExp reg( "\n" );

        //QString tmp = Qtopia::escapeString(value);
        QString tmp = QStyleSheet::convertFromPlainText( value );
        //tmp.replace( reg, "<br>" );
        text += "<br>" + tmp + "<br>";
    }
    return text;
}