Changeset d49254d in confclerk_git
- Timestamp:
- 01/27/10 22:08:37 (13 years ago)
- Branches:
- master, qt5
- Children:
- 0401cc2
- Parents:
- 21d7cc0
- Location:
- src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/conflictdialogcontainer.cpp
r21d7cc0 rd49254d 9 9 void ConflictDialogContainer::loadEvents( const QDate &aDate, const int aConferenceId ) 10 10 { 11 static_cast<EventModel*>(treeView->model())->load EventsByRoom( aDate, aConferenceId );12 //treeView->setAllExpanded(true);11 static_cast<EventModel*>(treeView->model())->loadConflictEvents( mEventId, aConferenceId ); 12 dayNavigator->hide(); 13 13 } 14 14 15 void ConflictDialogContainer::updateTreeViewModel(int aEventId)16 {17 // requires special handling18 // we need to reload favourites, because some favourite could be deleted19 //static_cast<EventModel*>(favTreeView->model())->updateModel(aEventId);20 int confId = Conference::activeConference();21 QDate startDate = Conference::getById(confId).start();22 QDate endDate = Conference::getById(confId).end();23 dayNavigator->setDates(startDate, endDate);24 updateTreeView( Conference::getById(confId).start() );25 }26 -
src/gui/conflictdialogcontainer.h
r21d7cc0 rd49254d 12 12 virtual ~ConflictDialogContainer(){} 13 13 14 public slots: 15 virtual void updateTreeViewModel(int aEventId); 14 void setEventId(int aEventId) { mEventId = aEventId; } 16 15 17 16 protected: 18 17 virtual void loadEvents( const QDate &aDate, const int aConferenceId ); 18 19 private: 20 int mEventId; 19 21 }; 20 22 -
src/gui/conflictsdialog.cpp
r21d7cc0 rd49254d 1 1 #include "conflictsdialog.h" 2 2 3 ConflictsDialog::ConflictsDialog( QWidget *aParent)3 ConflictsDialog::ConflictsDialog(int aEventId, QWidget *aParent) 4 4 : QDialog(aParent) 5 5 { … … 7 7 connect(container, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int))); 8 8 connect(container, SIGNAL(eventHasChanged(int)), container, SLOT(updateTreeViewModel(int))); 9 10 container->setEventId(aEventId); 9 11 10 12 int confId = Conference::activeConference(); -
src/gui/conflictsdialog.h
r21d7cc0 rd49254d 9 9 Q_OBJECT 10 10 public: 11 ConflictsDialog( QWidget *aParent = NULL);11 ConflictsDialog(int aEventId, QWidget *aParent = NULL); 12 12 ~ConflictsDialog(); 13 13 signals: -
src/gui/favtabcontainer.cpp
r21d7cc0 rd49254d 13 13 void FavTabContainer::updateTreeViewModel(int aEventId) 14 14 { 15 Q_UNUSED(aEventId); 16 15 17 // requires special handling 16 18 // we need to reload favourites, because some favourite could be deleted -
src/gui/tabcontainer.cpp
r21d7cc0 rd49254d 34 34 if(!Conference::getAll().count()) // no conference(s) in the DB 35 35 { 36 dayNavigator->hide(); // hide DayNavigatorWidget36 dayNavigator->hide(); 37 37 } 38 38 else … … 86 86 void TabContainer::displayConflicts(const QModelIndex &aIndex) 87 87 { 88 Q_UNUSED(aIndex); 89 90 ConflictsDialog dialog; 88 ConflictsDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this); 91 89 connect(&dialog, SIGNAL(eventHasChanged(int)), this, SIGNAL(eventHasChanged(int))); 92 90 dialog.exec(); -
src/mvc/event.cpp
r21d7cc0 rd49254d 69 69 } 70 70 71 QList<Event> Event::conflictEvents(int aEventId, int conferenceId) 72 { 73 QSqlQuery query; 74 query.prepare( selectQuery() + QString("WHERE id IN ( SELECT conflict_event FROM event_conflict WHERE xid_event = :id AND xid_conference = :conf ) ORDER BY %1").arg("start")); 75 query.bindValue(":id", aEventId); 76 query.bindValue(":conf", conferenceId); 77 78 return load(query); 79 } 80 71 81 QList<Event> Event::getFavByDate(const QDate& date, int conferenceId) 72 82 { -
src/mvc/event.h
r21d7cc0 rd49254d 28 28 static QList<Event> getByTrack(int id); 29 29 static QList<Event> getByDateAndRoom(const QDate& date, int conferenceId); 30 static QList<Event> conflictEvents(int aEventId, int conferenceId); 30 31 public: 31 32 int id() const { return value("id").toInt(); } -
src/mvc/eventmodel.cpp
r21d7cc0 rd49254d 275 275 } 276 276 277 void EventModel::loadConflictEvents(int aEventId, int aConferenceId) 278 { 279 clearModel(); 280 // check for existence of the conference in the DB 281 if(Conference::getAll().count()) 282 { 283 qDebug() << "Loading Conference Data: [" << Conference::getById(aConferenceId).title() << "] in conflict with " << aEventId; 284 mEvents = Event::conflictEvents(aEventId, aConferenceId); 285 } 286 createTimeGroups(); 287 } 288 277 289 void EventModel::updateModel(int aEventId) 278 290 { -
src/mvc/eventmodel.h
r21d7cc0 rd49254d 23 23 void loadNowEvents(int aConferenceId); // loads Now events from the DB 24 24 void loadEventsByRoom(const QDate &aDate, int aConferenceId); 25 void loadConflictEvents(int aEventId, int aConferenceId); // loads events in conflict 25 26 26 27 private:
Note: See TracChangeset
for help on using the changeset viewer.