From 10e0e7d9f74bf82c5e1531a0ce10a21f3a0ce0f4 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Wed, 7 May 2014 14:55:05 +0100 Subject: [PATCH] Add new class to define the dialog box to select sub windows from the list Initial code is introduced and added to the main app for debug purposes --- source/app/DialogSubWindowSelector.cpp | 69 ++++++++++++++++++++++++++ source/app/DialogSubWindowSelector.h | 64 ++++++++++++++++++++++++ source/app/plaYUVerApp.cpp | 3 ++ 3 files changed, 136 insertions(+) create mode 100755 source/app/DialogSubWindowSelector.cpp create mode 100755 source/app/DialogSubWindowSelector.h diff --git a/source/app/DialogSubWindowSelector.cpp b/source/app/DialogSubWindowSelector.cpp new file mode 100755 index 0000000..73bb11d --- /dev/null +++ b/source/app/DialogSubWindowSelector.cpp @@ -0,0 +1,69 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file DialogSubWindowSelector.cpp + * \brief Dialog box to select sub windows + */ + +#include "DialogSubWindowSelector.h" +#include "PlaYUVerFrame.h" +#include "InputStream.h" + +namespace plaYUVer +{ + +DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdiArea ) : + QDialog( parent ) +{ + QFont titleFont, menusFont; + + titleFont.setPointSize( 14 ); + titleFont.setBold( true ); + titleFont.setWeight( 75 ); + + menusFont.setBold( true ); + menusFont.setWeight( 75 ); + + resize( 392, 100 ); + setWindowTitle( "Sub Windows Selection" ); + + QVBoxLayout* MainLayout = new QVBoxLayout( this ); + + // Confirmation buttons + QDialogButtonBox* dialogButtonOkCancel = new QDialogButtonBox(); + dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok ); + dialogButtonOkCancel->setCenterButtons( false ); + + + // Add components + MainLayout->addItem( new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + MainLayout->addWidget( dialogButtonOkCancel ); + + // Create actions + connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) ); + connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) ); + QMetaObject::connectSlotsByName( this ); + + // Set variables + m_pcMainWindowMdiArea = mdiArea; + +} + +} // Namespace SCode diff --git a/source/app/DialogSubWindowSelector.h b/source/app/DialogSubWindowSelector.h new file mode 100755 index 0000000..66eef9a --- /dev/null +++ b/source/app/DialogSubWindowSelector.h @@ -0,0 +1,64 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file DialogSubWindowSelector.h + * \brief Dialog box to select sub windows + */ + +#ifndef __DIALOGSUBWINDOWSELECTOR_H__ +#define __DIALOGSUBWINDOWSELECTOR_H__ + +#include "config.h" + +#if( QT_VERSION_PLAYUVER == 5 ) +#include +#elif( QT_VERSION_PLAYUVER == 4 ) +#include +#endif +#include + +#include "TypeDef.h" + +class QPixmap; +class QColor; + +namespace plaYUVer +{ + +/** + * Class to define the dialog box to select sub windows + * This class enable the selection of several group of windows + */ +class DialogSubWindowSelector: public QDialog +{ +Q_OBJECT + +public: + DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0 ); + +private: + QMdiArea *m_pcMainWindowMdiArea; +private Q_SLOTS: + +}; + +} // NAMESPACE + +#endif // __DIALOGSUBWINDOWSELECTOR_H__ diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index a8c903b..2dbb9af 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -25,6 +25,7 @@ #include "plaYUVerApp.h" #include "SubWindowHandle.h" #include "InputStream.h" +#include "DialogSubWindowSelector.h" #if( QT_VERSION_PLAYUVER == 5 ) #include @@ -512,6 +513,8 @@ void plaYUVerApp::lockButtonEvent() void plaYUVerApp::videoSelectionButtonEvent() { + DialogSubWindowSelector dialogWindowsSelection( this ); + dialogWindowsSelection.exec(); }