Changeset 3f3e22d
- Timestamp:
- 01/21/10 16:39:43 (13 years ago)
- Branches:
- master, qt5
- Children:
- 76cde75
- Parents:
- a957cfa
- Location:
- src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
ra957cfa r3f3e22d 13 13 14 14 #include <QDialog> 15 #include <QMessageBox> 15 16 #include "ui_about.h" 16 17 #include "eventdialog.h" … … 18 19 #include "importscheduledialog.h" 19 20 #include "mapwindow.h" 21 20 22 21 23 const int confId = 1; … … 86 88 connect(trackTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); 87 89 connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &))); 90 // request for warning to be displayed 91 connect(dayTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 92 connect(favTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 93 connect(trackTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 94 connect(searchTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &))); 88 95 // event search button clicked 89 96 connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked())); … … 274 281 } 275 282 283 void MainWindow::displayWarning(const QModelIndex &aIndex) 284 { 285 QMessageBox::warning( 286 this, 287 tr("Time Conflict Warning"), 288 tr("This event happens at the same time than another one of your favourites.") ); 289 } -
src/gui/mainwindow.h
ra957cfa r3f3e22d 26 26 void itemClicked(const QModelIndex &aIndex); 27 27 void displayMap(const QModelIndex &aIndex); 28 void displayWarning(const QModelIndex &aIndex); 28 29 void searchClicked(); 29 30 private: -
src/mvc/delegate.cpp
ra957cfa r3f3e22d 136 136 //if(static_cast<Event*>(index.internalPointer())->hasTimeConflict()) 137 137 if(bkgrColor == Qt::yellow) 138 { 138 139 painter->drawImage(mControls[WarningControlOn]->drawPoint(option.rect),*mControls[WarningControlOn]->image()); 140 mControls[WarningControlOn]->hasConflict=true; 141 } 139 142 else 143 { 140 144 painter->drawImage(mControls[WarningControlOff]->drawPoint(option.rect),*mControls[WarningControlOff]->image()); 145 mControls[WarningControlOn]->hasConflict=false; 146 } 141 147 142 148 // draw texts … … 310 316 { 311 317 ControlId id = i.next(); 312 if(mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint)) 318 if((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint)) 319 && (id != WarningControlOn) && (id != WarningControlOff)) 320 { 313 321 return id; 322 } 323 else 324 { 325 if ((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint)) 326 && (mControls[id]->hasConflict)) 327 { 328 return id; 329 } 330 } 314 331 } 315 332 … … 369 386 control = new Control(WarningControlOn,QString(":icons/exclamation-iconOn.png")); 370 387 p = mControls[MapControl]->drawPoint(); 388 control->hasConflict = false; 371 389 p.setX(p.x()-control->image()->width()-SPACER); 372 390 control->setDrawPoint(p); … … 375 393 control = new Control(WarningControlOff,QString(":icons/exclamation-iconOff.png")); 376 394 p = mControls[MapControl]->drawPoint(); 395 control->hasConflict = false; 377 396 p.setX(p.x()-control->image()->width()-SPACER); 378 397 control->setDrawPoint(p); -
src/mvc/delegate.h
ra957cfa r3f3e22d 45 45 return QRect(drawPoint(aRect), drawPoint(aRect)+QPoint(mImage->size().width(),mImage->size().height())); 46 46 } 47 bool hasConflict; 47 48 private: 48 49 ControlId mId; -
src/mvc/treeview.cpp
ra957cfa r3f3e22d 107 107 } 108 108 break; 109 case Delegate::WarningControlOff: 109 110 case Delegate::WarningControlOn: 110 case Delegate::WarningControlOff:111 111 { 112 113 qDebug() << "WARNING CLICKED: " << qVariantValue<QString>(aIndex.data()); 112 114 // TODO: implement 115 emit(requestForWarning(aIndex)); 113 116 handled = true; 114 117 } -
src/mvc/treeview.h
ra957cfa r3f3e22d 17 17 signals: 18 18 void requestForMap(const QModelIndex &aIndex); 19 void requestForWarning(const QModelIndex &aIndex); 19 20 }; 20 21
Note: See TracChangeset
for help on using the changeset viewer.