Mod/Start/Gui/Workbench.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2008 Werner Mayer <wmayer[at]users.sourceforge.net>     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
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     // web navigation toolbar
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); // hide all dock windows by default
00118     root->setVisibility("Std_CombiView",true); // except of the combi view
00119     return root;
00120 }

Generated on Wed Nov 23 19:01:11 2011 for FreeCAD by  doxygen 1.6.1