- Timestamp:
- 04/16/13 22:52:25 (10 years ago)
- Branches:
- master, qt5
- Children:
- e619be9
- Parents:
- 097e1f4
- Location:
- src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
r097e1f4 r3a09de6 113 113 // add alarm to the 'alarmd' 114 114 Alarm alarm; 115 alarm.addAlarm(event.conferenceId(), event.id(), event.title(), event.start().addSecs( PRE_EVENT_ALARM_SEC));115 alarm.addAlarm(event.conferenceId(), event.id(), event.title(), event.start().addSecs(-AppSettings::preEventAlarmSec())); 116 116 #endif /* MAEMO */ 117 117 } -
src/gui/mainwindow.cpp
r097e1f4 r3a09de6 31 31 #include "eventmodel.h" 32 32 #include "delegate.h" 33 #include "room.h" 33 34 34 35 #include "conference.h" … … 107 108 // systm tray icon 108 109 connect(systemTrayIcon, SIGNAL(messageClicked()), SLOT(onSystemTrayMessageClicked())); 110 connect(systemTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(onSystemTrayMessageClicked())); 109 111 110 112 // timer … … 218 220 219 221 void MainWindow::onSystemTrayMessageClicked() { 220 // TODO: Hide icon 221 // systemTrayIcon->hide(); 222 systemTrayIcon->hide(); 222 223 } 223 224 224 225 225 226 void MainWindow::onAlarmTimerTimeout() { 226 // TODO: Show Message if an alarm is set on an event that's starting soon and delete the corresponding alarm. 227 /* 227 // determine if an alarm is set on an event that's starting soon 228 QList<Event> events = Event::getImminentAlarmEvents(AppSettings::preEventAlarmSec(), Conference::activeConference()); 229 if (events.empty()) return; 230 231 // build a message string 232 Event event; 233 QString title; 234 QString message; 235 if (events.size() == 1) { 236 event = events.first(); 237 title = tr("Next event at %1").arg(event.start().toString()); 238 message = tr("Title: %1\nRoom: %2").arg(event.title()).arg(event.room()->name()); 239 } else { 240 title = tr("%1 upcoming events").arg(events.size()); 241 QStringList messages; 242 foreach (event, events) { 243 messages += tr("Start: %1; Title: %2; Room: %3").arg(event.start().toString()).arg(event.title()).arg(event.room()->name()); 244 } 245 message = messages.join("\n"); 246 } 247 248 // and delete the corresponding alarm 249 foreach (event, events) { 250 event.setHasAlarm(false); 251 event.update("alarm"); 252 onEventChanged(event.id(), false); 253 } 254 255 // show message 228 256 systemTrayIcon->show(); 229 qDebug() << systemTrayIcon->geometry(); // gets moved to the correct location only at second usage. at least under X11/awesome, not on Win32/XP 230 systemTrayIcon->showMessage("title", "message", QSystemTrayIcon::Information, 1000); 257 // The next two lines are to prevent a very strange position of the message box the first time at X11/aweseome (not Win32/XP) 258 systemTrayIcon->showMessage("ConfClerk", "Your upcoming events", QSystemTrayIcon::Information); 259 qApp->processEvents(); 260 systemTrayIcon->showMessage(title, message, QSystemTrayIcon::Information, 60*60*24*1000); 231 261 QApplication::alert(this); 232 262 QApplication::beep(); 233 */234 263 } 235 264
Note: See TracChangeset
for help on using the changeset viewer.