changeset 205:00cf9a7faa4d

add menu and shortcut to show/hide both ExpandWidget (layers and filters, search/info tab)
author lbajardsilogic
date Wed, 30 Jan 2008 10:20:41 +0000
parents c5970f7af886
children fa034c6ae8bf
files sv/main/MainWindow.cpp widgets/ExpandWidget.cpp widgets/ExpandWidget.h
diffstat 3 files changed, 26 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/sv/main/MainWindow.cpp	Wed Jan 30 09:06:08 2008 +0000
+++ b/sv/main/MainWindow.cpp	Wed Jan 30 10:20:41 2008 +0000
@@ -965,13 +965,23 @@
     action->setChecked(m_viewManager->getZoomWheelsEnabled());
     menu->addAction(action);
         
-    /*action = new QAction(tr("Show Property Bo&xes"), this);
-    action->setShortcut(tr("X"));
-    action->setStatusTip(tr("Show the layer property boxes at the side of the main window"));
-    connect(action, SIGNAL(triggered()), this, SLOT(togglePropertyBoxes()));
-    action->setCheckable(true);
-    action->setChecked(true);
-    menu->addAction(action);*/
+    action = new QAction(tr("Show Layers and &Filters"), this);
+    action->setShortcut(tr("F"));
+    action->setStatusTip(tr("Show the layers and the real-time filters activated at the side of the main window"));
+    connect(action, SIGNAL(triggered()), m_rightExpandWidget, SLOT(changePaneState()));
+	connect(m_rightExpandWidget, SIGNAL(paneStateChanged(bool)), action, SLOT(setChecked(bool)));
+	action->setCheckable(true);
+	action->setChecked(m_rightExpandWidget->isVisible());
+    menu->addAction(action);
+
+	action = new QAction(tr("Show Search/Tracks &Info Panes"), this);
+    action->setShortcut(tr("I"));
+    action->setStatusTip(tr("Show the search funtionalities and tracks information at the bottom of the main window"));
+    connect(action, SIGNAL(triggered()), m_leftExpandWidget, SLOT(changePaneState()));
+	connect(m_leftExpandWidget, SIGNAL(paneStateChanged(bool)), action, SLOT(setChecked(bool)));
+	action->setCheckable(true);
+    action->setChecked(m_leftExpandWidget->isVisible());
+    menu->addAction(action);
 
     action = new QAction(tr("Show Status &Bar"), this);
     action->setStatusTip(tr("Show context help information in the status bar at the bottom of the window"));
--- a/widgets/ExpandWidget.cpp	Wed Jan 30 09:06:08 2008 +0000
+++ b/widgets/ExpandWidget.cpp	Wed Jan 30 10:20:41 2008 +0000
@@ -28,7 +28,7 @@
 
 	setWidgetLocation(ExpandWidget::Location_Left);
 
-    connect(m_button,SIGNAL(clicked()),this,SLOT(changePaneSate()));
+    connect(m_button,SIGNAL(clicked()),this,SLOT(changePaneState()));
 }
 
 void ExpandWidget::refreshButtonIcone(){
@@ -179,12 +179,13 @@
 }
 
 
-void ExpandWidget::changePaneSate(){
+void ExpandWidget::changePaneState(){
      if(&m_paneClosed!=0 ){				
 		 m_otherPane->setVisible(m_paneClosed);
      }
 	 m_paneClosed = !m_paneClosed;
 	 refreshButtonIcone();
+	 emit paneStateChanged(!m_paneClosed);
 }
 
 void ExpandWidget::setPercentage(int a, int b)
--- a/widgets/ExpandWidget.h	Wed Jan 30 09:06:08 2008 +0000
+++ b/widgets/ExpandWidget.h	Wed Jan 30 10:20:41 2008 +0000
@@ -44,10 +44,13 @@
 
 		void setPercentage(int a, int b);
 
-	//signals:
-      
+		inline bool isVisible(){return !m_paneClosed;}
+
+	signals:
+		void paneStateChanged(bool );//emit true if the pane is visible false if not
+
 	private slots:
-		void changePaneSate();
+		void changePaneState();
     
 	private:
 		void refreshButtonIcone();