예제 #1
0
/**
 * @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);
    }
}
예제 #2
0
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(&currentCalendarItem);

    // post the calendar item to the server
    ownCloud->postCalendarItemToServer(currentCalendarItem, this);

    qDebug() << currentCalendarItem;
}
예제 #3
0
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();
}
예제 #4
0
void TodoDialog::on_saveButton_clicked() {
    MetricsService::instance()->sendVisitIfEnabled("todo/item/stored");

    updateCurrentCalendarItemWithFormData();

    OwnCloudService *ownCloud = OwnCloudService::instance();

    // update the local icsData from server
    ownCloud->updateICSDataOfCalendarItem(&currentCalendarItem);

    // post the calendar item to the server
    ownCloud->postCalendarItemToServer(currentCalendarItem, this);

    qDebug() << currentCalendarItem;

    QSettings settings;
    if (settings.value("closeTodoListAfterSave").toBool()) {
        close();
    }
}
예제 #5
0
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();
}