Ejemplo n.º 1
0
bool CWizIndexBase::createMessageEx(const WIZMESSAGEDATA& data)
{
    qDebug() << "create message, id: " << data.nId;

    CString strFormat = FormatInsertSQLFormat(TABLE_NAME_WIZ_MESSAGE,
                                              FIELD_LIST_WIZ_MESSAGE,
                                              PARAM_LIST_WIZ_MESSAGE);

    CString strSQL;
    strSQL.Format(strFormat,
                  WizInt64ToStr(data.nId).utf16(),
                  STR2SQL(data.bizGUID).utf16(),
                  STR2SQL(data.kbGUID).utf16(),
                  STR2SQL(data.documentGUID).utf16(),
                  STR2SQL(data.senderAlias).utf16(),
                  STR2SQL(data.senderId).utf16(),
                  STR2SQL(data.senderGUID).utf16(),
                  STR2SQL(data.receiverAlias).utf16(),
                  STR2SQL(data.receiverId).utf16(),
                  STR2SQL(data.receiverGUID).utf16(),
                  data.nMessageType,
                  data.nReadStatus,
                  TIME2SQL(data.tCreated).utf16(),
                  STR2SQL(data.title).utf16(),
                  STR2SQL(data.messageBody).utf16(),
                  WizInt64ToStr(data.nVersion).utf16()
        );


    if (!ExecSQL(strSQL))
        return false;

    if (!m_bUpdating) {
        emit messageCreated(data);
    }

    return true;
}
Ejemplo n.º 2
0
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)));
}
Ejemplo n.º 3
0
void QDiscordStateComponent::messageCreateReceived(const QJsonObject& object)
{
	QDiscordMessage message(object, channel(object["channel_id"].toString("")));
	emit messageCreated(message);
}
Ejemplo n.º 4
0
void MainWindow::onActionSendMessageTriggered() {
    //MessageCreationDialog* dialog = new MessageCreationDialog();
    SendMessageDialog* dialog = new SendMessageDialog();
    connect(dialog, SIGNAL(messageCreated(xPLMessage)), this, SLOT(sendMessage(xPLMessage)));
    dialog->show();
}