+ fixes #0001876: replace helpful text in task tab with an info button

This commit is contained in:
wmayer 2014-12-29 18:49:17 +01:00
parent d83c02387c
commit 84aad261fc
3 changed files with 26 additions and 20 deletions

View File

@ -24,9 +24,11 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QApplication>
# include <QEventLoop>
# include <QMessageBox>
# include <QTextStream>
# include <QTimer>
# include <BRepBuilderAPI_MakeWire.hxx>
# include <Precision.hxx>
# include <ShapeAnalysis_FreeBounds.hxx>
@ -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()

View File

@ -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;
};

View File

@ -15,27 +15,16 @@
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="text">
<string>Select one or more profiles and select an edge or wire
in the 3D view for the sweep path.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="Gui::ActionSelector" name="selector"/>
</item>
<item row="2" column="0">
<item row="1" column="0">
<widget class="QPushButton" name="buttonPath">
<property name="text">
<string>Sweep Path</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<item row="1" column="1" colspan="2">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -48,28 +37,28 @@ in the 3D view for the sweep path.</string>
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="labelPath">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QCheckBox" name="checkSolid">
<property name="text">
<string>Create solid</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="3" column="1">
<widget class="QCheckBox" name="checkFrenet">
<property name="text">
<string>Frenet</string>
</property>
</widget>
</item>
<item row="4" column="2">
<item row="3" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>