|
33 | 33 | #include "qgsapplication.h"
|
34 | 34 | #include "qgsmapcanvas.h"
|
35 | 35 | #include <ui_qgsbrowserlayerpropertiesbase.h>
|
| 36 | +#include <ui_qgsbrowserdirectorypropertiesbase.h> |
| 37 | + |
36 | 38 |
|
37 | 39 | #include <QDragEnterEvent>
|
38 | 40 | /**
|
@@ -330,14 +332,13 @@ void QgsBrowserDockWidget::showContextMenu( const QPoint & pt )
|
330 | 332 | // only favourites can be removed
|
331 | 333 | menu->addAction( tr( "Remove favourite" ), this, SLOT( removeFavourite() ) );
|
332 | 334 | }
|
333 |
| - |
| 335 | + menu->addAction( tr( "Properties" ), this, SLOT( showProperties( ) ) ); |
334 | 336 | }
|
335 | 337 | else if ( item->type() == QgsDataItem::Layer )
|
336 | 338 | {
|
337 | 339 | menu->addAction( tr( "Add Layer" ), this, SLOT( addCurrentLayer( ) ) );
|
338 | 340 | menu->addAction( tr( "Add Selected Layers" ), this, SLOT( addSelectedLayers() ) );
|
339 | 341 | menu->addAction( tr( "Properties" ), this, SLOT( showProperties( ) ) );
|
340 |
| - |
341 | 342 | }
|
342 | 343 | else if ( item->type() == QgsDataItem::Favourites )
|
343 | 344 | {
|
@@ -523,8 +524,10 @@ void QgsBrowserDockWidget::showProperties( )
|
523 | 524 | QgsDebugMsg( "Entered" );
|
524 | 525 | QModelIndex index = mBrowserView->currentIndex();
|
525 | 526 | QgsDataItem* item = dataItem( index );
|
| 527 | + if ( ! item ) |
| 528 | + return; |
526 | 529 |
|
527 |
| - if ( item != NULL && item->type() == QgsDataItem::Layer ) |
| 530 | + if ( item->type() == QgsDataItem::Layer ) |
528 | 531 | {
|
529 | 532 | QgsLayerItem *layerItem = qobject_cast<QgsLayerItem*>( item );
|
530 | 533 | if ( layerItem != NULL )
|
@@ -601,6 +604,20 @@ void QgsBrowserDockWidget::showProperties( )
|
601 | 604 | dialog->show();
|
602 | 605 | }
|
603 | 606 | }
|
| 607 | + else if ( item->type() == QgsDataItem::Directory ) |
| 608 | + { |
| 609 | + // initialize dialog |
| 610 | + QDialog *dialog = new QDialog( this ); |
| 611 | + Ui::QgsBrowserDirectoryPropertiesBase ui; |
| 612 | + ui.setupUi( dialog ); |
| 613 | + |
| 614 | + dialog->setWindowTitle( tr( "Directory Properties" ) ); |
| 615 | + ui.leSource->setText( item->path() ); |
| 616 | + QgsDirectoryParamWidget *paramWidget = new QgsDirectoryParamWidget( item->path(), dialog ); |
| 617 | + ui.lytWidget->addWidget( paramWidget ); |
| 618 | + |
| 619 | + dialog->show(); |
| 620 | + } |
604 | 621 | }
|
605 | 622 |
|
606 | 623 | void QgsBrowserDockWidget::showFilterWidget( bool visible )
|
|
0 commit comments