コード例 #1
0
ファイル: tododialog.cpp プロジェクト: pbek/QOwnNotes
/**
 * @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);
    }
}
コード例 #2
0
ファイル: tododialog.cpp プロジェクト: calis2002/QOwnNotes
/**
 * @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);
    }
}