]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/alarmdialog.cpp
fine tune geometry to look nicer
[toast/confclerk.git] / src / gui / alarmdialog.cpp
index 01595f54b332d1dc2440a77bac299bee7f729138..4891b11ee451dc490cdbc9f88694b4586bb0e00e 100644 (file)
@@ -1,4 +1,23 @@
+/*
+ * Copyright (C) 2010 Ixonos Plc.
+ *
+ * This file is part of fosdem-schedule.
+ *
+ * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * fosdem-schedule is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
+ */
 #include "alarmdialog.h"
+#include <conference.h>
 
 #include <QApplication>
 #include <alarm.h>
@@ -9,8 +28,6 @@
 
 const int SNOOZE_TIME = 5; // in minutes
 
-const int confId = 1;
-
 AlarmDialog::AlarmDialog(int argc, char *argv[], QWidget *aParent)
     : QDialog(aParent)
     , mEventId(0)
@@ -47,7 +64,7 @@ AlarmDialog::AlarmDialog(int argc, char *argv[], QWidget *aParent)
     QString roomStr;
     try
     {
-        Event event = Event::getById(mEventId,confId);
+        Event event = Event::getById(mEventId,Conference::activeConference());
         titleStr = "Event alarm";
         messageStr = event.title();
         timeStr = event.start().toString("hh:mm") + "-" + event.start().addSecs(event.duration()).toString("hh:mm");
@@ -89,11 +106,11 @@ void AlarmDialog::closeDialog()
     // before closing the dialog, it is necessary to remove alarm flag from the DB
     try
     {
-        Event event = Event::getById(mEventId,confId);
+        Event event = Event::getById(mEventId,Conference::activeConference());
         event.setHasAlarm(false);
         event.update("alarm");
     }
-    catch(OrmNoObjectException) {} // TODO: implement
+    catch(OrmNoObjectException &) {} // TODO: implement
     catch(...) {} // just close dialog
     qApp->quit();
 }