Skip to content
Permalink
Browse files

Merge branch 'master' of github.com:qgis/Quantum-GIS

  • Loading branch information
mhugent committed Jul 12, 2011
2 parents db469be + f57bef4 commit e67648a0ab95139aff46a87d715d37475fa91fd4
@@ -18,6 +18,7 @@ if "%PACKAGENAME%"=="" set PACKAGENAME=qgis-dev
path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES%\CMake 2.8\bin
set PYTHONPATH=

if "%PROGRAMFILES%"=="" set PROGRAMFILES=C:\Programme
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

@@ -90,6 +91,7 @@ cmake -G "Visual Studio 9 2008" ^
-D WITH_SPATIALITE=TRUE ^
-D WITH_MAPSERVER=TRUE ^
-D WITH_ASTYLE=TRUE ^
-D WITH_GLOBE=TRUE ^
-D WITH_INTERNAL_SPATIALITE=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
@@ -157,26 +159,12 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
>>%LOG% 2>&1
if errorlevel 1 goto error

REM tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-%VERSION%-%PACKAGE%.tar.bz2 ^
REM --exclude-from exclude ^
REM "apps/%PACKAGENAME%/themes/classic/grass" ^
REM "apps/%PACKAGENAME%/themes/default/grass" ^
REM "apps/%PACKAGENAME%/themes/gis/grass" ^
REM "apps/%PACKAGENAME%/grass" ^
REM "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^
REM "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^
REM >>%LOG% 2>&1
REM if errorlevel 1 goto error

goto end

:error
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1
if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2
REM if exist %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2

