Changeset b8a3ad1 for src/gui/mainwindow.cpp
- Timestamp:
- 01/22/10 07:18:25 (13 years ago)
- Branches:
- master, qt5
- Children:
- 8b71fb3
- Parents:
- d336730
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
rd336730 rb8a3ad1 26 26 setupUi(this); 27 27 28 // TODO: conference ID should be assigned based on actual data in the DB29 // for testing only30 AppSettings::setConfId(1);31 32 28 // connect Menu actions 33 29 connect(actionImportSchedule, SIGNAL(triggered()), SLOT(importSchedule())); … … 80 76 searchTreeView->setItemDelegate(new Delegate(searchTreeView)); 81 77 78 // NOW View 79 nowTreeView->setHeaderHidden(true); 80 nowTreeView->setRootIsDecorated(false); 81 nowTreeView->setIndentation(0); 82 nowTreeView->setAnimated(true); 83 nowTreeView->setModel(new EventModel()); 84 nowTreeView->setItemDelegate(new Delegate(nowTreeView)); 85 82 86 // event details have changed 83 87 connect(dayTreeView, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); … … 85 89 connect(trackTreeView, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 86 90 connect(searchTreeView, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 91 connect(nowTreeView, SIGNAL(eventHasChanged(int)), SLOT(eventHasChanged(int))); 87 92 88 93 // event clicked … … 91 96 connect(trackTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 92 97 connect(searchTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 98 connect(nowTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 93 99 // request for map to be displayed 94 100 connect(dayTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); … … 96 102 connect(trackTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); 97 103 connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); 104 connect(nowTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); 98 105 // request for warning to be displayed 99 106 connect(dayTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); … … 101 108 connect(trackTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 102 109 connect(searchTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 110 connect(nowTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 103 111 // event search button clicked 104 112 connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked())); … … 215 223 } 216 224 225 void MainWindow::updateNowView() 226 { 227 EventModel *model = static_cast<EventModel*>(nowTreeView->model()); 228 model->loadNowEvents(AppSettings::confId()); 229 nowTreeView->reset(); 230 nowTreeView->setAllExpanded(true); 231 } 232 217 233 void MainWindow::itemClicked(const QModelIndex &aIndex) 218 234 { … … 275 291 static_cast<EventModel*>(trackTreeView->model())->updateModel(aEventId); 276 292 static_cast<EventModel*>(searchTreeView->model())->updateModel(aEventId); 293 static_cast<EventModel*>(nowTreeView->model())->updateModel(aEventId); 277 294 } 278 295 … … 281 298 Q_UNUSED(aIndex); 282 299 300 // TODO: only if it changed to favourities tab 283 301 updateFavouritesView(favouriteDayNavigator->getCurrentDate()); 284 } 285 302 // TODO: only if it changed to now tab 303 updateNowView(); 304 } 305
Note: See TracChangeset
for help on using the changeset viewer.