Ignore:
Timestamp:
01/18/10 16:13:01 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
f6300c7
Parents:
d23aa6a
Message:

added 'alarm' columnt to the 'EVENT' table to signalize
that the event has/hasn't alarm set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/treeview.cpp

    rd23aa6a rb6cd05c  
    5858            {
    5959                // handle Alarm Control clicked
    60                 qDebug() << "ALARM CLICKED: " << qVariantValue<QString>(aIndex.data());
     60                Event event = Event::getById(aIndex.data().toInt(),1);
     61                if(event.hasAlarm())
     62                {
     63                    static_cast<Event*>(aIndex.internalPointer())->setHasAlarm(false); // list of events
     64                    event.setHasAlarm(false); // update DB
     65                }
     66                else
     67                {
     68                    static_cast<Event*>(aIndex.internalPointer())->setHasAlarm(true); // list of events
     69                    event.setHasAlarm(true);
     70                }
     71                qDebug() << " ALARM [" << qVariantValue<QString>(aIndex.data()) << "] -> " << event.hasAlarm();
     72                event.update("alarm");
     73                // since the Alarm icon has changed, update TreeView accordingly
     74                static_cast<EventModel*>(model())->emitDataChangedSignal(aIndex,aIndex);
     75
    6176            }
    6277            break;
Note: See TracChangeset for help on using the changeset viewer.