00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <mxcpcFastStreamSelectionDialog.h>
00021 #include <mxcpcCameraSelector.h>
00022 #include <mxcpcFastStreamParametersSelector.h>
00023 #include <mxcpc_gui_config.h>
00024
00025 #include <QVBoxLayout>
00026 #include <QHBoxLayout>
00027 #include <QGroupBox>
00028 #include <QPushButton>
00029 #include <QLabel>
00030
00031
00032
00033 mxcpcFastStreamSelectionDialog::mxcpcFastStreamSelectionDialog(QWidget *parent)
00034 : mxcpcDialog(parent) {
00035
00036 QVBoxLayout *layout, *layout2;
00037 QHBoxLayout *layout3,*layout4;
00038 QGroupBox *group_box;
00039 QPushButton *button;
00040 QLabel *label;
00041 QWidget *widget;
00042 mxcpcCameraSelector *camera_selector;
00043 mxcpcFastStreamParametersSelector *stream_parameters_selector;
00044
00045 setWindowTitle(QString("FastStream Selection Dialog"));
00046
00047 layout4 = new QHBoxLayout(this);
00048 layout4->setSizeConstraint(QLayout::SetFixedSize);
00049
00050 label = new QLabel(this);
00051 layout4->addWidget(label, 0, Qt::AlignTop);
00052 label->setPixmap(QPixmap(":images/dialog_faststream.png"));
00053
00054 layout = new QVBoxLayout();
00055 layout4->addLayout(layout),
00056 layout->setSpacing(MXCPC_DIALOG_SPACING);
00057
00058 group_box = new QGroupBox(QString("Camera"), this);
00059 layout->addWidget(group_box);
00060 layout2 = new QVBoxLayout(group_box);
00061 CameraSelector = camera_selector = new mxcpcCameraSelector(group_box);
00062 layout2->addWidget(camera_selector);
00063
00064 group_box = new QGroupBox(QString("Stream Parameters"), this);
00065 layout->addWidget(group_box);
00066 layout2 = new QVBoxLayout(group_box);
00067 FastStreamParametersSelector
00068 = stream_parameters_selector
00069 = new mxcpcFastStreamParametersSelector(group_box);
00070 layout2->addWidget(stream_parameters_selector);
00071
00072 layout3 = new QHBoxLayout();
00073 layout->addLayout(layout3);
00074 button = new QPushButton(QString("Cancel"), this);
00075 layout3->addWidget(button);
00076 button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
00077 QSizePolicy::Fixed));
00078 QObject::connect(button, SIGNAL(clicked(void)),
00079 this, SLOT(processCancelClicked(void)));
00080 widget = new QWidget(this);
00081 layout3->addWidget(widget);
00082 button = new QPushButton(QString("OK"), this);
00083 layout3->addWidget(button);
00084 button->setDefault(true);
00085 button->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
00086 QSizePolicy::Fixed));
00087 QObject::connect(button, SIGNAL(clicked(void)),
00088 this, SLOT(processOkClicked(void)));
00089 }
00090
00091
00092
00093 void mxcpcFastStreamSelectionDialog::processCancelClicked(void) {
00094
00095 hide();
00096 }
00097
00098
00099 void mxcpcFastStreamSelectionDialog::processOkClicked(void) {
00100
00101 hide();
00102
00103 emit fastStreamSelected(CameraSelector->cameraIP(),
00104 CameraSelector->cameraPort(),
00105 CameraSelector->cameraProxyConfiguration(),
00106 FastStreamParametersSelector->getFrameRate());
00107 }
00108