group_toolbuttons.diff

Proposed patch - Alexander Bruy, 2011-01-28 04:39 AM

Download (3 KB)

View differences:

src/app/qgisapp.cpp (working copy)
1682 1682
  mLayerToolBar = addToolBar( tr( "Manage Layers" ) );
1683 1683
  mLayerToolBar->setIconSize( myIconSize );
1684 1684
  mLayerToolBar->setObjectName( "LayerToolBar" );
1685
  mLayerToolBar->addAction( mActionAddOgrLayer );
1686
  mLayerToolBar->addAction( mActionAddRasterLayer );
1685

  
1686
  QToolButton *bt = new QToolButton( mLayerToolBar );
1687
  bt->setObjectName( "AddLayer" );
1688
  bt->setPopupMode( QToolButton::MenuButtonPopup );
1689
  bt->addAction( mActionAddOgrLayer );
1690
  bt->addAction( mActionAddRasterLayer );
1687 1691
#ifdef HAVE_POSTGRESQL
1688
  mLayerToolBar->addAction( mActionAddPgLayer );
1692
  bt->addAction( mActionAddPgLayer );
1689 1693
#endif
1690 1694
#ifdef HAVE_SPATIALITE
1691
  mLayerToolBar->addAction( mActionAddSpatiaLiteLayer );
1695
  bt->addAction( mActionAddSpatiaLiteLayer );
1692 1696
#endif
1693
  mLayerToolBar->addAction( mActionAddWmsLayer );
1697
  bt->addAction( mActionAddWmsLayer );
1698

  
1699
  QSettings settings;
1700
  switch ( settings.value( "/UI/addLayer", 0 ).toInt() )
1701
  {
1702
    default:
1703
    case 0:
1704
      bt->setDefaultAction( mActionAddOgrLayer );
1705
      break;
1706

  
1707
    case 1:
1708
      bt->setDefaultAction( mActionAddRasterLayer );
1709
      break;
1710

  
1711
    case 2:
1712
      bt->setDefaultAction( mActionAddPgLayer );
1713
      break;
1714

  
1715
    case 3:
1716
      bt->setDefaultAction( mActionAddSpatiaLiteLayer );
1717
      break;
1718

  
1719
    case 4:
1720
      bt->setDefaultAction( mActionAddWmsLayer );
1721
      break;
1722
  }
1723
  mLayerToolBar->addWidget( bt );
1724
  connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
1725

  
1694 1726
  mLayerToolBar->addAction( mActionNewVectorLayer );
1695 1727
  mLayerToolBar->addAction( mActionRemoveLayer );
1696 1728
  //commented out for QGIS 1.4 by Tim
......
1762 1794
  mAttributesToolBar->setObjectName( "Attributes" );
1763 1795
  mAttributesToolBar->addAction( mActionIdentify );
1764 1796

  
1765
  QToolButton *bt = new QToolButton( mAttributesToolBar );
1797
  bt = new QToolButton( mAttributesToolBar );
1766 1798
  bt->setObjectName( "SelectTool" );
1767 1799
  bt->setPopupMode( QToolButton::MenuButtonPopup );
1768 1800
  bt->addAction( mActionSelect );
......
1771 1803
  bt->addAction( mActionSelectFreehand );
1772 1804
  bt->addAction( mActionSelectRadius );
1773 1805

  
1774
  QSettings settings;
1775 1806
  switch ( settings.value( "/UI/selectTool", 0 ).toInt() )
1776 1807
  {
1777 1808
    default:
......
7337 7368
    settings.setValue( "/UI/annotationTool", 1 );
7338 7369
  else if ( action == mActionAnnotation )
7339 7370
    settings.setValue( "/UI/annotationTool", 2 );
7371
  else if ( action == mActionAddOgrLayer )
7372
    settings.setValue( "/UI/addLayer", 0 );
7373
  else if ( action == mActionAddRasterLayer )
7374
    settings.setValue( "/UI/addLayer", 1 );
7375
  else if ( action == mActionAddPgLayer )
7376
    settings.setValue( "/UI/addLayer", 2 );
7377
  else if ( action == mActionAddSpatiaLiteLayer )
7378
    settings.setValue( "/UI/addLayer", 3 );
7379
  else if ( action == mActionAddWmsLayer )
7380
    settings.setValue( "/UI/addLayer", 4 );
7340 7381

  
7341 7382
  bt->setDefaultAction( action );
7342 7383
}