diff sv/main/MainWindow.cpp @ 130:b3df8b8185db

video in a widget, with a basic solution (not optimal)
author benoitrigolleau
date Thu, 08 Nov 2007 14:27:36 +0000
parents 587ad94d6ac2
children b5087d5a7814
line wrap: on
line diff
--- a/sv/main/MainWindow.cpp	Thu Nov 08 13:29:48 2007 +0000
+++ b/sv/main/MainWindow.cpp	Thu Nov 08 14:27:36 2007 +0000
@@ -108,6 +108,8 @@
 #include <cstdio>
 #include <errno.h>
 
+#include "data/model/SDLWidget.h"
+
 using std::cerr;
 using std::endl;
 
@@ -153,6 +155,8 @@
     m_abandoning(false),
     m_preferencesDialog(0)
 {
+
+	m_videoWidget = 0;
 	m_instance = this;
 
     setWindowTitle(tr("Sound Access"));
@@ -275,7 +279,7 @@
 	m_qtabwidget->addTab(new QWidget, tr("Related media"));
 
 	QGridLayout *auxlayout = new QGridLayout;
-	auxlayout->addWidget(m_paneStack, 0, 0, 1, 5);
+	auxlayout->addWidget(m_paneStack, 0, 0, 1, 2);
     auxlayout->addWidget(m_overview, 1, 0);
     auxlayout->addWidget(m_fader, 1, 1);
     //auxlayout->addWidget(m_playSpeed, 1, 2);
@@ -312,6 +316,27 @@
 	widgetAuxForLogo->setLayout(logoLayout);
 	/****************************/
 
+	/************video***********/
+	SDLWidget* tt = new SDLWidget();
+	QHBoxLayout *videoHLayout= new QHBoxLayout;
+	videoHLayout->addStretch();
+	videoHLayout->addWidget(tt);
+	videoHLayout->addStretch();
+	QVBoxLayout *videoVLayout= new QVBoxLayout;
+	videoVLayout->addStretch();
+	videoVLayout->addLayout(videoHLayout);
+	videoVLayout->addStretch();
+
+	QWidget *ttaux = new QWidget;
+	ttaux->setLayout(videoVLayout);
+	QPalette palette;
+	palette.setColor(QPalette::Background,palette.color(QPalette::Dark));
+	ttaux->setPalette(palette);
+
+	m_qtabwidget->addTab(ttaux, tr("Video"));
+
+	/****************************/
+
 	m_rightExpandWidget = new ExpandWidget();
 	m_rightExpandWidget->setWidgetLocation(ExpandWidget::Location_Right);
 	m_rightExpandWidget->setPanes(m_leftExpandWidget, widgetAuxForLogo);
@@ -389,6 +414,10 @@
 	m_instance = 0;
 }
 
+QWidget* MainWindow::getVideoWidget(){
+	return m_videoWidget;
+}
+
 QString
 MainWindow::getOpenFileName(FileFinder::FileType type)
 {
@@ -2307,11 +2336,14 @@
 {
     QString path = getOpenFileName(FileFinder::VideoFile);
 
+	m_qtabwidget->setCurrentIndex(Video);
+
     if (path != "") {
-	if (openVideoFile(path, ReplaceMainModel) == FileOpenFailed) {
-	    QMessageBox::critical(this, tr("Failed to open file"),
-				  tr("Video file \"%1\" could not be opened").arg(path));
-	 }
+		if (openVideoFile(path, ReplaceMainModel) == FileOpenFailed) {
+			QMessageBox::critical(this, tr("Failed to open file"),
+					  tr("Video file \"%1\" could not be opened").arg(path));
+		}
+
     }
 }
 //