00001 #include "overviewwidget.h" 00002 00003 #include "guifactory.h" 00004 00005 #include <control/controldata.h> 00006 #include <control/models/invitationmodel.h> 00007 #include <control/models/taskmodel.h> 00008 #include <control/models/usermodel.h> 00009 #include <control/models/reservationmodel.h> 00010 #include <control/models/resourcemodel.h> 00011 #include <control/models/projectmodel.h> 00012 00013 using namespace ui; 00014 00015 OverviewWidget::OverviewWidget(QWidget* parent) : QWidget(parent) 00016 { 00017 widgets.setupUi(this); 00018 00019 GuiFactory::initView(widgets.invitationsView); 00020 GuiFactory::initView(widgets.usersView); 00021 GuiFactory::initView(widgets.tasksView); 00022 GuiFactory::initView(widgets.reservationsView); 00023 GuiFactory::initView(widgets.resourcesView); 00024 GuiFactory::initView(widgets.projectsView); 00025 } 00026 00027 void OverviewWidget::setDetails(const control::data::OverviewDetails& details) 00028 { 00029 widgets.invitationsView->setModel(details.invitations); 00030 widgets.usersView->setModel(details.users); 00031 widgets.tasksView->setModel(details.tasks); 00032 widgets.reservationsView->setModel(details.reservations); 00033 widgets.resourcesView->setModel(details.resources); 00034 widgets.projectsView->setModel(details.projects); 00035 }