[QGIS Commit] r9041 - branches/advanced_printing_branch/src/app/composer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 9 07:28:27 EDT 2008


Author: mhugent
Date: 2008-08-09 07:28:27 -0400 (Sat, 09 Aug 2008)
New Revision: 9041

Modified:
   branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp
Log:
Add toggle buttons of composer to action group so current tool is visible

Modified: branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp
===================================================================
--- branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp	2008-08-09 10:37:43 UTC (rev 9040)
+++ branches/advanced_printing_branch/src/app/composer/qgscomposer.cpp	2008-08-09 11:28:27 UTC (rev 9041)
@@ -64,14 +64,25 @@
   setupTheme();
 
   QString myIconPath = QgsApplication::themePath();
-  qWarning(QString(myIconPath +"mActionGroupItems.png").latin1() );
 
-  toolBar->addAction(QIcon(QPixmap(myIconPath+"mActionMoveItemContent.png")), tr("Move Item content"), this, SLOT(moveItemContent()));
+  QAction* moveItemContentAction = new QAction(QIcon(QPixmap(myIconPath+"mActionMoveItemContent.png")), tr("Move Item content"), 0);
+  moveItemContentAction->setCheckable(true);
+  connect(moveItemContentAction, SIGNAL(triggered()), this, SLOT(moveItemContent()));
+  toolBar->addAction(moveItemContentAction);
+  //toolBar->addAction(QIcon(QPixmap(myIconPath+"mActionMoveItemContent.png")), tr("Move Item content"), this, SLOT(moveItemContent()));
 
   toolBar->addAction(QIcon(QPixmap(myIconPath+"mActionGroupItems.png")), tr("&Group Items"), this, SLOT(groupItems()));
   toolBar->addAction(QIcon(QPixmap(myIconPath+"mActionUngroupItems.png")), tr("&Ungroup Items"), this, SLOT(ungroupItems()));
 
- 
+  QActionGroup* toggleActionGroup = new QActionGroup(this);
+  toggleActionGroup->addAction(moveItemContentAction);
+  toggleActionGroup->addAction(mActionAddNewMap);
+  toggleActionGroup->addAction(mActionAddNewLabel);
+  toggleActionGroup->addAction(mActionAddNewLegend);
+  toggleActionGroup->addAction(mActionAddNewScalebar);
+  toggleActionGroup->addAction(mActionAddImage);
+  toggleActionGroup->addAction(mActionSelectMoveItem);
+  toggleActionGroup->setExclusive(true);
   
 
   setWindowTitle(tr("QGIS - print composer"));
@@ -80,6 +91,13 @@
   mActionOpenTemplate->setEnabled(false);
   mActionSaveTemplateAs->setEnabled(false);
 
+  mActionAddNewMap->setCheckable(true);
+  mActionAddNewLabel->setCheckable(true);
+  mActionAddNewLegend->setCheckable(true);
+  mActionSelectMoveItem->setCheckable(true);
+  mActionAddNewScalebar->setCheckable(true);
+  mActionAddImage->setCheckable(true);
+
   mQgis = qgis;
   mFirstTime = true;
 
@@ -126,19 +144,6 @@
   mSizeGrip->resize(mSizeGrip->sizeHint());
   mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());
 
-#if 0 //hopefully not necessary any more
-  if ( ! connect( mQgis, SIGNAL( projectRead() ), this, SLOT( projectRead()) ) ) {
-    qDebug( "unable to connect to projectRead" );
-  } 
-  if ( ! connect( mQgis, SIGNAL( newProject() ), this, SLOT(newProject()) ) ) {
-    qDebug( "unable to connect to newProject" );
-  }
-
-  if ( ! connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(saveWindowState()) ) ) { 
-    qDebug( "unable to connect to aboutToQuit" );
-  }
-#endif //0
-
   restoreWindowState();
   selectItem(); // Set selection tool
 



More information about the QGIS-commit mailing list