X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fforms%2Fcadtoolbar.cpp;h=ec5929dec3a5a824c2a7f53c1755b164bc8d599f;hb=52b41ea9bcb03acb96393b36fe29f27ca0163565;hp=4bfe299ab4c4a50bd25d75b361d179b2806cb9c4;hpb=3f46c180da0806c9c263e6d87d0f1404632402da;p=architektonas diff --git a/src/forms/cadtoolbar.cpp b/src/forms/cadtoolbar.cpp index 4bfe299..ec5929d 100644 --- a/src/forms/cadtoolbar.cpp +++ b/src/forms/cadtoolbar.cpp @@ -36,7 +36,7 @@ CadToolBar::CadToolBar(QWidget * parent/*= 0*/, Qt::WindowFlags flags/*= 0*/): tbSelect(NULL), tbPolylines(NULL) { ui.setupUi(this); -//hm. here maybe? +//hm. here maybe? Yesh! if (parent) ((QToolBar *)parent)->addWidget(this); } @@ -66,7 +66,7 @@ void CadToolBar::back() */ void CadToolBar::forceNext() { - if (currentTb != NULL && currentTb == tbSelect) + if (currentTb && currentTb == tbSelect) tbSelect->runNextAction(); } @@ -94,6 +94,7 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) actionHandler = ah; tbMain = new CadToolBarMain(this); tbMain->setCadToolBar(this); + currentTb = tbMain; tbPoints = new CadToolBarPoints(this); tbPoints->setCadToolBar(this); @@ -119,11 +120,9 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) tbSplines->setCadToolBar(this); tbSplines->hide(); -//#ifdef RS_PROF tbPolylines = new CadToolBarPolylines(this); tbPolylines->setCadToolBar(this); tbPolylines->hide(); -//#endif tbDim = new CadToolBarDim(this); tbDim->setCadToolBar(this); @@ -144,8 +143,6 @@ void CadToolBar::createSubToolBars(QG_ActionHandler * ah) tbSelect = new CadToolBarSelect(this); tbSelect->setCadToolBar(this); tbSelect->hide(); - - //showToolBarMain(); } void CadToolBar::showToolBar(int id) @@ -173,11 +170,9 @@ void CadToolBar::showToolBar(int id) case RS2::ToolBarSplines: newTb = tbSplines; break; -//#ifdef RS_PROF case RS2::ToolBarPolylines: newTb = tbPolylines; break; -//#endif case RS2::ToolBarCircles: newTb = tbCircles; break; @@ -201,12 +196,12 @@ void CadToolBar::showToolBar(int id) if (currentTb == newTb) return; - if (currentTb != NULL) + if (currentTb) currentTb->hide(); currentTb = newTb; - if (currentTb != NULL) + if (currentTb) currentTb->show(); }