/** * Add data to the contact. * All fields must be empty. */ void PIMContact::addDataToContact() { printf("\n==============Add data to contact==============\n"); printf(sFieldSeparator); addContactName(); waitForClick(); addAddress(); waitForClick(); addBirthday(); waitForClick(); addEmail(); waitForClick(); addNickname(); waitForClick(); addNote(); waitForClick(); addOrg(); waitForClick(); // If you want to set a photo URL call addPhotoURL method instead of // addPhoto method. addPhoto(); waitForClick(); addPhone(); waitForClick(); addTitle(); waitForClick(); addURL(); waitForClick(); addIM(); waitForClick(); addRelation(); waitForClick(); addOrgInfo(); waitForClick(); }
void PersonView::slotLinkClicked( const QUrl &url ) { qDebug() << "CLICKED" << url; if ( url.scheme() == "polka" ) { QStringList path = url.path().split("/"); QString action = path.first(); qDebug() << "ACTION" << action; if ( action == "editName" ) editName(); else if ( action == "addEmail" ) addEmail(); else if ( action == "editEmail" ) editEmail( path.value( 1 ) ); else if ( action == "removeEmail" ) removeEmail( path.value( 1 ) ); else if ( action == "commentEmail" ) commentEmail( path.value( 1 ) ); else if ( action == "addPhone" ) addPhone(); else if ( action == "editPhone" ) editPhone( path.value( 1 ) ); else if ( action == "removePhone" ) removePhone( path.value( 1 ) ); else if ( action == "commentPhone" ) commentPhone( path.value( 1 ) ); else if ( action == "addLink" ) addLink(); else if ( action == "editLink" ) editLink( path.value( 1 ) ); else if ( action == "removeLink" ) removeLink( path.value( 1 ) ); else if ( action == "commentLink" ) commentLink( path.value( 1 ) ); else if ( action == "addAddress" ) addAddress(); else if ( action == "editAddress" ) editAddress( path.value( 1 ) ); else if ( action == "removeAddress" ) removeAddress( path.value( 1 ) ); else if ( action == "commentAddress" ) commentAddress( path.value( 1 ) ); else if ( action == "addComment" ) addComment(); else if ( action == "editComment" ) editComment( path.value( 1 ) ); else if ( action == "removeComment" ) removeComment( path.value( 1 ) ); else if ( action == "close" ) requestClose(); else if ( action == "magic" ) debugHtml(); else qDebug() << "unknown action" << action; } else { new KRun( QUrl( url ), this ); } }
//-------------------------------------------------------------- void testApp::setup() { ofSetVerticalSync(true); ofBackgroundHex(0x333333); ofSetLogLevel(OF_LOG_NOTICE); loadColors(); ofSetCircleResolution(200); numEmailsStart = 20; numCategories = 5; radius = 24; unitRadius = 80; xShift = 70; yShift = 10; saved = 0; trash = 0; box2d.init(); box2d.setFPS(30.0); box2d.registerGrabbing(); box2d.setGravity(-8,8); box2d.createBounds(0,0,ofGetWidth()+1000,ofGetHeight()); for(int i=0; i<numCategories; i++) { resetAttractionPoints(numCategories); } // add email/circles to world for (int i=0; i < numEmailsStart; i++) { addEmail(i % numCategories); emails[i].setInitialConditions(); } }
MainInfo::MainInfo(QWidget *p, bool readOnly) : MainInfoBase(p) { bReadOnly = readOnly; lblPict->setPixmap(Pict("main")); edtUin->setReadOnly(true); cmbDisplay->setEditable(true); connect(lstEmail, SIGNAL(highlighted(int)), this, SLOT(setButtons(int))); connect(btnAdd, SIGNAL(clicked()), this, SLOT(addEmail())); connect(btnEdit, SIGNAL(clicked()), this, SLOT(editEmail())); connect(btnRemove, SIGNAL(clicked()), this, SLOT(removeEmail())); connect(btnDefault, SIGNAL(clicked()), this, SLOT(defaultEmail())); if (!readOnly){ lblNotes->hide(); edtNotes->hide(); load(pClient); }else{ edtUin->hide(); lblUin->hide(); lineDiv->hide(); } }
void LogicPerson::setData(const QString fieldName, QString value) { if(fieldName == "level") { pushLevel(value); } else if(fieldName == "customer_no" or fieldName == "customerNO") { setCustomerNO(value); } else if(fieldName == "card_no" or fieldName == "cardNO") { addCardNO(value); } else if(fieldName == "email") { addEmail(value); } else if(fieldName == "id") { setId(value); } else if(fieldName == "name") { setName(value); } else if(fieldName == "mobile") { addMobile(value); } //jaky,email重复,以删除,问题:tel和mobile是不是应该归一组 else if(fieldName == "tel") { addMobile(value); } }
//-------------------------------------------------------------- void testApp::setup() { ofSetVerticalSync(true); ofBackgroundHex(0x333333); ofSetLogLevel(OF_LOG_NOTICE); loadColors(); // load NYTimes data dataString = fileLoader.loadFromUrl("http://localhost/algo/algo-dummy_data.txt"); result = ofSplitString(dataString, "!"); for(int i = 0; i< result.size(); i++){ if(tempResult.size() > 0){ tempResult.clear(); } tempResult = ofSplitString(result[i], "#"); nestedResults.push_back(tempResult); } // for(int i=0; i< nestedResults[0].size(); i++){ // cout << nestedResults[0][i] << "###\n"; // } numEmailsStart = 80; numCategories = 20; radius = 12; unitRadius = 80; xShift = 70; yShift = 10; saved = 0; trash = 0; box2d.init(); box2d.setFPS(30.0); box2d.registerGrabbing(); box2d.setGravity(-8,8); box2d.createBounds(0,0,ofGetWidth()+1000,ofGetHeight()); for(int i=0; i<numCategories; i++) { resetAttractionPoints(numCategories); } // add email/circles to world for (int i=0; i < numEmailsStart; i++) { addEmail(i % numCategories); emails[i].setInitialConditions(); } }
//-------------------------------------------------------------- void testApp::setup() { ofSetVerticalSync(true); ofSetLogLevel(OF_LOG_NOTICE); ofEnableAlphaBlending(); ofBackgroundHex(0x333333); bgImage.loadImage("bg.png"); loadColors(); sortByCategory = false; // bool mousePressed = false; ofTrueTypeFont::setGlobalDpi(72); myFont.loadFont("GothamHTF-Bold.otf", 29, true, true, true); myFontMed.loadFont("GothamHTF-Bold.otf", 18, true, true, true); myFontSmall.loadFont("GothamHTF-Bold.otf", 14, true, true, true); myFont.setLineHeight(28.0f); myFontSmall.setLineHeight(18.0f); myFontMed.setLetterSpacing(.95); // myFont.loadFont("GothamHTF-Bold.otf", 32, true, true, true); typeString = "hiyoooo"; // load NYTimes data dataString = fileLoader.loadFromUrl("http://localhost/algo/algo-dummy_data.txt"); result = ofSplitString(dataString, "!"); for(int i = 0; i< result.size(); i++){ if(tempResult.size() > 0){ tempResult.clear(); } tempResult = ofSplitString(result[i], "#"); nestedResults.push_back(tempResult); } // for(int i=0; i< nestedResults[0].size(); i++){ // cout << nestedResults[0][i] << "###\n"; // } numEmailsStart = 80; numCategoriesStart = 20; numCategories = 20; radius = 17; unitRadius = 110; xShift = 0; yShift = 20; saved = 0; trash = 0; box2d.init(); box2d.setFPS(30.0); box2d.registerGrabbing(); box2d.setGravity(0,0); box2d.createBounds(0,0,ofGetWidth()+1000,ofGetHeight()); for(int i=0; i<numCategoriesStart; i++) { // resetAttractionPoints(numCategories); catHasArticles[i] = false; } // add email/circles to world for (int i=0; i < numEmailsStart; i++) { if(nestedResults[i].size() > 0) { if(indexForCategory(nestedResults[i][CATEGORY]) > -1){ // addEmail(i%numCategories); addEmail(indexForCategory(nestedResults[i][CATEGORY]), i); // keeping track of which articles actually have articles in them catHasArticles[indexForCategory(nestedResults[i][CATEGORY])] = true; } } } for (int i=0; i<emails.size(); i++) { emails[i].setInitialConditions(); } //now keep track of reverse (what index is for current category) for(int i=0; i<numCategoriesStart; i++) { if(catHasArticles[i] == true){ categoriesWithArticles.push_back(i); currentCategoryKeys[i] = categoriesWithArticles.size() -1; } else { currentCategoryKeys[i] = -1; } } for(int i=0; i<numCategoriesStart; i++) { cout << currentCategoryKeys[i] << "\n"; } numCategories = categoriesWithArticles.size(); for (int i = 0; i < numCategories ; i++) { resetAttractionPoints(numCategories); } ; }
void ContactDialog::setData(const ContactItem& c) { setWindowTitle(tr("Edit contact")); // Names ui->leFullName->setText(c.fullName); for (int i=0; i<c.names.count(); i++) addName(c.names[i]); // Phones for (int i=0; i<c.phones.count(); i++) addPhone(c.phones[i]); // Emails for (int i=0; i<c.emails.count(); i++) addEmail(c.emails[i]); // Birthday and anniversaries ui->cbBirthday->setChecked(c.birthday.value.isValid()); ui->dteBirthday->setEnabled(c.birthday.value.isValid()); ui->btnBDayDetails->setEnabled(c.birthday.value.isValid()); if (c.birthday.value.isValid()) ui->dteBirthday->setDateTime(c.birthday.value); birthdayDetails = c.birthday; DateDetailsDialog::setDateFormat(ui->dteBirthday, birthdayDetails.hasTime); anniversaryDetails.clear(); for (int i=0; i<c.anniversaries.count(); i++) addAnniversary(c.anniversaries[i]); // Photo if (c.photoType=="URL") ui->lbPhotoContent->setText(c.photoUrl); else if (c.photoType.toUpper()=="JPEG" || c.photoType.toUpper()=="PNG") { photo = c.photo; QPixmap pixPhoto; pixPhoto.loadFromData(photo); ui->lbPhotoContent->setPixmap(pixPhoto); } else if (!c.photo.isEmpty()) ui->lbPhotoContent->setText(S_PH_UNKNOWN_FORMAT); updatePhotoMenu(); // Addresses addAddress(ui->gbAddrHome, c.addrHome); addAddress(ui->gbAddrWork, c.addrWork); //Internet ui->leNickName->setText(c.nickName); ui->leURL->setText(c.url); ui->leJabber->setText(c.jabberName); ui->leICQ->setText(c.icqName); ui->leSkype->setText(c.skypeName); // Work ui->leOrganization->setText(c.organization); ui->leTitle->setText(c.title); // Other ui->leSortString->setText(c.sortString); ui->edDescription->setPlainText(c.description); ui->lbOriginalFormatValue->setText(c.originalFormat); ui->lbFormatVersionValue->setText(c.version); ui->lbIDValue->setText(c.id); ui->twOtherTags->setRowCount(c.otherTags.count()); int index = 0; foreach (const TagValue& tag, c.otherTags) { ui->twOtherTags->setItem(index, 0, new QTableWidgetItem(tag.tag)); ui->twOtherTags->setItem(index, 1, new QTableWidgetItem(tag.value)); index++; } // Unknown tags ui->twUnknownTags->setRowCount(c.unknownTags.count()); index = 0; foreach (const TagValue& tag, c.unknownTags) { ui->twUnknownTags->setItem(index, 0, new QTableWidgetItem(tag.tag)); ui->twUnknownTags->setItem(index, 1, new QTableWidgetItem(tag.value)); index++; } }