XGUI_Workbench* aPage = new XGUI_Workbench(myMenuTabs);
aPage->setObjectName(theId);
myMenuTabs->addTab(aPage, aTitle);
+ myWorkbenches.append(aPage);
return aPage;
}
XGUI_Command* result;
result = myGeneralPage->feature(theId);
if (!result) {
- for (int aTabIdx = 0; aTabIdx < myMenuTabs->count(); ++aTabIdx) {
- XGUI_Workbench* aWbn = static_cast<XGUI_Workbench*>(myMenuTabs->widget(aTabIdx));
+ XGUI_Workbench* aWbn;
+ foreach (aWbn, myWorkbenches) {
result = aWbn->feature(theId);
if (result) break;
}
QList<XGUI_Command*> XGUI_MainMenu::features() const
{
QList<XGUI_Command*> aList = myGeneralPage->features();
- for (int aTabIdx = 0; aTabIdx < myMenuTabs->count(); ++aTabIdx) {
- XGUI_Workbench* aWbn = static_cast<XGUI_Workbench*>(myMenuTabs->widget(aTabIdx));
+ XGUI_Workbench* aWbn;
+ foreach (aWbn, myWorkbenches) {
aList.append(aWbn->features());
}
return aList;
XGUI_MainWindow* myDesktop;
QTabWidget* myMenuTabs;
XGUI_MenuGroupPanel* myGeneralPage;
+ QList<XGUI_Workbench*> myWorkbenches;
QMap<XGUI_Command*, bool> myCommandState;
};
void XGUI_MainWindow::showPythonConsole()
{
// TODO: Check why PyConsole can not be created
- //if (!myPythonConsole) {
- // myPythonConsole = new PyConsole_EnhConsole(this, new PyConsole_EnhInterp());
- // undockPythonConsole();
- //}
- //myPythonConsole->parentWidget()->show();
+ if (!myPythonConsole) {
+ myPythonConsole = new PyConsole_EnhConsole(this, new PyConsole_EnhInterp());
+ myPythonConsole->setObjectName("PythonConsole");
+ undockPythonConsole();
+ }
+ myPythonConsole->parentWidget()->show();
}
//******************************************************
QList<XGUI_Command*> XGUI_Workbench::features() const
{
QList<XGUI_Command*> aList;
- QList<XGUI_MenuGroupPanel*>::const_iterator aIt;
- for (aIt = myGroups.constBegin(); aIt != myGroups.constEnd(); ++aIt)
- aList.append((*aIt)->features());
+ foreach (XGUI_MenuGroupPanel* aGroup, myGroups) {
+ aList.append(aGroup->features());
+ }
return aList;
}