Ejemplo n.º 1
0
BOOL CWizKMDatabaseServer::document_downloadFullListEx(const CWizStdStringArray& arrayDocumentGUID, std::deque<WIZDOCUMENTDATAEX>& arrayRet)
{
    int nCountPerPage = 30;
    //
    CWizStdStringArray::const_iterator it = arrayDocumentGUID.begin();
    //
    while (1)
    {
        //
        CWizStdStringArray subArray;
        //
        for (;
            it != arrayDocumentGUID.end(); )
        {
            subArray.push_back(*it);
            it++;
            //
            if (subArray.size() == nCountPerPage)
                break;
        }
        //
        std::deque<WIZDOCUMENTDATAEX> subRet;
        if (!document_downloadFullList(subArray, subRet))
            return FALSE;
        //
        arrayRet.insert(arrayRet.end(), subRet.begin(), subRet.end());
        //
        if (it == arrayDocumentGUID.end())
            break;
    }
    //
    return TRUE;
}
Ejemplo n.º 2
0
    void updateInformation(CWizDatabase& db, const WIZDOCUMENTDATA& doc)
    {
        // retrieve document info and reset
        WIZDOCUMENTDATA data;
        if (!db.DocumentFromGUID(doc.strGUID, data)) {
            return;
        }

        //title
        if (m_titleEdit->text() != data.strTitle) {
            m_titleEdit->setText(data.strTitle);
        }

        //tags
        CWizStdStringArray arrayTagGUID;
        db.GetDocumentTags(data.strGUID, arrayTagGUID);

        QString strTagText = arrayTagGUID.empty() ? QString() : QString::number(arrayTagGUID.size());
        m_tagsButton->setText(strTagText);

        QString tagsShortcut = ::WizGetShortcut("EditNoteTags", "Alt+2");
        QString strTagsToolTip = QObject::tr("Tags (%1)").arg(tagsShortcut);
        m_tagsButton->setToolTip(strTagsToolTip);
        m_tagsButton->setShortcut(QKeySequence::fromString(tagsShortcut));

        //attachments
        int nAttachmentCount = db.GetDocumentAttachmentCount(data.strGUID);
        CString strAttachmentText = nAttachmentCount ? WizIntToStr(nAttachmentCount) : CString();
        m_attachmentButton->setText(strAttachmentText);
        QString attachmentShortcut = ::WizGetShortcut("EditNoteAttachments", "Alt+3");
        m_attachmentButton->setToolTip(QObject::tr("Attachments (%1)").arg(attachmentShortcut));
        m_attachmentButton->setShortcut(QKeySequence::fromString(attachmentShortcut));
    }