00001 #include "invitationselectionwidget.h"
00002
00003 #include "guifactory.h"
00004
00005 #include <control/models/invitationmodel.h>
00006
00007 #include <QDebug>
00008
00009 using namespace ui;
00010
00011 InvitationSelectionWidget::InvitationSelectionWidget(QWidget* parent) : QWidget(parent)
00012 {
00013 widgets.setupUi(this);
00014 GuiFactory::initView(widgets.pendingView);
00015 GuiFactory::initView(widgets.acceptedView);
00016 widgets.acceptedView->setSelectionMode(QAbstractItemView::NoSelection);
00017
00018
00019
00020 connect(widgets.pendingView, SIGNAL(doubleClicked(QModelIndex)),
00021 this, SIGNAL(doubleClicked()));
00022 }
00023
00024 void InvitationSelectionWidget::setPendingModel(control::InvitationModel* model)
00025 {
00026 widgets.pendingView->setModel(model);
00027 GuiFactory::initViewSize(widgets.pendingView);
00028 }
00029
00030 void InvitationSelectionWidget::setAcceptedModel(control::InvitationModel* model)
00031 {
00032 widgets.acceptedView->setModel(model);
00033 GuiFactory::initViewSize(widgets.acceptedView);
00034 }
00035
00036 QModelIndexList InvitationSelectionWidget::selection() const
00037 {
00038 return widgets.pendingView->selectionModel()->selectedRows();
00039 }