Mod/Start/Gui/Workbench.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "PreCompiled.h"
00025
00026 #ifndef _PreComp_
00027 # include <qobject.h>
00028 #endif
00029
00030 #include "Workbench.h"
00031 #include <Gui/ToolBarManager.h>
00032 #include <Gui/MenuManager.h>
00033 #include <Gui/ToolBarManager.h>
00034 #include <Gui/DockWindowManager.h>
00035 #include <Gui/Application.h>
00036 #include <Gui/Action.h>
00037 #include <Gui/Command.h>
00038 #include <Gui/Selection.h>
00039 #include <Gui/ToolBoxManager.h>
00040 #include <App/Document.h>
00041 #include <App/DocumentObject.h>
00042 #include <Base/Console.h>
00043 #include <Base/Exception.h>
00044
00045 #include <Mod/Start/App/StartConfiguration.h>
00046
00047 using namespace StartGui;
00048
00049 TYPESYSTEM_SOURCE(StartGui::Workbench, Gui::StdWorkbench)
00050
00051 StartGui::Workbench::Workbench()
00052 {
00053 }
00054
00055 StartGui::Workbench::~Workbench()
00056 {
00057 }
00058
00059 void StartGui::Workbench::activated()
00060 {
00061 try {
00062 Gui::Command::doCommand(Gui::Command::Gui,"import WebGui");
00063 Gui::Command::doCommand(Gui::Command::Gui,"from StartPage import StartPage");
00064 #if defined(FC_OS_WIN32)
00065 Gui::Command::doCommand(Gui::Command::Gui,"WebGui.openBrowserHTML"
00066 "(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','Start page')");
00067 #else
00068 Gui::Command::doCommand(Gui::Command::Gui,"WebGui.openBrowserHTML"
00069 "(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','Start page')");
00070 #endif
00071 }
00072 catch (const Base::Exception& e) {
00073 Base::Console().Error("%s\n", e.what());
00074 }
00075 }
00076
00077 void StartGui::Workbench::setupContextMenu(const char* recipient,Gui::MenuItem* item) const
00078 {
00079
00080 }
00081
00082 Gui::MenuItem* StartGui::Workbench::setupMenuBar() const
00083 {
00084 return Gui::StdWorkbench::setupMenuBar();
00085 }
00086
00087 Gui::ToolBarItem* StartGui::Workbench::setupToolBars() const
00088 {
00089 Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
00090
00091
00092 Gui::ToolBarItem* navigation = new Gui::ToolBarItem(root);
00093 navigation->setCommand("Navigation");
00094 *navigation << "Web_OpenWebsite"
00095 << "Separator"
00096 << "Web_BrowserBack"
00097 << "Web_BrowserNext"
00098 << "Web_BrowserRefresh"
00099 << "Web_BrowserStop"
00100 << "Separator"
00101 << "Web_BrowserZoomIn"
00102 << "Web_BrowserZoomOut";
00103
00104 return root;
00105
00106 }
00107
00108 Gui::ToolBarItem* StartGui::Workbench::setupCommandBars() const
00109 {
00110 Gui::ToolBarItem* root = new Gui::ToolBarItem;
00111 return root;
00112 }
00113
00114 Gui::DockWindowItems* StartGui::Workbench::setupDockWindows() const
00115 {
00116 Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows();
00117 root->setVisibility(false);
00118 root->setVisibility("Std_CombiView",true);
00119 return root;
00120 }