changeset 202:bb04d9df8b41

set the filters always visible in the MainWindow but disable by default
author lbajardsilogic
date Tue, 29 Jan 2008 12:46:03 +0000
parents 32ee519c9919
children 74d1b3bda5a3
files sv/filter/Filter.cpp sv/main/MainWindow.cpp sv/main/MainWindow.h widgets/AudioFilterViewerWidget.cpp widgets/AudioFilterViewerWidget.h
diffstat 5 files changed, 11 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/sv/filter/Filter.cpp	Fri Jan 18 13:12:04 2008 +0000
+++ b/sv/filter/Filter.cpp	Tue Jan 29 12:46:03 2008 +0000
@@ -15,7 +15,7 @@
 
 Filter::Filter() : PropertyContainer(),
 	m_sourceChannelCount(0),
-	filterEnabled(true)
+	filterEnabled(false)
 {}
 
 Filter::~Filter()
--- a/sv/main/MainWindow.cpp	Fri Jan 18 13:12:04 2008 +0000
+++ b/sv/main/MainWindow.cpp	Tue Jan 29 12:46:03 2008 +0000
@@ -394,7 +394,7 @@
 
     statusBar();
 
-    newSession();
+    newEasaierSession();
 
 }
 
@@ -522,7 +522,6 @@
     setupViewMenu();
     setupPaneAndLayerMenus();
     setupTransformsMenu();
-	setupFiltersMenu();
 	setupSettingMenu();
     setupHelpMenu();
 
@@ -1859,7 +1858,6 @@
     emit canClearSelection(haveSelection);
     emit canEditSelection(haveSelection && haveCurrentEditableLayer);
     emit canSave(m_sessionFile != "" && m_documentModified);
-	emit canAddFilter(haveMainModel);		
 }
 
 void
@@ -2811,9 +2809,8 @@
     documentRestored();
     updateMenuStates();
 
-	//m_properties = new PropertyStack(0, m_paneStack->getCurrentPane());
-	//connect(m_properties, SIGNAL(removeSelectedItem()), this, SLOT(deleteCurrentLayer())); 
-	//m_toolBox->insertItem(0,"Layers", m_properties);
+	setupFiltersMenu();
+
 }
 
 void
@@ -3160,10 +3157,7 @@
 
 	m_EasaierManager->newSession();
 
-	//m_properties = new PropertyStack(0, m_paneStack->getCurrentPane() );
-	//connect(m_properties, SIGNAL(removeSelectedItem()), this, SLOT(deleteCurrentLayer())); 
-	//m_toolBox->insertItem(0,"Layers", m_properties);
-
+	setupFiltersMenu();
 
 	return ok ? FileOpenSucceeded : FileOpenFailed;
 }
@@ -5191,10 +5185,8 @@
     updateMenuStates();
 
 	m_qtabwidget->setCurrentIndex(Search);
-
-	//m_properties = new PropertyStack(0, m_paneStack->getCurrentPane() );
-	//connect(m_properties, SIGNAL(removeSelectedItem()), this, SLOT(deleteCurrentLayer())); 
-	//m_toolBox->insertItem(0,"Layers", m_properties);
+	
+	setupFiltersMenu();
 
 }
 
@@ -5269,9 +5261,8 @@
 
 	m_EasaierManager->openSession(m_document);
 
-	//m_properties = new PropertyStack(0, m_paneStack->getCurrentPane() );
-	//connect(m_properties, SIGNAL(removeSelectedItem()), this, SLOT(deleteCurrentLayer())); 
-	//m_toolBox->insertItem(0,"Layers", m_properties);
+	setupFiltersMenu();
+
     return ok;
 }
 
@@ -5494,37 +5485,18 @@
 
 void MainWindow::setupFiltersMenu()
 {
-	if (m_mainMenusCreated) return;
-
-	QAction *action = 0;
-	QMenu *menu = 0;
-
-    menu = menuBar()->addMenu(tr("&Filter"));
-    menu->setTearOffEnabled(true);
-    
 	RealTimeFilterFactory::FilterTypeSet filterTypes = RealTimeFilterFactory::getInstance()->getFilterTypes();
 	RealTimeFilterFactory::FilterTypeSet::iterator iter;
 
     for (iter = filterTypes.begin(); iter != filterTypes.end(); iter++) {
-		action = new QAction(RealTimeFilterFactory::getInstance()->getFilterLabel(*iter), this);
-		action->setObjectName(RealTimeFilterFactory::getInstance()->getFilterLabel(*iter));
-		connect(action, SIGNAL(triggered()), this, SLOT(addFilter()));
-		connect(this, SIGNAL(canAddFilter(bool)), action, SLOT(setEnabled(bool)));
-		menu->addAction(action);
+		QString filterType = RealTimeFilterFactory::getInstance()->getFilterLabel(*iter);
+		Filter* filter = m_document->createFilter(RealTimeFilterFactory::getInstance()->getFilterType(filterType));
 	}
 
 	connect(m_filterPropertyStack, SIGNAL(removeFilter(QString)), this, SLOT(removeFilter(QString))); 
 
 }
 
