Skip to content
Permalink
Browse files

show snapping menu entry also when docked

git-svn-id: http://svn.osgeo.org/qgis/trunk@14652 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 14, 2010
1 parent bd13504 commit aa65d7a34a74bb4a884e821df81c96f61c21d894
Showing with 21 additions and 20 deletions.
  1. +6 −9 src/app/qgisapp.cpp
  2. +0 −2 src/app/qgisapp.h
  3. +10 −2 src/app/qgssnappingdialog.cpp
  4. +5 −7 src/app/qgssnappingdialog.h
@@ -431,7 +431,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
addDockWidget( Qt::LeftDockWidgetArea, mUndoWidget );
mUndoWidget->hide();

mSnappingDialog = new QgsSnappingDialog( this, mMapCanvas );
mSnappingDialog = new QgsSnappingDialog( this, mMapCanvas );
mSnappingDialog->setObjectName( "SnappingOption" );

mInternalClipboard = new QgsClipboard; // create clipboard
@@ -1450,18 +1450,11 @@ void QgisApp::createMenus()
mEditMenu->addAction( mActionNodeTool );
mEditMenu->addAction( mActionRotatePointSymbols );

QSettings myQsettings;
bool myDockFlag = myQsettings.value( "/qgis/dockSnapping", false ).toBool();
if ( !myDockFlag )
{
mActionEditSeparator4 = mEditMenu->addSeparator();
mEditMenu->addAction( mActionSnappingOptions );
}

if ( layout == QDialogButtonBox::GnomeLayout || layout == QDialogButtonBox::MacLayout )
{
mActionEditSeparator3 = mEditMenu->addSeparator();
mEditMenu->addAction( mActionOptions );
mEditMenu->addAction( mActionSnappingOptions );
mEditMenu->addAction( mActionConfigureShortcuts );
mEditMenu->addAction( mActionStyleManagerV2 );
mEditMenu->addAction( mActionCustomProjection );
@@ -1587,6 +1580,7 @@ void QgisApp::createMenus()
mSettingsMenu->addAction( mActionStyleManagerV2 );
mSettingsMenu->addAction( mActionConfigureShortcuts );
mSettingsMenu->addAction( mActionOptions );
mSettingsMenu->addAction( mActionSnappingOptions );
}
#endif

@@ -1737,6 +1731,7 @@ void QgisApp::createToolBars()
mAttributesToolBar->addAction( mActionIdentify );

QToolButton *bt = new QToolButton( mAttributesToolBar );
bt->setObjectName( "SelectTool" );
bt->setPopupMode( QToolButton::MenuButtonPopup );
bt->addAction( mActionSelect );
bt->addAction( mActionSelectRectangle );
@@ -1775,6 +1770,7 @@ void QgisApp::createToolBars()
mAttributesToolBar->addAction( mActionOpenTable );

bt = new QToolButton( mAttributesToolBar );
bt->setObjectName( "MeasureTool" );
bt->setPopupMode( QToolButton::MenuButtonPopup );
bt->addAction( mActionMeasure );
bt->addAction( mActionMeasureArea );
@@ -1804,6 +1800,7 @@ void QgisApp::createToolBars()

// Annotation tools
bt = new QToolButton();
bt->setObjectName( "AnnotationTool" );
bt->setPopupMode( QToolButton::MenuButtonPopup );
bt->addAction( mActionTextAnnotation );
bt->addAction( mActionFormAnnotation );
@@ -245,7 +245,6 @@ class QgisApp : public QMainWindow
QAction *actionNodeTool() { return mActionNodeTool; }
QAction *actionEditSeparator2() { return mActionEditSeparator2; }
QAction *actionSnappingOptions() { return mActionSnappingOptions; }
QAction *actionEditSeparator4() { return mActionEditSeparator4; }

QAction *actionPan() { return mActionPan; }
QAction *actionZoomIn() { return mActionZoomIn; }
@@ -914,7 +913,6 @@ class QgisApp : public QMainWindow
QAction *mActionRotatePointSymbols;
QAction *mActionEditSeparator3;
QAction *mActionSnappingOptions;
QAction *mActionEditSeparator4;

QAction *mActionPan;
QAction *mActionZoomIn;
@@ -45,7 +45,7 @@ class QgsSnappingDock : public QDockWidget

};

QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas ): QDialog( parent ), mMapCanvas( canvas )
QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas ): QDialog( parent ), mMapCanvas( canvas ), mDock( 0 )
{
setupUi( this );

@@ -90,7 +90,7 @@ void QgsSnappingDialog::closeEvent( QCloseEvent* event )
{
QDialog::closeEvent( event );

if ( mDock == NULL )
if ( !mDock )
{
QSettings settings;
settings.setValue( "/Windows/BetterSnapping/geometry", saveGeometry() );
@@ -219,3 +219,11 @@ void QgsSnappingDialog::apply()
QgsProject::instance()->writeEntry( "Digitizing", "/LayerSnappingToleranceUnitList", toleranceUnitList );
QgsProject::instance()->writeEntry( "Digitizing", "/LayerSnappingEnabledList", enabledList );
}

void QgsSnappingDialog::show()
{
if( mDock )
mDock->setVisible( true );
else
QDialog::show();
}
@@ -38,16 +38,14 @@ class QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialogBase
~QgsSnappingDialog();

public slots:
/**
* apply the changes
*/
//! apply the changes
void apply();
/**
* update the Dialog
*/
void update();

//! update the Dialog
void update();

//! show dialog or dock
void show();

protected:
/**Constructor

0 comments on commit aa65d7a

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