]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/mainwindow.cpp
Warning handling
[toast/confclerk.git] / src / gui / mainwindow.cpp
index 7f2da94faaf904b3e28c0d6d6bfdbaa7bb1e9540..97f1716115771233cf9fefea594a31dd494a50ec 100644 (file)
 #include <conference.h>
 
 #include <QDialog>
+#include <QMessageBox>
 #include "ui_about.h"
 #include "eventdialog.h"
 #include "daynavigatorwidget.h"
 #include "importscheduledialog.h"
 #include "mapwindow.h"
 
+
 const int confId = 1;
 
 MainWindow::MainWindow(int aEventId, QWidget *aParent)
@@ -85,6 +87,11 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
     connect(favTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     connect(trackTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
+    // request for warning to be displayed
+    connect(dayTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
+    connect(favTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
+    connect(trackTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
+    connect(searchTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
     // event search button clicked
     connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));
 
@@ -273,3 +280,10 @@ void MainWindow::searchClicked()
     updateSearchView( Conference::getById(confId).start() );
 }
 
+void MainWindow::displayWarning(const QModelIndex &aIndex)
+{
+    QMessageBox::warning(
+    this,
+    tr("Time Conflict Warning"),
+    tr("This event happens at the same time than another one of your favourites.") );
+}