/*
* Copyright (C) 2010 Ixonos Plc.
+ * Copyright (C) 2011 Philipp Spitzer, gregor herrmann
*
* This file is part of ConfClerk.
*
#include <delegate.h>
#include "eventdialog.h"
-#include "mapwindow.h"
#include "room.h"
#include "errormessage.h"
connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool)));
connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
- connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &)));
// day navigator is hidden by default
disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool)));
}
-void TabContainer::displayMap(const QModelIndex &aIndex)
-{
- Event *event = static_cast<Event*>(aIndex.internalPointer());
-
- QVariant mapPathV = event->room()->map();
- QString mapPath;
- if (!mapPathV.isValid()) {
- error_message("No map for this room");
- return;
- } else {
- mapPath = mapPathV.toString();
- if (!QFile::exists(mapPath)) {
- error_message("Map for this room not found: " + mapPath);
- return;
- }
- }
-
- QPixmap map(mapPath);
- MapWindow window(map, event->room()->name(),this);
- window.exec();
-}
-
void TabContainer::displayConflicts(const QModelIndex &aIndex)
{
ConflictsDialog dialog(static_cast<Event*>(aIndex.internalPointer())->id(),this);
if(aReloadModel)
{
// requires special handling
- // eg. in case of favourities - some favourities may have changed
+ // eg. in case of favourites - some favourites may have changed
// and so we need to reload them
int confId = Conference::activeConference();
QDate startDate = Conference::getById(confId).start();
QDate endDate = Conference::getById(confId).end();
dayNavigator->setDates(startDate, endDate);
- updateTreeView( Conference::getById(confId).start() );
+ updateTreeView(dayNavigator->curDate());
}
else
{