void TodoView::updateItem(int row, int col) { QString tmpStr; int x=0, y=0; int id; updatingRow = row; ASSERT(row >= 0); editingFlag = TRUE; tmpStr = text(row, 0); id = atol(tmpStr.data()); aTodo = calendar->getTodo(id); editor->hide(); editor->setText(aTodo->getSummary()); colXPos(col, &x); rowYPos(row, &y); y += 17; // correct for header size. // first, see if they clicked on the "done/not done column"; if (col == 1) { tmpStr = text(row, 1); if (tmpStr == "CHECKED" || tmpStr == "CHECKEDMASK") { aTodo->setStatus(QString("NEEDS ACTION")); changeItemPart("EMPTY", row, 1); } else { aTodo->setDtEnd(QDateTime::currentDateTime()); aTodo->setStatus(QString("COMPLETED")); changeItemPart("CHECKED", row, 1); } } // see if they clicked on the "priority" column if (col == 2) { priList->move(x, y+2); priList->setCurrentItem(aTodo->getPriority()-1); priList->setFocus(); priList->show(); } // they clicked on the "description" column if (col == 3) { editor->move(x, y+2); editor->setFixedWidth(columnWidth(3)); editor->setFixedHeight(cellHeight(row)); editor->setFocus(); editor->show(); } if (col == 4) { // handle due date stuff } adjustColumns(); }
// this is basically a method to change which pixmap is displayed when // an event gets hilighted (black doesn't show up well on select backgrounds) void TodoView::hiliteAction(int row, int /*col*/) { setUpdatesEnabled(FALSE); if (prevRow != -1) { if (strcmp("CHECKEDMASK", text(prevRow, 1).data()) == 0) changeItemPart("CHECKED", prevRow, 1); else if (strcmp("EMPTYMASK", text(prevRow, 1).data()) == 0) changeItemPart("EMPTY", prevRow, 1); } if (strcmp("CHECKED", text(row, 1).data()) == 0) changeItemPart("CHECKEDMASK", row, 1); else if (strcmp("EMPTY", text(row, 1).data()) == 0) changeItemPart("EMPTYMASK", row, 1); prevRow = row; setUpdatesEnabled(TRUE); }
void TodoView::changePriority(int pri) { QString s; aTodo->setPriority(pri+1); s.sprintf("%d",pri+1); changeItemPart(s.data(), updatingRow, 2); }
bool KCalls::SetLine(int Line, const CALL *Info) { int i = 0; changeItemPart(statetoa(Info->stat), Line, i++); changeItemPart(directiontoa(Info->dialin), Line, i++); changeItemPart(emptytoa(Info->num[_ME(Info)]), Line, i++); changeItemPart(emptytoa(Info->alias[_ME(Info)]), Line, i++); changeItemPart(emptytoa(Info->num[_OTHER(Info)]), Line, i++); changeItemPart(emptytoa(Info->vorwahl[_OTHER(Info)]), Line, i++); changeItemPart(emptytoa(Info->rufnummer[_OTHER(Info)]), Line, i++); changeItemPart(emptytoa(Info->alias[_OTHER(Info)]), Line, i++); changeItemPart(emptytoa(Info->area[_OTHER(Info)]), Line, i++); changeItemPart(timetoa(Info->connect), Line, i++); changeItemPart(durationtoa(Info->t_duration), Line, i++); changeItemPart(MsgHdl::ltoa(Info->aoce), Line, i++); changeItemPart(Info->money, Line, i++); changeItemPart(Info->currency, Line, i++); changeItemPart(Byte2Str((double) Info->ibytes, NO_DIR), Line, i++); changeItemPart(Byte2Str((double) Info->obytes, NO_DIR), Line, i++); changeItemPart(Byte2Str(Info->ibps, GET_BPS|NO_DIR), Line, i++); changeItemPart(Byte2Str(Info->obps, GET_BPS|NO_DIR), Line, i++); changeItemPart(Info->msg, Line, i++); return TRUE; }
void TodoView::updateSummary() { changeItemPart(tmpSummary, updatingRow, 3); aTodo->setSummary(tmpSummary); editor->setText(""); // clear it out }