Gui: integrate WorkbenchManipulator
This commit is contained in:
@@ -1709,7 +1709,7 @@ void Application::setupContextMenu(const char* recipient, MenuItem* items) const
|
||||
}
|
||||
}
|
||||
}
|
||||
actWb->setupContextMenu(recipient, items);
|
||||
actWb->createContextMenu(recipient, items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#endif
|
||||
|
||||
#include "Workbench.h"
|
||||
#include "WorkbenchManipulator.h"
|
||||
#include "WorkbenchPy.h"
|
||||
#include "Action.h"
|
||||
#include "Application.h"
|
||||
@@ -313,6 +314,12 @@ void Workbench::setupCustomShortcuts() const
|
||||
// Now managed by ShortcutManager
|
||||
}
|
||||
|
||||
void Workbench::createContextMenu(const char* recipient, MenuItem* item) const
|
||||
{
|
||||
setupContextMenu(recipient, item);
|
||||
WorkbenchManipulator::changeContextMenu(recipient, item);
|
||||
}
|
||||
|
||||
void Workbench::setupContextMenu(const char* recipient,MenuItem* item) const
|
||||
{
|
||||
Q_UNUSED(recipient);
|
||||
@@ -400,6 +407,7 @@ bool Workbench::activate()
|
||||
{
|
||||
ToolBarItem* tb = setupToolBars();
|
||||
setupCustomToolbars(tb, "Toolbar");
|
||||
WorkbenchManipulator::changeToolBars(tb);
|
||||
ToolBarManager::getInstance()->setup( tb );
|
||||
delete tb;
|
||||
|
||||
@@ -409,11 +417,13 @@ bool Workbench::activate()
|
||||
//delete cb;
|
||||
|
||||
DockWindowItems* dw = setupDockWindows();
|
||||
WorkbenchManipulator::changeDockWindows(dw);
|
||||
DockWindowManager::instance()->setup( dw );
|
||||
delete dw;
|
||||
|
||||
MenuItem* mb = setupMenuBar();
|
||||
addPermanentMenuItems(mb);
|
||||
WorkbenchManipulator::changeMenuBar(mb);
|
||||
MenuManager::getInstance()->setup( mb );
|
||||
delete mb;
|
||||
|
||||
|
||||
@@ -70,9 +70,8 @@ public:
|
||||
*/
|
||||
PyObject* getPyObject() override;
|
||||
/** Sets up the contextmenu for this workbench.
|
||||
* The default implementation does nothing.
|
||||
*/
|
||||
virtual void setupContextMenu(const char* recipient,MenuItem*) const;
|
||||
void createContextMenu(const char* recipient, MenuItem*) const;
|
||||
/** Sets up the contextmenu for the main window for this workbench.
|
||||
* The default implementation does nothing.
|
||||
*/
|
||||
@@ -121,6 +120,10 @@ protected:
|
||||
virtual ToolBarItem* setupCommandBars() const=0;
|
||||
/** Returns a DockWindowItems structure of dock windows this workbench. */
|
||||
virtual DockWindowItems* setupDockWindows() const=0;
|
||||
/** Sets up the contextmenu for this workbench.
|
||||
* The default implementation does nothing.
|
||||
*/
|
||||
virtual void setupContextMenu(const char* recipient,MenuItem*) const;
|
||||
/** Add permanent menu items to the structure */
|
||||
void addPermanentMenuItems(MenuItem*) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user