-void MainWindow::addFilter()
-{
-	QString filterType = sender()->objectName();
-
-	Filter* filter = m_document->createFilter(RealTimeFilterFactory::getInstance()->getFilterType(filterType));
-
-}
-
 void MainWindow::removeFilter(QString name)
 {
 	if (m_document)
--- a/sv/main/MainWindow.h	Fri Jan 18 13:12:04 2008 +0000
+++ b/sv/main/MainWindow.h	Tue Jan 29 12:46:03 2008 +0000
@@ -162,8 +162,6 @@
     void canSave(bool);
 	void newCurrentPane(Pane *pane);
 
-	void canAddFilter(bool);
-
 public slots:
     void preferenceChanged(PropertyContainer::PropertyName);
 
@@ -218,7 +216,6 @@
     void renameCurrentLayer();
     void deleteCurrentLayer();
 
-	void addFilter();
 	void removeFilter(QString);
 
     void playLoopToggled();
--- a/widgets/AudioFilterViewerWidget.cpp	Fri Jan 18 13:12:04 2008 +0000
+++ b/widgets/AudioFilterViewerWidget.cpp	Tue Jan 29 12:46:03 2008 +0000
@@ -21,7 +21,6 @@
 	m_pushButtonCONFIG = new QPushButton;
 	m_pushButtonUP = new QPushButton;
 	m_pushButtonDOWN = new QPushButton;
-	m_pushButtonREMOVE = new QPushButton;
 	m_pushButtonNEW = new QPushButton;
 
 	m_layoutACTION = new QHBoxLayout;
@@ -36,8 +35,6 @@
 	m_pushButtonUP->setIcon(QIcon(":icons/layerViewer_btn_up.png"));
 	m_pushButtonDOWN->setMaximumSize(20,20);
 	m_pushButtonDOWN->setIcon(QIcon(":icons/layerViewer_btn_down.png"));
-	m_pushButtonREMOVE->setMaximumSize(20,20);
-	m_pushButtonREMOVE->setIcon(QIcon(":icons/layerViewer_btn_remove.png"));
 	m_pushButtonNEW->setMaximumSize(20,20);
 	m_pushButtonNEW->setIcon(QIcon(":icons/layerViewer_btn_new.png"));
 	
@@ -48,7 +45,6 @@
 	m_layoutACTION->addWidget(m_pushButtonDOWN);
 	m_layoutACTION->addWidget(m_pushButtonNEW);
 	m_layoutACTION->addSpacing(10);
-	m_layoutACTION->addWidget(m_pushButtonREMOVE);
 
 	//the main one:
 	m_layoutMAIN->addWidget(m_widgetLIST);
@@ -58,8 +54,6 @@
 	connect(m_pushButtonUP,SIGNAL(clicked()),m_widgetLIST,SLOT(upCurrentItem()));
 	connect(m_pushButtonDOWN,SIGNAL(clicked()),m_widgetLIST,SLOT(downCurrentItem()));
 	connect(m_pushButtonCONFIG,SIGNAL(clicked()),m_widgetLIST,SLOT(openConfigBoxForCurrentItem()));
-	//connect(m_pushButtonREMOVE,SIGNAL(clicked()),this,SLOT(removeSelectedItemRequested()));
-	connect(m_pushButtonREMOVE,SIGNAL(clicked()),this,SLOT(removeFilterRequested()));
 		
 	/*connect the list of items */
 	connect(m_widgetLIST,SIGNAL(currentChanged(int)),this,SLOT(newItemSelected(int)));
--- a/widgets/AudioFilterViewerWidget.h	Fri Jan 18 13:12:04 2008 +0000
+++ b/widgets/AudioFilterViewerWidget.h	Tue Jan 29 12:46:03 2008 +0000
@@ -49,7 +49,6 @@
 	QPushButton *m_pushButtonCONFIG;
 	QPushButton *m_pushButtonUP;
 	QPushButton *m_pushButtonDOWN;
-	QPushButton *m_pushButtonREMOVE;
 	QPushButton *m_pushButtonNEW;
 
 	QHBoxLayout *m_layoutACTION;