- Timestamp:
- 04/02/13 23:28:06 (10 years ago)
- Branches:
- master, qt5
- Children:
- b261e79
- Parents:
- cdf0332
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
rcdf0332 r54a377c 32 32 #ifdef MAEMO 33 33 showFullScreen(); 34 #else35 alarmButton->hide();36 34 #endif 37 35 -
src/gui/mainwindow.cpp
rcdf0332 r54a377c 64 64 mXmlParser = new ScheduleXmlParser(sqlEngine, this); 65 65 mNetworkAccessManager = new QNetworkAccessManager(this); 66 66 systemTrayIcon = new QSystemTrayIcon(qApp->windowIcon(), this); 67 alarmTimer = new QTimer(this); 68 69 alarmTimer->setInterval(60000); 70 alarmTimer->start(); 67 71 saved_title = windowTitle(); 68 72 … … 101 105 connect(searchTabContainer, SIGNAL(searchResultChanged()), SLOT(onSearchResultChanged())); 102 106 107 // systm tray icon 108 connect(systemTrayIcon, SIGNAL(messageClicked()), SLOT(onSystemTrayMessageClicked())); 109 110 // timer 111 connect(alarmTimer, SIGNAL(timeout()), SLOT(onAlarmTimerTimeout())); 103 112 104 113 useConference(Conference::activeConference()); … … 115 124 connect(mXmlParser, SIGNAL(parsingScheduleEnd(int)), conferenceModel, SLOT(newConferenceEnd(int))); 116 125 } 126 117 127 118 128 void MainWindow::on_aboutAction_triggered() … … 204 214 // No results were found 205 215 searchTabContainer->redisplayDate(dayNavigator->curDate()); 216 } 217 218 219 void MainWindow::onSystemTrayMessageClicked() { 220 // TODO: Hide icon 221 } 222 223 224 void MainWindow::onAlarmTimerTimeout() { 225 // TODO: Show Message if an alarm is set on an event that's starting soon and delete the corresponding alarm. 226 /* Example: 227 systemTrayIcon->show(); 228 systemTrayIcon->showMessage("title", "message", QSystemTrayIcon::Information, 1000); 229 QApplication::alert(this); 230 QApplication::beep(); 231 */ 206 232 } 207 233 -
src/gui/mainwindow.h
rcdf0332 r54a377c 50 50 void onEventChanged(int aEventId, bool favouriteChanged); 51 51 void onSearchResultChanged(); 52 52 53 // TODO: remove 53 54 void networkQueryFinished(QNetworkReply*); … … 56 57 void removeConference(int); 57 58 void changeConferenceUrl(int, const QString&); 59 void onSystemTrayMessageClicked(); 60 void onAlarmTimerTimeout(); 58 61 59 62 void useConference(int conferenceId); … … 72 75 ScheduleXmlParser *mXmlParser; 73 76 QNetworkAccessManager *mNetworkAccessManager; 77 QSystemTrayIcon* systemTrayIcon; ///< to be able to show notifications 78 QTimer* alarmTimer; ///< timer that triggers every minute to be able to show alarms 74 79 }; 75 80 -
src/mvc/delegate.cpp
rcdf0332 r54a377c 110 110 else 111 111 mControls[FavouriteControlOff]->paint(painter, option.rect); 112 #ifdef MAEMO 112 113 113 if(event->hasAlarm()) 114 114 mControls[AlarmControlOn]->paint(painter, option.rect); 115 115 else 116 116 mControls[AlarmControlOff]->paint(painter, option.rect); 117 #endif 117 118 118 if(event->hasTimeConflict()) 119 119 mControls[WarningControl]->paint(painter, option.rect); … … 164 164 { 165 165 int numFav = numberOfFavourities(index); 166 #ifdef MAEMO167 166 int numAlarm = numberOfAlarms(index); 168 #endif169 167 170 168 QStyleOptionButton styleOptionButton; … … 200 198 painter->drawText(drawPoint+QPoint(image->width()+2, image->height() - 2), 201 199 QString::number(numFav)); 202 #ifdef MAEMO 200 203 201 drawPoint.setX(drawPoint.x() - spacer - image->width()); 204 202 image = mControls[numAlarm ? AlarmControlOn : AlarmControlOff]->image(); … … 206 204 painter->drawText(drawPoint+QPoint(image->width()+2, image->height() - 2), 207 205 QString::number(numAlarm)); 208 #endif 206 209 207 // draw texts 210 208 QString numEvents = QString::number(index.model()->rowCount(index)).append("/"); … … 314 312 mControls.insert(FavouriteControlOff, new Control(FavouriteControlOff, QString(":icons/favourite-off.png"), NULL)); 315 313 316 #ifdef MAEMO317 314 // ALARM ICONs 318 315 // on … … 325 322 mControls.insert(WarningControl, 326 323 new Control(WarningControl, QString(":icons/dialog-warning.png"), mControls[AlarmControlOff])); 327 #else 328 // WARNING ICON 329 mControls.insert(WarningControl, 330 new Control(WarningControl, QString(":icons/dialog-warning.png"), mControls[FavouriteControlOn])); 331 #endif 332 333 } 324 } 334 325 335 326 bool Delegate::isPointFromRect(const QPoint &aPoint, const QRect &aRect) const
Note: See TracChangeset
for help on using the changeset viewer.