Skip to content

Commit

Permalink
Merge pull request #4659 from boundlessgeo/browser-to-gui
Browse files Browse the repository at this point in the history
Move QgsBrowserDockWidget from app to gui
  • Loading branch information
elpaso authored Jun 2, 2017
2 parents 2d78ef8 + d62d444 commit c9e6f15
Show file tree
Hide file tree
Showing 10 changed files with 897 additions and 529 deletions.
1 change: 1 addition & 0 deletions python/gui/gui.sip
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
%Include qgsattributeforminterface.sip
%Include qgsattributetypeloaddialog.sip
%Include qgsbrowsertreeview.sip
%Include qgsbrowserdockwidget.sip
%Include qgsbusyindicatordialog.sip
%Include qgscollapsiblegroupbox.sip
%If (HAVE_QSCI_SIP)
Expand Down
142 changes: 142 additions & 0 deletions python/gui/qgsbrowserdockwidget.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsbrowserdockwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsBrowserDockWidget : QgsDockWidget
{
%Docstring
The QgsBrowserDockWidget class
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserDockWidget( const QString &name, QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsBrowserDockWidget
\param name name of the widget
\param parent parent widget
%End
~QgsBrowserDockWidget();
void addFavoriteDirectory( const QString &favDir );
%Docstring
Add directory to favorites
%End

public slots:
void addLayerAtIndex( const QModelIndex &index );
%Docstring
Add layer at index
%End
void showContextMenu( QPoint );
%Docstring
Show context menu
%End

void addFavorite();
%Docstring
Add current item to favorite
%End
void addFavoriteDirectory();
%Docstring
Add directory from file dialog to favorite
%End
void removeFavorite();
%Docstring
Remove from favorite
%End

void refresh();
%Docstring
Refresh browser view model (and view)
%End

void showFilterWidget( bool visible );
%Docstring
Show/hide filter widget
%End
void enablePropertiesWidget( bool enable );
%Docstring
Enable/disable properties widget
%End
void setFilterSyntax( QAction * );
%Docstring
Set filter syntax
%End
void setCaseSensitive( bool caseSensitive );
%Docstring
Set filter case sensitivity
%End
void setFilter();
%Docstring
Apply filter to the model
%End
void updateProjectHome();
%Docstring
Update project home directory
%End

void addSelectedLayers();
%Docstring
Add selected layers to the project
%End
void showProperties();
%Docstring
Show the layer properties
%End
void hideItem();
%Docstring
Hide current item
%End
void toggleFastScan();
%Docstring
Toggle fast scan
%End

void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
%Docstring
Selection hass changed
%End
void splitterMoved();
%Docstring
Splitter has been moved
%End

signals:
void openFile( const QString & );
%Docstring
Emitted when a file needs to be opened
%End
void handleDropUriList( const QgsMimeDataUtils::UriList & );
%Docstring
Emitted when drop uri list needs to be handled
%End

protected:
virtual void showEvent( QShowEvent *event );

%Docstring
Show event override
%End

};



/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsbrowserdockwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2 changes: 0 additions & 2 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ SET(QGIS_APP_SRCS
qgsattributetypedialog.cpp
qgsattributetabledialog.cpp
qgsbookmarks.cpp
qgsbrowserdockwidget.cpp
qgsclipboard.cpp
qgscustomization.cpp
qgscustomprojectiondialog.cpp
Expand Down Expand Up @@ -204,7 +203,6 @@ SET (QGIS_APP_MOC_HDRS
qgsattributetypedialog.h
qgsattributetabledialog.h
qgsbookmarks.h
qgsbrowserdockwidget.h
qgsclipboard.h
qgscustomization.h
qgscustomprojectiondialog.h
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,17 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mBrowserWidget->setObjectName( QStringLiteral( "Browser" ) );
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget );
mBrowserWidget->hide();
connect( this, &QgisApp::newProject, mBrowserWidget, &QgsBrowserDockWidget::updateProjectHome );
connect( mBrowserWidget, &QgsBrowserDockWidget::openFile, this, &QgisApp::openFile );
connect( mBrowserWidget, &QgsBrowserDockWidget::handleDropUriList, this, &QgisApp::handleDropUriList );

mBrowserWidget2 = new QgsBrowserDockWidget( tr( "Browser Panel (2)" ), this );
mBrowserWidget2->setObjectName( QStringLiteral( "Browser2" ) );
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget2 );
mBrowserWidget2->hide();
connect( this, &QgisApp::newProject, mBrowserWidget2, &QgsBrowserDockWidget::updateProjectHome );
connect( mBrowserWidget2, &QgsBrowserDockWidget::openFile, this, &QgisApp::openFile );
connect( mBrowserWidget2, &QgsBrowserDockWidget::handleDropUriList, this, &QgisApp::handleDropUriList );

addDockWidget( Qt::LeftDockWidgetArea, mAdvancedDigitizingDockWidget );
mAdvancedDigitizingDockWidget->hide();
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
*/
bool addProject( const QString &projectFile );

/** Convenience function to open either a project or a layer file.
*/
void openFile( const QString &fileName );
//!Overloaded version of the private function with same name that takes the imagename as a parameter
void saveMapAsImage( const QString &, QPixmap * );

Expand Down Expand Up @@ -618,13 +615,16 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! Unregister a previously registered custom drop handler.
void unregisterCustomDropHandler( QgsCustomDropHandler *handler );

public slots:
//! Process the list of URIs that have been dropped in QGIS
void handleDropUriList( const QgsMimeDataUtils::UriList &lst );

//! Returns the active map layer.
QgsMapLayer *activeLayer();

public slots:
//! Convenience function to open either a project or a layer file.
void openFile( const QString &fileName );
void layerTreeViewDoubleClicked( const QModelIndex &index );
//! Make sure the insertion point for new layers is up-to-date with the current item in layer tree view
void updateNewLayerInsertionPoint();
Expand Down
6 changes: 6 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ SET(QGIS_GUI_SRCS
qgsattributetypeloaddialog.cpp
qgsblendmodecombobox.cpp
qgsbrowsertreeview.cpp
qgsbrowserdockwidget.cpp
qgsbrowserdockwidget_p.cpp
qgsbusyindicatordialog.cpp
qgscharacterselectordialog.cpp
qgscheckablecombobox.cpp
Expand Down Expand Up @@ -362,6 +364,8 @@ SET(QGIS_GUI_MOC_HDRS
qgsdial.h
qgsdialog.h
qgsdockwidget.h
qgsbrowserdockwidget_p.h
qgsbrowserdockwidget.h
qgsencodingfiledialog.h
qgserrordialog.h
qgsexpressionbuilderdialog.h
Expand Down Expand Up @@ -648,6 +652,8 @@ SET(QGIS_GUI_HDRS
qgssqlcomposerdialog.h
qgstablewidgetitem.h
qgsuserinputdockwidget.h
qgsbrowserdockwidget.h
qgsbrowserdockwidget_p.h
qgsvertexmarker.h
qgsfiledownloader.h

Expand Down
Loading

0 comments on commit c9e6f15

Please sign in to comment.