- Timestamp:
- 10/17/11 21:04:20 (11 years ago)
- Branches:
- master, qt5
- Children:
- 1ca13ef
- Parents:
- dc66a91
- Location:
- src/gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/conflictdialogcontainer.cpp
rdc66a91 rc81f30a 22 22 23 23 ConflictDialogContainer::ConflictDialogContainer(QWidget *aParent) 24 : TabContainer( aParent ) 25 { 24 : TabContainer( aParent ), mEventId(-1), mConferenceId(-1) 25 {} 26 27 28 void ConflictDialogContainer::setEventId(int aEventId, int conferenceId) { 29 mEventId = aEventId; 30 mConferenceId = conferenceId; 31 loadEvents(); 26 32 } 27 33 28 void ConflictDialogContainer::loadEvents( const QDate &aDate, const int aConferenceId )29 {30 Q_UNUSED(aDate);31 34 32 static_cast<EventModel*>(treeView->model())->loadConflictEvents( mEventId, aConferenceId ); 33 } 34 35 void ConflictDialogContainer::updateTreeView(const QDate &aDate) 36 { 37 TabContainer::updateTreeView(aDate); 35 void ConflictDialogContainer::loadEvents() { 36 static_cast<EventModel*>(treeView->model())->loadConflictEvents(mEventId, mConferenceId); 38 37 treeView->setAllExpanded(true); 39 38 } 40 39 40 41 void ConflictDialogContainer::loadEvents(const QDate &aDate, const int aConferenceId) { 42 Q_UNUSED(aDate); 43 Q_ASSERT(aConferenceId == mConferenceId); 44 Q_ASSERT(mConferenceId > 0); 45 Q_ASSERT(mEventId > 0); 46 loadEvents(); 47 } 48 49 -
src/gui/conflictdialogcontainer.h
rdc66a91 rc81f30a 29 29 public: 30 30 ConflictDialogContainer(QWidget *aParent); 31 virtual ~ConflictDialogContainer() {}31 virtual ~ConflictDialogContainer() {} 32 32 33 void setEventId(int aEventId) { mEventId = aEventId; } 33 public slots: 34 void setEventId(int aEventId, int conferenceId); 35 void loadEvents(); // update the conflicts 34 36 35 37 protected: 36 virtual void loadEvents( const QDate &aDate, const int aConferenceId ); 37 38 protected slots: 39 virtual void updateTreeView(const QDate &aDate); 38 virtual void loadEvents(const QDate &aDate, const int aConferenceId); // the date and conference are ignored 40 39 41 40 private: 42 41 int mEventId; 42 int mConferenceId; 43 43 }; 44 44 -
src/gui/conflictsdialog.cpp
rdc66a91 rc81f30a 20 20 #include "conflictsdialog.h" 21 21 22 ConflictsDialog::ConflictsDialog(int aEventId, QWidget *aParent)22 ConflictsDialog::ConflictsDialog(int aEventId, int aConferenceId, QWidget *aParent) 23 23 : QDialog(aParent) 24 24 { 25 25 setupUi(this); 26 connect(container, SIGNAL(event HasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));27 connect(container, SIGNAL(event HasChanged(int,bool)), container, SLOT(updateTreeViewModel(int,bool)));26 connect(container, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 27 connect(container, SIGNAL(eventChanged(int,bool)), container, SLOT(loadEvents())); 28 28 29 container->setEventId(aEventId );29 container->setEventId(aEventId, aConferenceId); 30 30 } 31 31 32 32 33 ConflictsDialog::~ConflictsDialog() 33 34 { 34 disconnect(container, SIGNAL(event HasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));35 disconnect(container, SIGNAL(eventChanged(int,bool)), this, SIGNAL(eventChanged(int,bool))); 35 36 } 36 37 -
src/gui/conflictsdialog.h
rdc66a91 rc81f30a 28 28 Q_OBJECT 29 29 public: 30 ConflictsDialog(int aEventId, QWidget *aParent = NULL);30 ConflictsDialog(int aEventId, int aConferenceId, QWidget *aParent = NULL); 31 31 ~ConflictsDialog(); 32 32 signals: 33 void event HasChanged(int aEventId, bool aReloadModel = false);33 void eventChanged(int aEventId, bool favouriteChanged); 34 34 }; 35 35 -
src/gui/eventdialog.cpp
rdc66a91 rc81f30a 87 87 } 88 88 89 // have to emit 'event HasChanged' signal on all events in conflict89 // have to emit 'eventChanged' signal on all events in conflict 90 90 for(int i=0; i<conflicts.count(); i++) 91 emit (eventHasChanged(conflicts[i].id()));91 emit eventChanged(conflicts[i].id(), false); 92 92 93 93 // since the Favourite icon has changed, update TreeViews accordingly 94 94 // all TreeViews have to listen on this signal 95 emit (eventHasChanged(event.id(),true));95 emit eventChanged(event.id(), true); 96 96 } 97 97 … … 124 124 // since the Alarm icon has changed, update TreeView accordingly 125 125 // all TreeViews have to listen on this signal 126 emit (eventHasChanged(event.id()));126 emit eventChanged(event.id(), false); 127 127 } 128 128 -
src/gui/eventdialog.h
rdc66a91 rc81f30a 35 35 void alarmClicked(); 36 36 signals: 37 void event HasChanged(int aEventId, bool aReloadModel = false); // emited when user changes some event details, eg. sets it Favourite37 void eventChanged(int aEventId, bool favouriteChanged); // emited when user changes some event details, eg. sets it Favourite 38 38 private: 39 39 int mEventId; -
src/gui/tabcontainer.cpp
rdc66a91 rc81f30a 77 77 void TabContainer::displayConflicts(const QModelIndex &aIndex) 78 78 { 79 ConflictsDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this); 79 Event* event = static_cast<Event*>(aIndex.internalPointer()); 80 ConflictsDialog dialog(event->id(), event->conferenceId(), this); 80 81 #ifdef N810 81 82 dialog.setFixedWidth(static_cast<QWidget*>(parent())->width());
Note: See TracChangeset
for help on using the changeset viewer.