source: projectionDesigner/trunk/projdesigner/src/gui/QPanelWidget.cpp @ 317

Last change on this file since 317 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 1.6 KB
Line 
1#include "ProjectionModel.h"
2#include "gui/QChannelManagerWidget.h"
3#include "gui/QChannelWidget.h"
4#include "gui/QScreenWidget.h"
5#include "gui/QSceneWidget.h"
6#include "gui/QPanelWidget.h"
7
8using namespace projection;
9
10QPanelWidget::QPanelWidget(QWidget* pParent, Qt::WFlags flags)
11    : QWidget(pParent, flags)
12{
13    ui.setupUi(this);
14
15    m_pModel = NULL;
16}
17
18QPanelWidget::~QPanelWidget()
19{
20}
21
22void QPanelWidget::setModel(ProjectionModel* pModel)
23{
24    m_pModel = pModel;
25
26    ui.channelManager->setModel(m_pModel);
27    ui.screen->setScreen(m_pModel->getScreen());
28    ui.scene->setScene(m_pModel->getScene());
29
30    updateGUI();
31}
32
33void QPanelWidget::selectChannel(Channel* pChannel)
34{
35    if (ui.channelManager->getSelectedChannel() != m_pModel->getChannelIndex(pChannel))
36        ui.channelManager->selectChannel(m_pModel->getChannelIndex(pChannel));
37    if (ui.channel->getChannel() != pChannel) {
38        ui.channel->setChannel(pChannel);
39        ui.channel->updateGUI();
40    }
41}
42
43void QPanelWidget::activateChannels()
44{
45    ui.tabWidget->setCurrentIndex(0);
46}
47
48void QPanelWidget::activateScreen()
49{
50    ui.tabWidget->setCurrentIndex(1);
51}
52
53void QPanelWidget::activateScene()
54{
55    ui.tabWidget->setCurrentIndex(2);
56}
57
58void QPanelWidget::updateChannelNames()
59{
60    ui.channelManager->updateChannelNamesGUI();
61}
62
63void QPanelWidget::updateChannels()
64{
65    ui.channelManager->updateGUI();
66}
67
68void QPanelWidget::updateCurrentChannel()
69{
70    ui.channel->updateGUI();
71}
72
73void QPanelWidget::updateGUI()
74{
75    ui.channelManager->updateGUI();
76    ui.channel->updateGUI();
77    ui.screen->updateGUI();
78    ui.scene->updateGUI();
79}
Note: See TracBrowser for help on using the repository browser.