void SettingsDialog::on_reloadCalendarListButton_clicked() { // we need to store the calendar backend storeSettings(); OwnCloudService *ownCloud = new OwnCloudService(crypto, this); ownCloud->settingsGetCalendarList(this); }
/** * @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(); }
/** * @brief Removes the currently selected task from the ownCloud server */ void TodoDialog::on_removeButton_clicked() { if (Utils::Gui::question( this, tr("Remove todo item"), tr("Remove the selected todo item?\nThis cannot be undone!"), "remove-todo-items") == QMessageBox::Yes) { CalendarItem calItem = currentCalendarItem; // remove the calendar item from the list widget // (this will update the currentCalendarItem) ui->todoList->takeItem(ui->todoList->currentRow()); // remove the calendar item from the database calItem.remove(); // remove the calendar item from the ownCloud server // (this will reload the task list as well) OwnCloudService *ownCloud = OwnCloudService::instance(); ownCloud->removeCalendarItem(calItem, this); } }
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(); } }
/** * @brief Removes the currently selected todo list item from the ownCloud server */ void TodoDialog::on_removeButton_clicked() { if (QMessageBox::information( this, "Remove todo item", "Remove the selected todo item?\nThis cannot be undone!", "&Remove", "&Cancel", QString::null, 0, 1) == 0) { CalendarItem calItem = currentCalendarItem; // remove the calendar item from the list widget // (this will update the currentCalendarItem) ui->todoList->takeItem(ui->todoList->currentRow()); // remove the calendar item from the database calItem.remove(); // remove the calendar item from the ownCloud server // (this will reload the todo list as well) OwnCloudService *ownCloud = new OwnCloudService(crypto, this); ownCloud->removeCalendarItem(calItem, this); } }
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(); }
/** * @brief Starts a connection test */ void SettingsDialog::startConnectionTest() { ui->connectionTestLabel->hide(); OwnCloudService *ownCloud = new OwnCloudService(crypto, this); ownCloud->settingsConnectionTest(this); }
/** * @brief Fetches the items of the current task list from ownCloud */ void TodoDialog::reloadTodoList() { ui->todoItemLoadingProgressBar->setValue(0); ui->todoItemLoadingProgressBar->show(); OwnCloudService *ownCloud = OwnCloudService::instance(); ownCloud->todoGetTodoList(ui->todoListSelector->currentText(), this); }