Conference map
authorfortefr <fortefr@localhost>
Fri, 22 Jan 2010 14:41:46 +0000 (14:41 +0000)
committerfortefr <fortefr@localhost>
Fri, 22 Jan 2010 14:41:46 +0000 (14:41 +0000)
src/gui/mainwindow.cpp
src/gui/mainwindow.h
src/gui/mainwindow.ui
src/mvc/delegate.cpp

index 025593c..ec6fc0e 100644 (file)
@@ -121,6 +121,8 @@ MainWindow::MainWindow(int aEventId, QWidget *aParent)
     connect(nowTreeView, SIGNAL(requestForWarning(const QModelIndex &)), SLOT(displayWarning(const QModelIndex &)));
     // event search button clicked
     connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));
+    // event conference map button clicked
+    connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));
     //
     connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(tabHasChanged(int)));
 
@@ -291,6 +293,20 @@ void MainWindow::searchClicked()
     updateSearchView( Conference::getById(AppSettings::confId()).start() );
 }
 
+void MainWindow::conferenceMapClicked()
+{
+
+    QString mapPath = QString(":/maps/campus.png");
+    if(!QFile::exists(mapPath))
+        mapPath = QString(":/maps/rooms/not-available.png");
+
+    QString roomName;
+
+    QPixmap map(mapPath);
+    MapWindow window(map,roomName,this);
+    window.exec();
+}
+
 void MainWindow::displayWarning(const QModelIndex &aIndex)
 {
     Q_UNUSED(aIndex);
index df6b57d..af0b5e7 100644 (file)
@@ -27,6 +27,7 @@ private slots:
     void displayMap(const QModelIndex &aIndex);
     void displayWarning(const QModelIndex &aIndex);
     void searchClicked();
+    void conferenceMapClicked();
     void tabHasChanged(int aIndex);
     void eventHasChanged(int aEventId);
 private:
index 0089627..a5e7d6a 100644 (file)
         </item>
        </layout>
       </widget>
-      <widget class="QWidget" name="mapTab" >
-       <attribute name="title" >
-        <string>Map</string>
-       </attribute>
-      </widget>
-      <widget class="QWidget" name="conferenceTab" >
-       <attribute name="title" >
+     <widget class="QWidget" name="conferenceTab" >
+      <attribute name="title" >
         <string>Conference</string>
        </attribute>
        <layout class="QGridLayout" name="gridLayout_5" >
index 406e490..8e25929 100644 (file)
@@ -320,14 +320,13 @@ Delegate::ControlId Delegate::whichControlClicked(const QModelIndex &aIndex, con
         {
             return id;
         }
-        else
-        {
-            if ((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
+        else if ((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
             && (mControls[id]->hasConflict))
-            {
+        {
+            qDebug() << "tengo conflicto";
             return id;
-            }
         }
+
     }
 
     return ControlNone;