Skip to content
Permalink
Browse files

add directory properties dialog to browser dock

  • Loading branch information
etiennesky committed Nov 3, 2012
1 parent 14b472d commit e3ccde196c6c252e1bad7093b57d8a26f15af437
Showing with 21 additions and 4 deletions.
  1. +20 −3 src/app/qgsbrowserdockwidget.cpp
  2. +1 −1 src/ui/qgsbrowserlayerpropertiesbase.ui
@@ -33,6 +33,8 @@
#include "qgsapplication.h"
#include "qgsmapcanvas.h"
#include <ui_qgsbrowserlayerpropertiesbase.h>
#include <ui_qgsbrowserdirectorypropertiesbase.h>


#include <QDragEnterEvent>
/**
@@ -330,14 +332,13 @@ void QgsBrowserDockWidget::showContextMenu( const QPoint & pt )
// only favourites can be removed
menu->addAction( tr( "Remove favourite" ), this, SLOT( removeFavourite() ) );
}

menu->addAction( tr( "Properties" ), this, SLOT( showProperties( ) ) );
}
else if ( item->type() == QgsDataItem::Layer )
{
menu->addAction( tr( "Add Layer" ), this, SLOT( addCurrentLayer( ) ) );
menu->addAction( tr( "Add Selected Layers" ), this, SLOT( addSelectedLayers() ) );
menu->addAction( tr( "Properties" ), this, SLOT( showProperties( ) ) );

}
else if ( item->type() == QgsDataItem::Favourites )
{
@@ -523,8 +524,10 @@ void QgsBrowserDockWidget::showProperties( )
QgsDebugMsg( "Entered" );
QModelIndex index = mBrowserView->currentIndex();
QgsDataItem* item = dataItem( index );
if ( ! item )
return;

if ( item != NULL && item->type() == QgsDataItem::Layer )
if ( item->type() == QgsDataItem::Layer )
{
QgsLayerItem *layerItem = qobject_cast<QgsLayerItem*>( item );
if ( layerItem != NULL )
@@ -601,6 +604,20 @@ void QgsBrowserDockWidget::showProperties( )
dialog->show();
}
}
else if ( item->type() == QgsDataItem::Directory )
{
// initialize dialog
QDialog *dialog = new QDialog( this );
Ui::QgsBrowserDirectoryPropertiesBase ui;
ui.setupUi( dialog );

dialog->setWindowTitle( tr( "Directory Properties" ) );
ui.leSource->setText( item->path() );
QgsDirectoryParamWidget *paramWidget = new QgsDirectoryParamWidget( item->path(), dialog );
ui.lytWidget->addWidget( paramWidget );

dialog->show();
}
}

void QgsBrowserDockWidget::showFilterWidget( bool visible )
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>617</height>
<height>600</height>
</rect>
</property>
<property name="windowTitle">

0 comments on commit e3ccde1

Please sign in to comment.
You can’t perform that action at this time.