示例#1
0
static void
gnc_cm_event_handler (QofInstance *entity,
                      QofEventId event_type,
                      gpointer user_data,
                      gpointer event_data)
{
    const GncGUID *guid = qof_entity_get_guid(entity);
#if CM_DEBUG
    gchar guidstr[GUID_ENCODING_LENGTH+1];
    guid_to_string_buff (guid, guidstr);
    fprintf (stderr, "event_handler: event %d, entity %p, guid %s\n", event_type,
             entity, guidstr);
#endif
    add_event (&changes, guid, event_type, TRUE);

    if (QOF_CHECK_TYPE(entity, GNC_ID_SPLIT))
    {
        /* split events are never generated by the engine, but might
         * be generated by a backend (viz. the postgres backend.)
         * Handle them like a transaction modify event. */
        add_event_type (&changes, GNC_ID_TRANS, QOF_EVENT_MODIFY, TRUE);
    }
    else
        add_event_type (&changes, entity->e_type, event_type, TRUE);

    got_events = TRUE;

    if (suspend_counter == 0)
        gnc_gui_refresh_internal (FALSE);
}
示例#2
0
/*!

\brief Adds a set of EventTypes to the set.
\param[in] Set EventTypeSet of EventTypes to be added to the set.

*/
void
dmz::EventTypeSet::add_event_set (const EventTypeSet &Set) {

   HashTableHandleIterator it;

   EventType *ptr (Set._state.table.get_first (it));

   while (ptr) {

      add_event_type (*ptr);

      ptr = Set._state.table.get_next (it);
   }
}
示例#3
0
void
gnc_gui_component_watch_entity_type (gint component_id,
                                     QofIdTypeConst entity_type,
                                     QofEventId event_mask)
{
    ComponentInfo *ci;

    ci = find_component (component_id);
    if (!ci)
    {
        PERR ("component not found");
        return;
    }

    add_event_type (&ci->watch_info, entity_type, event_mask, FALSE);
}