/** * @brief Updates the completed state of a calendar item on the ownCloud server * @param item */ void TodoDialog::on_todoList_itemChanged(QListWidgetItem *item) { qDebug() << __func__ << " - 'item': " << item; QString uid = item->data(Qt::UserRole).toString(); CalendarItem calItem = CalendarItem::fetchByUid(uid); if (calItem.isFetched()) { calItem.updateCompleted(item->checkState() == Qt::Checked); calItem.store(); OwnCloudService *ownCloud = OwnCloudService::instance(); // post the calendar item to the server ownCloud->postCalendarItemToServer(calItem, this); } }
void TodoDialog::on_saveButton_clicked() { MetricsService::instance()->sendEvent("todo list", "todo item stored"); updateCurrentCalendarItemWithFormData(); OwnCloudService *ownCloud = new OwnCloudService(crypto, this); // update the local icsData from server ownCloud->updateICSDataOfCalendarItem(¤tCalendarItem); // post the calendar item to the server ownCloud->postCalendarItemToServer(currentCalendarItem, this); qDebug() << currentCalendarItem; }
void TodoDialog::on_newItemEdit_returnPressed() { CalendarItem calItem = CalendarItem::createNewTodoItem( ui->newItemEdit->text(), ui->todoListSelector->currentText()); lastCreatedCalendarItem = calItem; OwnCloudService *ownCloud = new OwnCloudService(crypto, this); // post the calendar item to the server ownCloud->postCalendarItemToServer(calItem, this); // if ( calItem.isFetched() ) // { // qDebug() << __func__ << " - 'calItem': " << calItem; // reloadTodoListItems(); // } ui->newItemEdit->clear(); }
void TodoDialog::on_saveButton_clicked() { MetricsService::instance()->sendVisitIfEnabled("todo/item/stored"); updateCurrentCalendarItemWithFormData(); OwnCloudService *ownCloud = OwnCloudService::instance(); // update the local icsData from server ownCloud->updateICSDataOfCalendarItem(¤tCalendarItem); // post the calendar item to the server ownCloud->postCalendarItemToServer(currentCalendarItem, this); qDebug() << currentCalendarItem; QSettings settings; if (settings.value("closeTodoListAfterSave").toBool()) { close(); } }
void TodoDialog::on_newItemEdit_returnPressed() { CalendarItem calItem = CalendarItem::createNewTodoItem( ui->newItemEdit->text(), ui->todoListSelector->currentText()); lastCreatedCalendarItem = calItem; // set the focus to the description edit after we loaded the tasks _setFocusToDescriptionEdit = true; OwnCloudService *ownCloud = OwnCloudService::instance(); // post the calendar item to the server ownCloud->postCalendarItemToServer(calItem, this); // if ( calItem.isFetched() ) // { // qDebug() << __func__ << " - 'calItem': " << calItem; // reloadTodoListItems(); // } ui->newItemEdit->clear(); }