X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/280f29b1e52958d36d17fe2a8f2e4686e68a01a8..5b7fa79bd7a4f4b468a82947cc1659e866084c73:/src/gui/mainwindow.cpp diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 9181343..550e3fd 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -37,6 +37,7 @@ #include #include +#include #include "ui_about.h" #include "eventdialog.h" @@ -238,22 +239,24 @@ void MainWindow::onSystemTrayMessageClicked() { void MainWindow::onAlarmTimerTimeout() { // determine if an alarm is set on an event that's starting soon - QList events = Event::getImminentAlarmEvents(AppSettings::preEventAlarmSec(), Conference::activeConference()); + int conferenceId = Conference::activeConference(); + QList events = Event::getImminentAlarmEvents(AppSettings::preEventAlarmSec(), conferenceId); if (events.empty()) return; // build a message string + const Conference conference = Conference::getById(conferenceId); Event event; QString title; QString message; if (events.size() == 1) { event = events.first(); - title = tr("Next event at %1").arg(event.start().toString("HH:mm")); + title = tr("Next event at %1").arg(conference.shiftTime(event.start().time()).toString("HH:mm")); message = tr("\"%1\"\n(%2)").arg(event.title()).arg(event.room()->name()); } else { title = tr("%1 upcoming events").arg(events.size()); QStringList messages; foreach (event, events) { - messages += tr("%1: \"%2\" (%3)").arg(event.start().toString("HH:mm")).arg(event.title()).arg(event.room()->name()); + messages += tr("%1: \"%2\" (%3)").arg(conference.shiftTime(event.start().time()).toString("HH:mm")).arg(event.title()).arg(event.room()->name()); } message = messages.join("\n"); } @@ -322,6 +325,7 @@ void MainWindow::initTabs() if (confId != -1) // only init tabs if a conference is active { Conference active = Conference::getById(confId); + ((Application*) qApp)->setActiveConference(active); QDate startDate = active.start(); QDate endDate = active.end(); @@ -345,6 +349,7 @@ void MainWindow::unsetConference() clearTabs(); dayNavigator->unsetDates(); setWindowTitle(saved_title); + ((Application*) qApp)->unsetActiveConference(); }