diff --git a/source/app/DialogSubWindowSelector.cpp b/source/app/DialogSubWindowSelector.cpp index 73bb11d..4de12ab 100755 --- a/source/app/DialogSubWindowSelector.cpp +++ b/source/app/DialogSubWindowSelector.cpp @@ -23,8 +23,9 @@ */ #include "DialogSubWindowSelector.h" -#include "PlaYUVerFrame.h" -#include "InputStream.h" +#include "SubWindowHandle.h" +//#include "PlaYUVerFrame.h" +//#include "InputStream.h" namespace plaYUVer { @@ -34,6 +35,9 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdi { QFont titleFont, menusFont; + // Set variables + m_pcMainWindowMdiArea = mdiArea; + titleFont.setPointSize( 14 ); titleFont.setBold( true ); titleFont.setWeight( 75 ); @@ -46,23 +50,69 @@ DialogSubWindowSelector::DialogSubWindowSelector( QWidget *parent, QMdiArea *mdi QVBoxLayout* MainLayout = new QVBoxLayout( this ); + // Window list and add button + m_comboBoxWindowList = new QComboBox(); + QSizePolicy sizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed ); + sizePolicy.setHorizontalStretch( 0 ); + sizePolicy.setVerticalStretch( 0 ); + sizePolicy.setHeightForWidth( m_comboBoxWindowList->sizePolicy().hasHeightForWidth() ); + m_comboBoxWindowList->setSizePolicy( sizePolicy ); + m_comboBoxWindowList->setAcceptDrops( true ); + + updateSubWindowList(); + + m_pushButtonAdd = new QPushButton("Add", this); + + // Selected Sub Window List + m_listSelectedWindows = new QListWidget( this ); + // Confirmation buttons QDialogButtonBox* dialogButtonOkCancel = new QDialogButtonBox(); dialogButtonOkCancel->setStandardButtons( QDialogButtonBox::Cancel | QDialogButtonBox::Ok ); dialogButtonOkCancel->setCenterButtons( false ); + // Create Layouts + QHBoxLayout* headLayout = new QHBoxLayout(); + headLayout->addWidget( m_comboBoxWindowList ); + headLayout->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + headLayout->addWidget( m_pushButtonAdd ); // Add components + MainLayout->addItem( new QSpacerItem( 10, 5, QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + MainLayout->addLayout( headLayout ); + MainLayout->addItem( new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + MainLayout->addWidget( m_listSelectedWindows ); MainLayout->addItem( new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); MainLayout->addWidget( dialogButtonOkCancel ); + setLayout( MainLayout ); + // Create actions connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) ); + connect( m_pushButtonAdd, SIGNAL( clicked() ), this, SLOT( addSubWindow() ) ); QMetaObject::connectSlotsByName( this ); - // Set variables - m_pcMainWindowMdiArea = mdiArea; +} + +Void DialogSubWindowSelector::updateSubWindowList() +{ + SubWindowHandle *subWindow; + QString currSubWindowName; + for( Int i = 0; i < m_pcMainWindowMdiArea->subWindowList().size(); i++ ) + { + subWindow = qobject_cast( m_pcMainWindowMdiArea->subWindowList().at( i ) ); + currSubWindowName = subWindow->getWindowName(); + //if( m_listSelectedWindows->contai ) + m_pcWindowListNames.append( currSubWindowName ); + } + m_comboBoxWindowList->clear(); + m_comboBoxWindowList->insertItems( 0, m_pcWindowListNames ); + m_comboBoxWindowList->setCurrentIndex( -1 ); +} + +void DialogSubWindowSelector::addSubWindow() +{ } diff --git a/source/app/DialogSubWindowSelector.h b/source/app/DialogSubWindowSelector.h index 66eef9a..e3c9f89 100755 --- a/source/app/DialogSubWindowSelector.h +++ b/source/app/DialogSubWindowSelector.h @@ -54,8 +54,17 @@ public: DialogSubWindowSelector( QWidget *parent = 0, QMdiArea *mdiArea = 0 ); private: - QMdiArea *m_pcMainWindowMdiArea; + QMdiArea* m_pcMainWindowMdiArea; + QStringList m_pcWindowListNames; + + QComboBox* m_comboBoxWindowList; + QPushButton* m_pushButtonAdd; + QListWidget* m_listSelectedWindows; + + Void updateSubWindowList(); + private Q_SLOTS: + void addSubWindow(); }; diff --git a/source/app/SubWindowHandle.h b/source/app/SubWindowHandle.h index 6f3e708..4ed8df4 100644 --- a/source/app/SubWindowHandle.h +++ b/source/app/SubWindowHandle.h @@ -156,6 +156,10 @@ public: m_cWindowName = name; setWindowTitle( m_cWindowName ); } + QString getWindowName() + { + return m_cWindowName; + } QString userFriendlyCurrentFile() { diff --git a/source/app/plaYUVerApp.cpp b/source/app/plaYUVerApp.cpp index 2dbb9af..1fbc241 100644 --- a/source/app/plaYUVerApp.cpp +++ b/source/app/plaYUVerApp.cpp @@ -513,7 +513,7 @@ void plaYUVerApp::lockButtonEvent() void plaYUVerApp::videoSelectionButtonEvent() { - DialogSubWindowSelector dialogWindowsSelection( this ); + DialogSubWindowSelector dialogWindowsSelection( this, mdiArea ); dialogWindowsSelection.exec(); }