diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index d95df3122c..51decf4a19 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -280,7 +280,7 @@ set(Gui_MOC_HDRS Assistant.h AutoSaver.h CallTips.h - CombiView.h + ComboView.h Control.h Clipping.h DemoMode.h @@ -701,7 +701,7 @@ SOURCE_GROUP("Dialog\\Settings" FILES ${Dialog_Settings_SRCS}) # The dock windows sources SET(Dock_Windows_CPP_SRCS - CombiView.cpp + ComboView.cpp DockWindow.cpp PropertyView.cpp ReportView.cpp @@ -717,7 +717,7 @@ SET(Dock_Windows_CPP_SRCS DAGView/DAGFilter.cpp ) SET(Dock_Windows_HPP_SRCS - CombiView.h + ComboView.h DockWindow.h PropertyView.h ReportView.h diff --git a/src/Gui/CombiView.cpp b/src/Gui/ComboView.cpp similarity index 86% rename from src/Gui/CombiView.cpp rename to src/Gui/ComboView.cpp index 42a705cec1..3c5bfd81bf 100644 --- a/src/Gui/CombiView.cpp +++ b/src/Gui/ComboView.cpp @@ -28,7 +28,7 @@ /// Here the FreeCAD includes sorted by Base,App,Gui...... -#include "CombiView.h" +#include "ComboView.h" #include "BitmapFactory.h" #include "PropertyView.h" #include "ProjectView.h" @@ -42,12 +42,12 @@ using namespace Gui; using namespace Gui::DockWnd; -/* TRANSLATOR Gui::DockWnd::CombiView */ +/* TRANSLATOR Gui::DockWnd::ComboView */ -CombiView::CombiView(Gui::Document* pcDocument, QWidget *parent) +ComboView::ComboView(Gui::Document* pcDocument, QWidget *parent) : DockWindow(pcDocument,parent), oldTabIndex(0) { - setWindowTitle(tr("CombiView")); + setWindowTitle(tr("Combo View")); QGridLayout* pLayout = new QGridLayout(this); pLayout->setSpacing( 0 ); @@ -80,11 +80,11 @@ CombiView::CombiView(Gui::Document* pcDocument, QWidget *parent) //tabs->addTab(projectView, trUtf8("Project")); } -CombiView::~CombiView() +ComboView::~ComboView() { } -void CombiView::showDialog(Gui::TaskView::TaskDialog *dlg) +void ComboView::showDialog(Gui::TaskView::TaskDialog *dlg) { static QIcon icon = Gui::BitmapFactory().pixmap("edit-edit.svg"); @@ -96,13 +96,13 @@ void CombiView::showDialog(Gui::TaskView::TaskDialog *dlg) taskPanel->showDialog(dlg); } -void CombiView::closeDialog() +void ComboView::closeDialog() { // close the dialog taskPanel->removeDialog(); } -void CombiView::closedDialog() +void ComboView::closedDialog() { static QIcon icon = QIcon(); @@ -111,19 +111,19 @@ void CombiView::closedDialog() tabs->setTabIcon(1, icon); } -void CombiView::showTreeView() +void ComboView::showTreeView() { // switch to the tree view tabs->setCurrentIndex(0); } -void CombiView::showTaskView() +void ComboView::showTaskView() { // switch to the task view tabs->setCurrentIndex(1); } -void CombiView::changeEvent(QEvent *e) +void ComboView::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { tabs->setTabText(0, trUtf8("Model")); @@ -135,4 +135,4 @@ void CombiView::changeEvent(QEvent *e) } -#include "moc_CombiView.cpp" +#include "moc_ComboView.cpp" diff --git a/src/Gui/CombiView.h b/src/Gui/ComboView.h similarity index 90% rename from src/Gui/CombiView.h rename to src/Gui/ComboView.h index 4dc1cd70e1..632c89fc66 100644 --- a/src/Gui/CombiView.h +++ b/src/Gui/ComboView.h @@ -22,8 +22,8 @@ -#ifndef GUI_DOCKWND_COMBIVIEW_H -#define GUI_DOCKWND_COMBIVIEW_H +#ifndef GUI_DOCKWND_COMBOVIEW_H +#define GUI_DOCKWND_COMBOVIEW_H #include "DockWindow.h" #include "Selection.h" @@ -57,11 +57,11 @@ namespace Gui { class ControlSingleton; namespace DockWnd { -/** Combi View +/** Combo View * is a combination of a tree, property and TaskPanel for * integrated user action. */ -class GuiExport CombiView : public Gui::DockWindow +class GuiExport ComboView : public Gui::DockWindow { Q_OBJECT @@ -70,13 +70,13 @@ public: * A constructor. * A more elaborate description of the constructor. */ - CombiView(Gui::Document* pcDocument, QWidget *parent=0); + ComboView(Gui::Document* pcDocument, QWidget *parent=0); /** * A destructor. * A more elaborate description of the destructor. */ - virtual ~CombiView(); + virtual ~ComboView(); Gui::TaskView::TaskView *getTaskPanel(void){return taskPanel;} QTabWidget* getTabPanel() const { return tabs;} diff --git a/src/Gui/Control.cpp b/src/Gui/Control.cpp index 91c8c987fa..cf2eb9f55b 100644 --- a/src/Gui/Control.cpp +++ b/src/Gui/Control.cpp @@ -36,7 +36,7 @@ #include "TaskView/TaskView.h" #include -#include +#include #include @@ -61,11 +61,11 @@ ControlSingleton::~ControlSingleton() Gui::TaskView::TaskView* ControlSingleton::taskPanel() const { - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view - if (pcCombiView) - return pcCombiView->getTaskPanel(); + if (pcComboView) + return pcComboView->getTaskPanel(); // not all workbenches have the combo view enabled else if (_taskPanel) return _taskPanel; @@ -76,20 +76,20 @@ Gui::TaskView::TaskView* ControlSingleton::taskPanel() const void ControlSingleton::showTaskView() { - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); - if (pcCombiView) - pcCombiView->showTaskView(); + if (pcComboView) + pcComboView->showTaskView(); else if (_taskPanel) _taskPanel->raise(); } void ControlSingleton::showModelView() { - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); - if (pcCombiView) - pcCombiView->showTreeView(); + if (pcComboView) + pcComboView->showTreeView(); else if (_taskPanel) _taskPanel->raise(); } @@ -108,13 +108,13 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) } return; } - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view - if (pcCombiView) { - pcCombiView->showDialog(dlg); + if (pcComboView) { + pcComboView->showDialog(dlg); // make sure that the combo view is shown - QDockWidget* dw = qobject_cast(pcCombiView->parentWidget()); + QDockWidget* dw = qobject_cast(pcComboView->parentWidget()); if (dw) { dw->setVisible(true); dw->toggleViewAction()->setVisible(true); @@ -151,11 +151,11 @@ void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg) QTabWidget* ControlSingleton::tabPanel() const { - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view - if (pcCombiView) - return pcCombiView->getTabPanel(); + if (pcComboView) + return pcComboView->getTabPanel(); return 0; } @@ -167,10 +167,10 @@ Gui::TaskView::TaskDialog* ControlSingleton::activeDialog() const Gui::TaskView::TaskView* ControlSingleton::getTaskPanel() { // should return the pointer to combo view - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); - if (pcCombiView) - return pcCombiView->getTaskPanel(); + if (pcComboView) + return pcComboView->getTaskPanel(); else return _taskPanel; } @@ -197,11 +197,11 @@ void ControlSingleton::reject() void ControlSingleton::closeDialog() { - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view - if (pcCombiView) - pcCombiView->closeDialog(); + if (pcComboView) + pcComboView->closeDialog(); else if (_taskPanel) _taskPanel->removeDialog(); } @@ -209,13 +209,13 @@ void ControlSingleton::closeDialog() void ControlSingleton::closedDialog() { ActiveDialog = 0; - Gui::DockWnd::CombiView* pcCombiView = qobject_cast + Gui::DockWnd::ComboView* pcComboView = qobject_cast (Gui::DockWindowManager::instance()->getDockWindow("Combo View")); // should return the pointer to combo view - assert(pcCombiView); - pcCombiView->closedDialog(); + assert(pcComboView); + pcComboView->closedDialog(); // make sure that the combo view is shown - QDockWidget* dw = qobject_cast(pcCombiView->parentWidget()); + QDockWidget* dw = qobject_cast(pcComboView->parentWidget()); if (dw) dw->setFeatures(QDockWidget::AllDockWidgetFeatures); } diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index 4548ac8901..1ddc4ef5c4 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -257,7 +257,7 @@ void DockWindowManager::retranslate() * \li Std_PropertyView * \li Std_ReportView * \li Std_ToolBox - * \li Std_CombiView + * \li Std_ComboView * \li Std_SelectionView * * To avoid name clashes the caller should use names of the form \a module_widgettype, i. e. if a analyse dialog for diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index be027982eb..d33731001b 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -99,7 +99,7 @@ #include "MenuManager.h" //#include "ToolBox.h" #include "ReportView.h" -#include "CombiView.h" +#include "ComboView.h" #include "PythonConsole.h" #include "TaskView/TaskView.h" #include "DAGView/DAGView.h" @@ -387,7 +387,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DockWindows")->GetGroup("TreeView"); bool enabled = group->GetBool("Enabled", true); - if(enabled != group->GetBool("Enabled", false)) { + if (enabled != group->GetBool("Enabled", false)) { enabled = App::GetApplication().GetUserParameter().GetGroup("BaseApp") ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_TreeView",false); } @@ -408,7 +408,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DockWindows")->GetGroup("PropertyView"); bool enabled = group->GetBool("Enabled", true); - if(enabled != group->GetBool("Enabled", false)) { + if (enabled != group->GetBool("Enabled", false)) { enabled = App::GetApplication().GetUserParameter().GetGroup("BaseApp") ->GetGroup("MainWindow")->GetGroup("DockWindows")->GetBool("Std_PropertyView",false); } @@ -433,18 +433,19 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) } // Combo view - if (hiddenDockWindows.find("Std_CombiView") == std::string::npos) { + if (hiddenDockWindows.find("Std_ComboView") == std::string::npos) { bool enable = !treeView || !propertyView; - if(!enable) { + if (!enable) { ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DockWindows")->GetGroup("ComboView"); enable = group->GetBool("Enabled", true); } - if(enable) { - CombiView* pcCombiView = new CombiView(0, this); - pcCombiView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Combo View"))); - pcCombiView->setMinimumWidth(150); - pDockMgr->registerDockWindow("Std_CombiView", pcCombiView); + + if (enable) { + ComboView* pcComboView = new ComboView(0, this); + pcComboView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Combo View"))); + pcComboView->setMinimumWidth(150); + pDockMgr->registerDockWindow("Std_ComboView", pcComboView); } } diff --git a/src/Gui/TaskView/TaskView.h b/src/Gui/TaskView/TaskView.h index e1678c90f7..20463eee64 100644 --- a/src/Gui/TaskView/TaskView.h +++ b/src/Gui/TaskView/TaskView.h @@ -47,7 +47,7 @@ class Property; namespace Gui { class ControlSingleton; namespace DockWnd{ -class CombiView; +class ComboView; } namespace TaskView { @@ -180,7 +180,7 @@ public: virtual void OnChange(Gui::SelectionSingleton::SubjectType &rCaller, Gui::SelectionSingleton::MessageType Reason); - friend class Gui::DockWnd::CombiView; + friend class Gui::DockWnd::ComboView; friend class Gui::ControlSingleton; void addTaskWatcher(const std::vector &Watcher); diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 513ecef5c2..2a778b9d6a 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -41,7 +41,7 @@ #include "Window.h" #include "Selection.h" #include "MainWindow.h" -#include +#include #include #include @@ -704,7 +704,7 @@ DockWindowItems* StdWorkbench::setupDockWindows() const root->addDockWidget("Std_TreeView", Qt::LeftDockWidgetArea, true, false); root->addDockWidget("Std_PropertyView", Qt::LeftDockWidgetArea, true, false); root->addDockWidget("Std_SelectionView", Qt::LeftDockWidgetArea, false, false); - root->addDockWidget("Std_CombiView", Qt::LeftDockWidgetArea, false, false); + root->addDockWidget("Std_ComboView", Qt::LeftDockWidgetArea, false, false); root->addDockWidget("Std_ReportView", Qt::BottomDockWidgetArea, true, true); root->addDockWidget("Std_PythonView", Qt::BottomDockWidgetArea, true, true); diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index 2851329ce1..41baf3deaf 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -168,6 +168,6 @@ Gui::DockWindowItems* StartGui::Workbench::setupDockWindows() const { Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows(); root->setVisibility(false); // hide all dock windows by default - root->setVisibility("Std_CombiView",true); // except of the combi view + root->setVisibility("Std_ComboView",true); // except of the combo view return root; } diff --git a/src/Mod/Web/Gui/Workbench.cpp b/src/Mod/Web/Gui/Workbench.cpp index aa54f2e176..950549f897 100644 --- a/src/Mod/Web/Gui/Workbench.cpp +++ b/src/Mod/Web/Gui/Workbench.cpp @@ -351,6 +351,6 @@ Gui::DockWindowItems* Workbench::setupDockWindows() const { Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows(); //root->setVisibility(false); // hide all dock windows by default - //root->setVisibility("Std_CombiView",true); // except of the combi view + //root->setVisibility("Std_ComboView",true); // except of the combo view return root; }