Example #1
0
void WriteMail::setComposer( const QString &key )
{
    if (m_composerInterface && m_composerInterface->key() == key) {
        // We can reuse the existing composer object
        m_composerInterface->clear();
        return;
    }

    if (m_composerInterface) {
        // Remove any associated widgets
        m_widgetStack->removeWidget(m_composerInterface);
        //delete m_composerInterface;
        m_composerInterface = 0;
    }

    m_composerInterface = QMailComposerFactory::create( key, this );
    if (!m_composerInterface)
        return;

    connect( m_composerInterface, SIGNAL(changed()), this, SLOT(messageModified()) );
    connect( m_composerInterface, SIGNAL(cancel()), this, SLOT(saveChangesOnRequest()));
    connect( m_composerInterface, SIGNAL(statusChanged(QString)), this, SLOT(statusChanged(QString)));

    m_widgetStack->addWidget(m_composerInterface);

    foreach(QAction* a, m_composerInterface->actions())
        m_toolbar->addAction(a);

    m_composerInterface->setFocus();
}
Example #2
0
bool CWizIndexBase::modifyMessageEx(const WIZMESSAGEDATA& data)
{
    qDebug() << "modify message, id: " << data.nId;

    WIZMESSAGEDATA dataOld;
    messageFromId(data.nId, dataOld);

    CString strFormat = FormatUpdateSQLFormat(TABLE_NAME_WIZ_MESSAGE,
                                              FIELD_LIST_WIZ_MESSAGE_MODIFY,
                                              TABLE_KEY_WIZ_MESSAGE);

    CString strSQL;
    strSQL.Format(strFormat,
                  data.nReadStatus,
                  WizInt64ToStr(data.nVersion).utf16(),
                  WizInt64ToStr(data.nId).utf16()
        );

    if (!ExecSQL(strSQL))
        return false;

    WIZMESSAGEDATA dataNew;
    messageFromId(data.nId, dataNew);

    if (!m_bUpdating) {
        emit messageModified(dataOld, dataNew);
    }

    return true;
}
void CWizDatabaseManager::initSignals(CWizDatabase* db)
{
    connect(db, SIGNAL(groupsInfoDownloaded(const CWizGroupDataArray&)),
            SLOT(on_groupsInfoDownloaded(const CWizGroupDataArray&)),
            Qt::BlockingQueuedConnection);

    //connect(db, SIGNAL(databaseOpened(const QString&)),
    //        SIGNAL(databaseOpened(const QString&)));

    connect(db, SIGNAL(databaseRename(const QString&)),
            SIGNAL(databaseRename(const QString&)));

    connect(db, SIGNAL(databasePermissionChanged(const QString&)),
            SIGNAL(databasePermissionChanged(const QString&)));

    connect(db, SIGNAL(databaseBizChanged(const QString&)),
            SIGNAL(databaseBizchanged(const QString&)));

    connect(db, SIGNAL(userIdChanged(QString,QString)),
            SIGNAL(userIdChanged(QString,QString)));

    connect(db, SIGNAL(tagCreated(const WIZTAGDATA&)),
            SIGNAL(tagCreated(const WIZTAGDATA&)));
    connect(db, SIGNAL(tagModified(const WIZTAGDATA&, const WIZTAGDATA&)),
            SIGNAL(tagModified(const WIZTAGDATA&, const WIZTAGDATA&)));
    connect(db, SIGNAL(tagDeleted(const WIZTAGDATA&)),
            SIGNAL(tagDeleted(const WIZTAGDATA&)));

    connect(db, SIGNAL(styleCreated(const WIZSTYLEDATA&)),
            SIGNAL(styleCreated(const WIZSTYLEDATA&)));
    connect(db, SIGNAL(styleModified(const WIZSTYLEDATA&, const WIZSTYLEDATA&)),
            SIGNAL(styleModified(const WIZSTYLEDATA&, const WIZSTYLEDATA&)));
    connect(db, SIGNAL(styleDeleted(const WIZSTYLEDATA&)),
            SIGNAL(styleDeleted(const WIZSTYLEDATA&)));

    connect(db, SIGNAL(documentCreated(const WIZDOCUMENTDATA&)),
            SIGNAL(documentCreated(const WIZDOCUMENTDATA&)));
    connect(db, SIGNAL(documentModified(const WIZDOCUMENTDATA&, const WIZDOCUMENTDATA&)),
            SIGNAL(documentModified(const WIZDOCUMENTDATA&, const WIZDOCUMENTDATA&)));
    connect(db, SIGNAL(documentDeleted(const WIZDOCUMENTDATA&)),
            SIGNAL(documentDeleted(const WIZDOCUMENTDATA&)));

    connect(db, SIGNAL(documentTagModified(const WIZDOCUMENTDATA&)),
            SIGNAL(documentTagModified(const WIZDOCUMENTDATA&)));

    connect(db, SIGNAL(documentReadCountChanged(const WIZDOCUMENTDATA&)),
            SIGNAL(documentReadCountChanged(const WIZDOCUMENTDATA&)));

    connect(db, SIGNAL(documentDataModified(const WIZDOCUMENTDATA&)),
            SIGNAL(documentDataModified(const WIZDOCUMENTDATA&)));
    connect(db, SIGNAL(documentAbstractModified(const WIZDOCUMENTDATA&)),
            SIGNAL(documentAbstractModified(const WIZDOCUMENTDATA&)));

    connect(db, SIGNAL(documentUploaded(QString,QString)),
            SIGNAL(documentUploaded(QString,QString)));

    connect(db,SIGNAL(groupDocumentUnreadCountModified(QString)),
            SIGNAL(groupDocumentUnreadCountModified(QString)));

    connect(db, SIGNAL(attachmentCreated(const WIZDOCUMENTATTACHMENTDATA&)),
            SIGNAL(attachmentCreated(const WIZDOCUMENTATTACHMENTDATA&)));
    connect(db, SIGNAL(attachmentModified(const WIZDOCUMENTATTACHMENTDATA&, const WIZDOCUMENTATTACHMENTDATA&)),
            SIGNAL(attachmentModified(const WIZDOCUMENTATTACHMENTDATA&, const WIZDOCUMENTATTACHMENTDATA&)));
    connect(db, SIGNAL(attachmentDeleted(const WIZDOCUMENTATTACHMENTDATA&)),
            SIGNAL(attachmentDeleted(const WIZDOCUMENTATTACHMENTDATA&)));

    connect(db, SIGNAL(folderCreated(const QString&)),
            SIGNAL(folderCreated(const QString&)));
    connect(db, SIGNAL(folderDeleted(const QString&)),
            SIGNAL(folderDeleted(const QString&)));
    connect(db, SIGNAL(tagsPositionChanged(const QString&)),
            SIGNAL(tagsPositionChanged(const QString&)));
    connect(db, SIGNAL(folderPositionChanged()),
            SIGNAL(folderPositionChanged()));

    connect(db, SIGNAL(messageCreated(WIZMESSAGEDATA)),
            SIGNAL(messageCreated(WIZMESSAGEDATA)));
    connect(db, SIGNAL(messageModified(WIZMESSAGEDATA,WIZMESSAGEDATA)),
            SIGNAL(messageModified(WIZMESSAGEDATA,WIZMESSAGEDATA)));
    connect(db, SIGNAL(messageDeleted(WIZMESSAGEDATA)),
            SIGNAL(messageDeleted(WIZMESSAGEDATA)));

    connect(db, SIGNAL(favoritesChanged(QString)),
            SIGNAL(favoritesChanged(QString)));
}