예제 #1
0
void MainWindow::makeConnections() {
    connect(&storage, SIGNAL(eventAdded(CalendarEvent)),
            calendar, SLOT(addEvent(CalendarEvent)));
    connect(&storage, SIGNAL(eventRemoved(CalendarEvent)),
            calendar, SLOT(removeEvent(CalendarEvent)));

    connect(calendar, SIGNAL(eventRemoved(CalendarEvent)),
            &storage, SLOT(removeEvent(CalendarEvent)));
    connect(calendar, SIGNAL(eventUpdated(CalendarEvent,CalendarEvent)),
            &storage, SLOT(updateEvent(CalendarEvent,CalendarEvent)));
}
예제 #2
0
파일: Controller.cpp 프로젝트: hefee/Charm
Event Controller::makeEvent( const Task& task )
{
    Event event = m_storage->makeEvent();
    Q_ASSERT( event.isValid() );

    event.setTaskId( task.id() );
    if ( m_storage->modifyEvent( event ) ) {
        emit eventAdded( event );
    } else {
        event = Event();
    }
    return event;
}
예제 #3
0
파일: Controller.cpp 프로젝트: hefee/Charm
Event Controller::cloneEvent(const Event &e)
{
    Event event = m_storage->makeEvent();
    Q_ASSERT( event.isValid() );

    int id = event.id();
    event = e;
    event.setId(id);
    if ( m_storage->modifyEvent( event ) ) {
        emit eventAdded( event );
    } else {
        event = Event();
    }
    return event;
}
예제 #4
0
void connectControllerAndModel( Controller* controller, CharmDataModel* model )
{
    QObject::connect( controller, SIGNAL(eventAdded(Event)),
                      model, SLOT(addEvent(Event)) );
    QObject::connect( controller, SIGNAL(eventModified(Event)),
                      model, SLOT(modifyEvent(Event)) );
    QObject::connect( controller, SIGNAL(eventDeleted(Event)),
                      model, SLOT(deleteEvent(Event)) );
    QObject::connect( controller, SIGNAL(allEvents(EventList)),
                      model, SLOT(setAllEvents(EventList)) );
    QObject::connect( controller, SIGNAL(definedTasks(TaskList)),
                      model, SLOT(setAllTasks(TaskList)) );
    QObject::connect( controller, SIGNAL(taskAdded(Task)),
                      model, SLOT(addTask(Task)) );
    QObject::connect( controller, SIGNAL(taskUpdated(Task)),
                      model, SLOT(modifyTask(Task)) );
    QObject::connect( controller, SIGNAL(taskDeleted(Task)),
                      model, SLOT(deleteTask(Task)) );
}
예제 #5
0
void
UpcomingEventsListWidget::addEvent( const LastFmEventPtr &event )
{
    m_events << event;
    UpcomingEventsWidget *widget = new UpcomingEventsWidget( event );
    const uint eventTime = event->date().toTime_t();
    QMap<uint, UpcomingEventsWidget*>::const_iterator iBound( m_sortMap.insertMulti( eventTime, widget ) );
    QMap<uint, UpcomingEventsWidget*>::const_iterator i( m_sortMap.constBegin() );
    int index = 0;
    while( i++ != iBound )
        ++index; // find the right index to insert the widget
    index *= 2;  // take separators into account
    m_layout->insertItem( index, widget );
    m_layout->insertItem( index + 1, new Plasma::Separator );
    if( widget->m_mapButton )
    {
        connect( widget->m_mapButton, SIGNAL(clicked()), m_sigmap, SLOT(map()) );
        m_sigmap->setMapping( widget->m_mapButton, widget );
    }
    emit eventAdded( event );
}
예제 #6
0
void TaskModelAdapter::eventDeleted( EventId id )
{
    eventAdded( id );
}
예제 #7
0
void TimeNodePresenter::on_eventAdded(const Id<EventModel>& eventId)
{
    emit eventAdded(eventId, m_model.id());
}