:end
echo FINISHED: %DATE% %TIME% >>%LOG% 2>&1
@@ -13,6 +13,7 @@ SET(QGIS_APP_SRCS
qgsattributetypeloaddialog.cpp
qgsbookmarkitem.cpp
qgsbookmarks.cpp
qgsbrowserdockwidget.cpp
qgsclipboard.cpp
qgscontinuouscolordialog.cpp
qgsconfigureshortcutsdialog.cpp
@@ -146,6 +147,7 @@ SET (QGIS_APP_MOC_HDRS
qgsattributetypedialog.h
qgsattributetypeloaddialog.h
qgsbookmarks.h
qgsbrowserdockwidget.h
qgsconfigureshortcutsdialog.h
qgscontinuouscolordialog.h
qgscustomization.h
@@ -103,6 +103,7 @@
#include "qgsattributetabledialog.h"
#include "qgsbookmarkitem.h"
#include "qgsbookmarks.h"
#include "qgsbrowserdockwidget.h"
#include "qgsclipboard.h"
#include "qgscomposer.h"
#include "qgscomposermanager.h"
@@ -446,6 +447,11 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mSnappingDialog = new QgsSnappingDialog( this, mMapCanvas );
mSnappingDialog->setObjectName( "SnappingOption" );

mBrowserWidget = new QgsBrowserDockWidget( this );
mBrowserWidget->setObjectName( "Browser" );
addDockWidget( Qt::LeftDockWidgetArea, mBrowserWidget );
mBrowserWidget->hide();

mInternalClipboard = new QgsClipboard; // create clipboard
mQgisInterface = new QgisAppInterface( this ); // create the interfce

@@ -65,6 +65,7 @@ class QNetworkReply;
class QNetworkProxy;
class QAuthenticator;

class QgsBrowserDockWidget;
class QgsSnappingDialog;
class QgsGPSInformationWidget;

@@ -1049,6 +1050,8 @@ class QgisApp : public QMainWindow, private Ui::MainWindow

QgsUndoWidget* mUndoWidget;

QgsBrowserDockWidget* mBrowserWidget;

QgsSnappingDialog* mSnappingDialog;

//! Persistent tile scale slider
@@ -0,0 +1,100 @@
#include "qgsbrowserdockwidget.h"

#include <QTreeView>

#include "qgsbrowsermodel.h"
#include "qgsdataitem.h"
#include "qgslogger.h"
#include "qgsmaplayerregistry.h"
#include "qgsrasterlayer.h"
#include "qgsvectorlayer.h"

QgsBrowserDockWidget::QgsBrowserDockWidget( QWidget * parent ) :
QDockWidget( parent ), mModel( NULL )
{
setWindowTitle( tr( "Browser" ) );

mBrowserView = new QTreeView( this );
setWidget( mBrowserView );

//connect( mBrowserView, SIGNAL( clicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
connect( mBrowserView, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( itemClicked( const QModelIndex& ) ) );
}

void QgsBrowserDockWidget::showEvent( QShowEvent * e )
{
// delayed initialization of the model
if ( mModel == NULL )
{
mModel = new QgsBrowserModel( mBrowserView );
mBrowserView->setModel( mModel );
}

QDockWidget::showEvent( e );
}


void QgsBrowserDockWidget::itemClicked( const QModelIndex& index )
{
QgsDataItem *item = mModel->dataItem( index );
if ( !item )
return;

QgsLayerItem *layerItem = qobject_cast<QgsLayerItem*>( mModel->dataItem( index ) );
if ( layerItem == NULL )
return;

QString uri = layerItem->uri();
if ( uri.isEmpty() )
return;

QgsMapLayer::LayerType type = layerItem->mapLayerType();
QString providerKey = layerItem->providerKey();

QgsDebugMsg( providerKey + " : " + uri );
QgsMapLayer* layer = NULL;
if ( type == QgsMapLayer::VectorLayer )
{
layer = new QgsVectorLayer( uri, layerItem->name(), providerKey );
}
if ( type == QgsMapLayer::RasterLayer )
{
// This should go to WMS provider
QStringList URIParts = uri.split( "|" );
QString rasterLayerPath = URIParts.at( 0 );
QStringList layers;
QStringList styles;
QString format;
QString crs;
for ( int i = 1 ; i < URIParts.size(); i++ )
{
QString part = URIParts.at( i );
int pos = part.indexOf( "=" );
QString field = part.left( pos );
QString value = part.mid( pos + 1 );

if ( field == "layers" )
layers = value.split( "," );
if ( field == "styles" )
styles = value.split( "," );
if ( field == "format" )
format = value;
if ( field == "crs" )
crs = value;
}
QgsDebugMsg( "rasterLayerPath = " + rasterLayerPath );
QgsDebugMsg( "layers = " + layers.join( " " ) );

layer = new QgsRasterLayer( 0, rasterLayerPath, layerItem->name(), providerKey, layers, styles, format, crs );
}

if ( !layer || !layer->isValid() )
{
qDebug( "No layer" );
delete layer;
return;
}

// add layer to the application
QgsMapLayerRegistry::instance()->addMapLayer( layer );
}
@@ -0,0 +1,29 @@
#ifndef QGSBROWSERDOCKWIDGET_H
#define QGSBROWSERDOCKWIDGET_H

#include <QDockWidget>

class QgsBrowserModel;
class QModelIndex;
class QTreeView;

class QgsBrowserDockWidget : public QDockWidget
{
Q_OBJECT
public:
explicit QgsBrowserDockWidget( QWidget *parent = 0 );

signals:

public slots:
void itemClicked( const QModelIndex& index );

protected:

void showEvent( QShowEvent * event );

QTreeView* mBrowserView;
QgsBrowserModel* mModel;
};

#endif // QGSBROWSERDOCKWIDGET_H
@@ -5,14 +5,12 @@
SET (BROWSER_SRCS
main.cpp
qgsbrowser.cpp
qgsbrowsermodel.cpp
)

SET (BROWSER_UIS qgsbrowserbase.ui)

SET (BROWSER_MOC_HDRS
qgsbrowser.h
qgsbrowsermodel.h
)

#SET (BROWSER_RCCS qgsgps_plugin.qrc)
@@ -42,6 +42,7 @@ SET(QGIS_CORE_SRCS
qgis.cpp
qgsapplication.cpp
qgsattributeaction.cpp
qgsbrowsermodel.cpp
qgscentralpointpositionmanager.cpp
qgsclipper.cpp
qgscontexthelp.cpp
@@ -220,6 +221,7 @@ ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy)

SET(QGIS_CORE_MOC_HDRS
qgsapplication.h
qgsbrowsermodel.h
qgscontexthelp.h
qgscoordinatetransform.h
qgsdataitem.h
File renamed without changes.
@@ -7,7 +7,7 @@

#include "qgsdataitem.h"

class QgsBrowserModel : public QAbstractItemModel
class CORE_EXPORT QgsBrowserModel : public QAbstractItemModel
{
Q_OBJECT

@@ -50,7 +50,7 @@ class QgsBrowserModel : public QAbstractItemModel

virtual QStringList mimeTypes() const;

QMimeData * mimeData(const QModelIndexList &indexes) const;
QMimeData * mimeData( const QModelIndexList &indexes ) const;

QgsDataItem *dataItem( const QModelIndex &idx ) const;

0 comments on commit e67648a

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