From 84aad261fc4822febfb7ebe9f733ce77c65c377b Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 29 Dec 2014 18:49:17 +0100 Subject: [PATCH] + fixes #0001876: replace helpful text in task tab with an info button --- src/Mod/Part/Gui/TaskSweep.cpp | 19 +++++++++++++++++-- src/Mod/Part/Gui/TaskSweep.h | 4 +++- src/Mod/Part/Gui/TaskSweep.ui | 23 ++++++----------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/Mod/Part/Gui/TaskSweep.cpp b/src/Mod/Part/Gui/TaskSweep.cpp index 6326f5517..6cc8bea51 100644 --- a/src/Mod/Part/Gui/TaskSweep.cpp +++ b/src/Mod/Part/Gui/TaskSweep.cpp @@ -24,9 +24,11 @@ #include "PreCompiled.h" #ifndef _PreComp_ +# include # include # include # include +# include # include # include # include @@ -417,7 +419,7 @@ void SweepWidget::changeEvent(QEvent *e) /* TRANSLATOR PartGui::TaskSweep */ -TaskSweep::TaskSweep() +TaskSweep::TaskSweep() : label(0) { widget = new SweepWidget(); taskbox = new Gui::TaskView::TaskBox( @@ -429,14 +431,27 @@ TaskSweep::TaskSweep() TaskSweep::~TaskSweep() { + delete label; } void TaskSweep::open() { } -void TaskSweep::clicked(int) +void TaskSweep::clicked(int id) { + if (id == QDialogButtonBox::Help) { + QString help = QApplication::translate("PartGui::TaskSweep", + "Select one or more profiles and select an edge or wire\n" + "in the 3D view for the sweep path."); + if (!label) { + label = new Gui::StatusWidget(widget); + label->setStatusText(help); + } + + label->show(); + QTimer::singleShot(3000, label, SLOT(hide())); + } } bool TaskSweep::accept() diff --git a/src/Mod/Part/Gui/TaskSweep.h b/src/Mod/Part/Gui/TaskSweep.h index 4560ba363..97f68e9ae 100644 --- a/src/Mod/Part/Gui/TaskSweep.h +++ b/src/Mod/Part/Gui/TaskSweep.h @@ -31,6 +31,7 @@ class QTreeWidgetItem; namespace Gui { class SelectionObject; +class StatusWidget; } namespace PartGui { @@ -74,10 +75,11 @@ public: void clicked(int); QDialogButtonBox::StandardButtons getStandardButtons() const - { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; } + { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help; } private: SweepWidget* widget; + Gui::StatusWidget* label; Gui::TaskView::TaskBox* taskbox; }; diff --git a/src/Mod/Part/Gui/TaskSweep.ui b/src/Mod/Part/Gui/TaskSweep.ui index fc650cc8b..0ce3b7c2e 100644 --- a/src/Mod/Part/Gui/TaskSweep.ui +++ b/src/Mod/Part/Gui/TaskSweep.ui @@ -15,27 +15,16 @@ - - - Select one or more profiles and select an edge or wire -in the 3D view for the sweep path. - - - true - - - - - + Sweep Path - + Qt::Horizontal @@ -48,28 +37,28 @@ in the 3D view for the sweep path. - + TextLabel - + Create solid - + Frenet - + Qt::Horizontal