[TD]dialog for Detail #4221
This commit is contained in:
585
src/Mod/TechDraw/Gui/TaskDetail.cpp
Normal file
585
src/Mod/TechDraw/Gui/TaskDetail.cpp
Normal file
@@ -0,0 +1,585 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2020 Wandererfan <wandererfan@gmail.com *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#include <QGraphicsScene>
|
||||
#include <QStatusBar>
|
||||
#endif // #ifndef _PreComp_
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <Base/Quantity.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Control.h>
|
||||
#include <Gui/Document.h>
|
||||
#include <Gui/MainWindow.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
#include <Gui/WaitCursor.h>
|
||||
|
||||
#include <Mod/TechDraw/App/DrawPage.h>
|
||||
#include <Mod/TechDraw/App/DrawUtil.h>
|
||||
#include <Mod/TechDraw/App/DrawView.h>
|
||||
#include <Mod/TechDraw/App/DrawViewPart.h>
|
||||
#include <Mod/TechDraw/App/DrawViewDetail.h>
|
||||
|
||||
#include <Mod/TechDraw/Gui/ui_TaskDetail.h>
|
||||
|
||||
#include "DrawGuiStd.h"
|
||||
#include "QGVPage.h"
|
||||
#include "QGIView.h"
|
||||
#include "QGIPrimPath.h"
|
||||
#include "QGIGhostHighlight.h"
|
||||
#include "MDIViewPage.h"
|
||||
#include "ViewProviderPage.h"
|
||||
#include "Rez.h"
|
||||
#include "QGIViewPart.h"
|
||||
|
||||
#include "TaskDetail.h"
|
||||
|
||||
using namespace TechDrawGui;
|
||||
using namespace TechDraw;
|
||||
using namespace Gui;
|
||||
|
||||
#define CREATEMODE 0
|
||||
#define EDITMODE 1
|
||||
|
||||
//creation ctor
|
||||
TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
|
||||
ui(new Ui_TaskDetail),
|
||||
m_detailFeat(nullptr),
|
||||
m_baseFeat(baseFeat),
|
||||
m_basePage(nullptr),
|
||||
m_inProgressLock(false),
|
||||
m_saveAnchor(Base::Vector3d(0.0, 0.0, 0.0)),
|
||||
m_saveRadius(0.0),
|
||||
m_baseName(std::string()),
|
||||
m_pageName(std::string()),
|
||||
m_detailName(std::string()),
|
||||
m_doc(nullptr),
|
||||
m_mode(CREATEMODE),
|
||||
m_created(false)
|
||||
{
|
||||
if (m_baseFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskDetail - bad parameters - base feature. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
m_basePage = m_baseFeat->findParentPage();
|
||||
if (m_basePage == nullptr) {
|
||||
Base::Console().Error("TaskDetail - bad parameters - base page. Can not proceed.\n");
|
||||
}
|
||||
|
||||
m_baseName = m_baseFeat->getNameInDocument();
|
||||
m_doc = m_baseFeat->getDocument();
|
||||
m_pageName = m_basePage->getNameInDocument();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
Gui::Document* activeGui = Gui::Application::Instance->getDocument(m_doc);
|
||||
Gui::ViewProvider* vp = activeGui->getViewProvider(m_basePage);
|
||||
ViewProviderPage* vpp = static_cast<ViewProviderPage*>(vp);
|
||||
m_mdi = vpp->getMDIViewPage();
|
||||
m_scene = m_mdi->m_scene;
|
||||
m_view = m_mdi->getQGVPage();
|
||||
|
||||
createDetail();
|
||||
setUiFromFeat();
|
||||
setWindowTitle(QObject::tr("New Detail"));
|
||||
|
||||
connect(ui->pbDragger, SIGNAL(clicked(bool)),
|
||||
this, SLOT(onDraggerClicked(bool)));
|
||||
connect(ui->qsbX, SIGNAL(editingFinished()),
|
||||
this, SLOT(onXEdit()));
|
||||
connect(ui->qsbY, SIGNAL(editingFinished()),
|
||||
this, SLOT(onYEdit()));
|
||||
connect(ui->qsbRadius, SIGNAL(editingFinished()),
|
||||
this, SLOT(onRadiusEdit()));
|
||||
|
||||
m_ghost = new QGIGhostHighlight();
|
||||
m_scene->addItem(m_ghost);
|
||||
m_ghost->hide();
|
||||
connect(m_ghost, SIGNAL(positionChange(QPointF)),
|
||||
this, SLOT(onHighlightMoved(QPointF)));
|
||||
}
|
||||
|
||||
//edit ctor
|
||||
TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat):
|
||||
ui(new Ui_TaskDetail),
|
||||
m_detailFeat(detailFeat),
|
||||
m_baseFeat(nullptr),
|
||||
m_basePage(nullptr),
|
||||
m_inProgressLock(false),
|
||||
m_saveAnchor(Base::Vector3d(0.0, 0.0, 0.0)),
|
||||
m_saveRadius(0.0),
|
||||
m_baseName(std::string()),
|
||||
m_pageName(std::string()),
|
||||
m_detailName(std::string()),
|
||||
m_doc(nullptr),
|
||||
m_mode(EDITMODE),
|
||||
m_created(false)
|
||||
{
|
||||
if (m_detailFeat == nullptr) {
|
||||
//should be caught in CMD caller
|
||||
Base::Console().Error("TaskDetail - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
m_doc = m_detailFeat->getDocument();
|
||||
m_detailName = m_detailFeat->getNameInDocument();
|
||||
|
||||
m_basePage = m_detailFeat->findParentPage();
|
||||
if (m_basePage != nullptr) {
|
||||
m_pageName = m_basePage->getNameInDocument();
|
||||
}
|
||||
|
||||
App::DocumentObject* baseObj = m_detailFeat->BaseView.getValue();
|
||||
m_baseFeat = dynamic_cast<TechDraw::DrawViewPart*>(baseObj);
|
||||
if (m_baseFeat != nullptr) {
|
||||
m_baseName = m_baseFeat->getNameInDocument();
|
||||
} else {
|
||||
Base::Console().Error("TaskDetail - no BaseView. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
Gui::Document* activeGui = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
Gui::ViewProvider* vp = activeGui->getViewProvider(m_basePage);
|
||||
ViewProviderPage* vpp = static_cast<ViewProviderPage*>(vp);
|
||||
m_mdi = vpp->getMDIViewPage();
|
||||
m_scene = m_mdi->m_scene;
|
||||
m_view = m_mdi->getQGVPage();
|
||||
|
||||
saveDetailState();
|
||||
setUiFromFeat();
|
||||
setWindowTitle(QObject::tr("Edit Detail"));
|
||||
|
||||
connect(ui->pbDragger, SIGNAL(clicked(bool)),
|
||||
this, SLOT(onDraggerClicked(bool)));
|
||||
connect(ui->qsbX, SIGNAL(editingFinished()),
|
||||
this, SLOT(onXEdit()));
|
||||
connect(ui->qsbY, SIGNAL(editingFinished()),
|
||||
this, SLOT(onYEdit()));
|
||||
connect(ui->qsbRadius, SIGNAL(editingFinished()),
|
||||
this, SLOT(onRadiusEdit()));
|
||||
connect(ui->aeReference, SIGNAL(editingFinished()),
|
||||
this, SLOT(onReferenceEdit()));
|
||||
|
||||
m_ghost = new QGIGhostHighlight();
|
||||
m_scene->addItem(m_ghost);
|
||||
m_ghost->hide();
|
||||
connect(m_ghost, SIGNAL(positionChange(QPointF)),
|
||||
this, SLOT(onHighlightMoved(QPointF)));
|
||||
}
|
||||
|
||||
TaskDetail::~TaskDetail()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TaskDetail::updateTask()
|
||||
{
|
||||
// blockUpdate = true;
|
||||
|
||||
// blockUpdate = false;
|
||||
}
|
||||
|
||||
void TaskDetail::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
ui->retranslateUi(this);
|
||||
}
|
||||
}
|
||||
|
||||
//save the start conditions
|
||||
void TaskDetail::saveDetailState()
|
||||
{
|
||||
// Base::Console().Message("TD::saveDetailState()\n");
|
||||
TechDraw::DrawViewDetail* dvd = getDetailFeat();
|
||||
m_saveAnchor = dvd->AnchorPoint.getValue();
|
||||
m_saveRadius = dvd->Radius.getValue();
|
||||
m_saved = true;
|
||||
}
|
||||
|
||||
void TaskDetail::restoreDetailState()
|
||||
{
|
||||
// Base::Console().Message("TD::restoreDetailState()\n");
|
||||
TechDraw::DrawViewDetail* dvd = getDetailFeat();
|
||||
dvd->AnchorPoint.setValue(m_saveAnchor);
|
||||
dvd->Radius.setValue(m_saveRadius);
|
||||
}
|
||||
|
||||
//***** ui stuff ***************************************************************
|
||||
|
||||
void TaskDetail::setUiFromFeat()
|
||||
{
|
||||
// Base::Console().Message("TD::setUIFromFeat()\n");
|
||||
if (m_baseFeat != nullptr) {
|
||||
std::string baseName = getBaseFeat()->getNameInDocument();
|
||||
ui->leBaseView->setText(Base::Tools::fromStdString(baseName));
|
||||
}
|
||||
|
||||
Base::Vector3d anchor;
|
||||
double radius;
|
||||
|
||||
TechDraw::DrawViewDetail* detailFeat = getDetailFeat();
|
||||
QString detailDisplay = QString::fromUtf8(detailFeat->getNameInDocument()) +
|
||||
QString::fromUtf8(" / ") +
|
||||
QString::fromUtf8(detailFeat->Label.getValue());
|
||||
ui->leDetailView->setText(detailDisplay);
|
||||
anchor = detailFeat->AnchorPoint.getValue();
|
||||
radius = detailFeat->Radius.getValue();
|
||||
QString ref = QString::fromUtf8(detailFeat->Reference.getValue());
|
||||
|
||||
ui->pbDragger->setText(QString::fromUtf8("Drag Highlight"));
|
||||
ui->pbDragger->setEnabled(true);
|
||||
int decimals = Base::UnitsApi::getDecimals();
|
||||
ui->qsbX->setUnit(Base::Unit::Length);
|
||||
ui->qsbX->setDecimals(decimals);
|
||||
ui->qsbY->setUnit(Base::Unit::Length);
|
||||
ui->qsbY->setDecimals(decimals);
|
||||
ui->qsbRadius->setDecimals(decimals);
|
||||
ui->qsbRadius->setUnit(Base::Unit::Length);
|
||||
ui->qsbX->setValue(anchor.x);
|
||||
ui->qsbY->setValue(anchor.y);
|
||||
ui->qsbRadius->setValue(radius);
|
||||
ui->aeReference->setText(ref);
|
||||
}
|
||||
|
||||
//update ui point fields after tracker finishes
|
||||
void TaskDetail::updateUi(QPointF p)
|
||||
{
|
||||
ui->qsbX->setValue(p.x());
|
||||
ui->qsbY->setValue(- p.y());
|
||||
}
|
||||
|
||||
void TaskDetail::enableInputFields(bool b)
|
||||
{
|
||||
ui->qsbX->setEnabled(b);
|
||||
ui->qsbY->setEnabled(b);
|
||||
ui->qsbRadius->setEnabled(b);
|
||||
ui->aeReference->setEnabled(b);
|
||||
}
|
||||
|
||||
void TaskDetail::onXEdit()
|
||||
{
|
||||
updateDetail();
|
||||
}
|
||||
|
||||
void TaskDetail::onYEdit()
|
||||
{
|
||||
updateDetail();
|
||||
}
|
||||
|
||||
void TaskDetail::onRadiusEdit()
|
||||
{
|
||||
updateDetail();
|
||||
}
|
||||
|
||||
void TaskDetail::onReferenceEdit()
|
||||
{
|
||||
updateDetail();
|
||||
}
|
||||
|
||||
void TaskDetail::onDraggerClicked(bool b)
|
||||
{
|
||||
Q_UNUSED(b);
|
||||
ui->pbDragger->setEnabled(false);
|
||||
enableInputFields(false);
|
||||
editByHighlight();
|
||||
return;
|
||||
}
|
||||
|
||||
void TaskDetail::editByHighlight()
|
||||
{
|
||||
// Base::Console().Message("TD::editByHighlight()\n");
|
||||
if (m_ghost == nullptr) {
|
||||
Base::Console().Error("TaskDetail::editByHighlight - no ghost object\n");
|
||||
return;
|
||||
}
|
||||
|
||||
m_scene->clearSelection();
|
||||
m_ghost->setSelected(true);
|
||||
m_ghost->setPos(getAnchorScene());
|
||||
m_ghost->draw();
|
||||
m_ghost->show();
|
||||
}
|
||||
|
||||
//dragEnd is in scene coords.
|
||||
void TaskDetail::onHighlightMoved(QPointF dragEnd)
|
||||
{
|
||||
// Base::Console().Message("TD::onHighlightMoved(%s) - highlight: %X\n",
|
||||
// DrawUtil::formatVector(dragEnd).c_str(), m_ghost);
|
||||
ui->pbDragger->setEnabled(true);
|
||||
|
||||
double scale = getBaseFeat()->getScale();
|
||||
double x = Rez::guiX(getBaseFeat()->X.getValue()) * scale;
|
||||
double y = Rez::guiX(getBaseFeat()->Y.getValue()) * scale;
|
||||
QPointF basePosScene(x, -y); //base position in scene coords
|
||||
|
||||
QPointF anchorDisplace = dragEnd - basePosScene;
|
||||
QPointF newAnchorPos = Rez::appX(anchorDisplace) / scale;
|
||||
|
||||
updateUi(newAnchorPos);
|
||||
updateDetail();
|
||||
enableInputFields(true);
|
||||
m_ghost->setSelected(false);
|
||||
m_ghost->hide();
|
||||
}
|
||||
|
||||
void TaskDetail::saveButtons(QPushButton* btnOK,
|
||||
QPushButton* btnCancel)
|
||||
{
|
||||
m_btnOK = btnOK;
|
||||
m_btnCancel = btnCancel;
|
||||
}
|
||||
|
||||
void TaskDetail::enableTaskButtons(bool b)
|
||||
{
|
||||
m_btnOK->setEnabled(b);
|
||||
m_btnCancel->setEnabled(b);
|
||||
}
|
||||
|
||||
//***** Feature create & edit stuff *******************************************
|
||||
void TaskDetail::createDetail()
|
||||
{
|
||||
// Base::Console().Message("TD::createDetail()\n");
|
||||
Gui::Command::openCommand("Create Detail");
|
||||
|
||||
m_detailName = m_doc->getUniqueObjectName("Detail");
|
||||
|
||||
Gui::Command::doCommand(Command::Doc,"App.activeDocument().addObject('TechDraw::DrawViewDetail','%s')",
|
||||
m_detailName.c_str());
|
||||
App::DocumentObject *docObj = m_doc->getObject(m_detailName.c_str());
|
||||
TechDraw::DrawViewDetail* dvd = dynamic_cast<TechDraw::DrawViewDetail *>(docObj);
|
||||
if (!dvd) {
|
||||
throw Base::TypeError("TaskDetail - new detail not found\n");
|
||||
}
|
||||
m_detailFeat = dvd;
|
||||
|
||||
dvd->Source.setValues(getBaseFeat()->Source.getValues());
|
||||
|
||||
Gui::Command::doCommand(Command::Doc,"App.activeDocument().%s.BaseView = App.activeDocument().%s",
|
||||
m_detailName.c_str(),m_baseName.c_str());
|
||||
Gui::Command::doCommand(Command::Doc,"App.activeDocument().%s.Direction = App.activeDocument().%s.Direction",
|
||||
m_detailName.c_str(),m_baseName.c_str());
|
||||
Gui::Command::doCommand(Command::Doc,"App.activeDocument().%s.XDirection = App.activeDocument().%s.XDirection",
|
||||
m_detailName.c_str(),m_baseName.c_str());
|
||||
Gui::Command::doCommand(Command::Doc,"App.activeDocument().%s.addView(App.activeDocument().%s)",
|
||||
m_pageName.c_str(), m_detailName.c_str());
|
||||
|
||||
Gui::Command::updateActive();
|
||||
Gui::Command::commitCommand();
|
||||
|
||||
getBaseFeat()->requestPaint();
|
||||
m_created = true;
|
||||
}
|
||||
|
||||
void TaskDetail::updateDetail()
|
||||
{
|
||||
// Base::Console().Message("TD::updateDetail()\n");
|
||||
Gui::Command::openCommand("Update Detail");
|
||||
double x = ui->qsbX->rawValue();
|
||||
double y = ui->qsbY->rawValue();
|
||||
Base::Vector3d temp(x, y, 0.0);
|
||||
TechDraw::DrawViewDetail* detailFeat = getDetailFeat();
|
||||
detailFeat->AnchorPoint.setValue(temp);
|
||||
|
||||
double radius = ui->qsbRadius->rawValue();
|
||||
detailFeat->Radius.setValue(radius);
|
||||
QString qRef = ui->aeReference->text();
|
||||
std::string ref = Base::Tools::toStdString(qRef);
|
||||
detailFeat->Reference.setValue(ref);
|
||||
|
||||
detailFeat->recomputeFeature();
|
||||
getBaseFeat()->requestPaint();
|
||||
Gui::Command::updateActive();
|
||||
Gui::Command::commitCommand();
|
||||
}
|
||||
|
||||
//***** Getters ****************************************************************
|
||||
|
||||
//get the current Anchor highlight position in scene coords
|
||||
QPointF TaskDetail::getAnchorScene()
|
||||
{
|
||||
TechDraw::DrawViewPart* dvp = getBaseFeat();
|
||||
TechDraw::DrawViewDetail* dvd = getDetailFeat();
|
||||
|
||||
Base::Vector3d anchorPos = dvd->AnchorPoint.getValue();
|
||||
double x = dvp->X.getValue();
|
||||
double y = dvp->Y.getValue();
|
||||
Base::Vector3d basePos(x, y, 0.0);
|
||||
Base::Vector3d netPos = basePos + anchorPos;
|
||||
netPos = Rez::guiX(netPos * dvp->getScale());
|
||||
|
||||
QPointF qAnchor(netPos.x, - netPos.y);
|
||||
return qAnchor;
|
||||
}
|
||||
|
||||
// protects against stale pointers
|
||||
DrawViewPart* TaskDetail::getBaseFeat()
|
||||
{
|
||||
// Base::Console().Message("TD::getBaseFeat()\n");
|
||||
DrawViewPart* result = nullptr;
|
||||
|
||||
if (m_doc != nullptr) {
|
||||
App::DocumentObject* baseObj = m_doc->getObject(m_baseName.c_str());
|
||||
if (baseObj != nullptr) {
|
||||
result = static_cast<DrawViewPart*>(baseObj);
|
||||
}
|
||||
}
|
||||
if (result == nullptr) {
|
||||
std::string msg = "TaskDetail - base feature " +
|
||||
m_baseName +
|
||||
" not found \n";
|
||||
throw Base::TypeError(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// protects against stale pointers
|
||||
DrawViewDetail* TaskDetail::getDetailFeat()
|
||||
{
|
||||
// Base::Console().Message("TD::getDetailFeat()\n");
|
||||
DrawViewDetail* result = nullptr;
|
||||
|
||||
if (m_doc != nullptr) {
|
||||
App::DocumentObject* detailObj = m_doc->getObject(m_detailName.c_str());
|
||||
if (detailObj != nullptr) {
|
||||
result = static_cast<DrawViewDetail*>(detailObj);
|
||||
}
|
||||
}
|
||||
if (result == nullptr) {
|
||||
std::string msg = "TaskDetail - detail feature " +
|
||||
m_detailName +
|
||||
" not found \n";
|
||||
// throw Base::TypeError("TaskDetail - detail feature not found\n");
|
||||
throw Base::TypeError(msg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
bool TaskDetail::accept()
|
||||
{
|
||||
// Base::Console().Message("TD::accept()\n");
|
||||
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
if (!doc) return false;
|
||||
|
||||
getDetailFeat()->requestPaint();
|
||||
getBaseFeat()->requestPaint();
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TaskDetail::reject()
|
||||
{
|
||||
// Base::Console().Message("TD::reject()\n");
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
if (!doc) return false;
|
||||
|
||||
if (m_mode == CREATEMODE) {
|
||||
if (m_created) {
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().removeObject('%s')",
|
||||
m_detailName.c_str());
|
||||
}
|
||||
} else {
|
||||
restoreDetailState();
|
||||
getDetailFeat()->recomputeFeature();
|
||||
getBaseFeat()->requestPaint();
|
||||
}
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
TaskDlgDetail::TaskDlgDetail(TechDraw::DrawViewPart* baseFeat)
|
||||
: TaskDialog()
|
||||
{
|
||||
widget = new TaskDetail(baseFeat);
|
||||
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-DetailView"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
TaskDlgDetail::TaskDlgDetail(TechDraw::DrawViewDetail* detailFeat)
|
||||
: TaskDialog()
|
||||
{
|
||||
widget = new TaskDetail(detailFeat);
|
||||
taskbox = new Gui::TaskView::TaskBox(Gui::BitmapFactory().pixmap("actions/techdraw-DetailView"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
TaskDlgDetail::~TaskDlgDetail()
|
||||
{
|
||||
}
|
||||
|
||||
void TaskDlgDetail::update()
|
||||
{
|
||||
// widget->updateTask();
|
||||
}
|
||||
|
||||
void TaskDlgDetail::modifyStandardButtons(QDialogButtonBox* box)
|
||||
{
|
||||
QPushButton* btnOK = box->button(QDialogButtonBox::Ok);
|
||||
QPushButton* btnCancel = box->button(QDialogButtonBox::Cancel);
|
||||
widget->saveButtons(btnOK, btnCancel);
|
||||
}
|
||||
|
||||
//==== calls from the TaskView ===============================================================
|
||||
void TaskDlgDetail::open()
|
||||
{
|
||||
}
|
||||
|
||||
void TaskDlgDetail::clicked(int)
|
||||
{
|
||||
}
|
||||
|
||||
bool TaskDlgDetail::accept()
|
||||
{
|
||||
widget->accept();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TaskDlgDetail::reject()
|
||||
{
|
||||
widget->reject();
|
||||
return true;
|
||||
}
|
||||
|
||||
#include <Mod/TechDraw/Gui/moc_TaskDetail.cpp>
|
||||
Reference in New Issue
Block a user