0000665: Follow up 0000640: This file crashes FreeCAD UI latest Git
This commit is contained in:
parent
aa72516fbe
commit
58da2ebbcc
|
@ -615,7 +615,7 @@ StdCmdPrint::StdCmdPrint()
|
||||||
void StdCmdPrint::activated(int iMsg)
|
void StdCmdPrint::activated(int iMsg)
|
||||||
{
|
{
|
||||||
if (getMainWindow()->activeWindow()) {
|
if (getMainWindow()->activeWindow()) {
|
||||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Printing..."));
|
getMainWindow()->showMessage(QObject::tr("Printing..."));
|
||||||
getMainWindow()->activeWindow()->print();
|
getMainWindow()->activeWindow()->print();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ StdCmdPrintPdf::StdCmdPrintPdf()
|
||||||
void StdCmdPrintPdf::activated(int iMsg)
|
void StdCmdPrintPdf::activated(int iMsg)
|
||||||
{
|
{
|
||||||
if (getMainWindow()->activeWindow()) {
|
if (getMainWindow()->activeWindow()) {
|
||||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Exporting PDF..."));
|
getMainWindow()->showMessage(QObject::tr("Exporting PDF..."));
|
||||||
getMainWindow()->activeWindow()->printPdf();
|
getMainWindow()->activeWindow()->printPdf();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -508,7 +508,7 @@ bool Document::save(void)
|
||||||
/// Save the document under a new file name
|
/// Save the document under a new file name
|
||||||
bool Document::saveAs(void)
|
bool Document::saveAs(void)
|
||||||
{
|
{
|
||||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Save document under new filename..."));
|
getMainWindow()->showMessage(QObject::tr("Save document under new filename..."));
|
||||||
|
|
||||||
QString exe = qApp->applicationName();
|
QString exe = qApp->applicationName();
|
||||||
QString fn = QFileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe),
|
QString fn = QFileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe),
|
||||||
|
@ -554,7 +554,7 @@ bool Document::saveAs(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Saving aborted"), 2000);
|
getMainWindow()->showMessage(QObject::tr("Saving aborted"), 2000);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,7 +734,7 @@ void MainWindow::addWindow(MDIView* view)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
connect(view, SIGNAL(message(const QString&, int)),
|
connect(view, SIGNAL(message(const QString&, int)),
|
||||||
statusBar(), SLOT(showMessage(const QString&, int)));
|
this, SLOT(showMessage(const QString&, int)));
|
||||||
connect(this, SIGNAL(windowStateChanged(MDIView*)),
|
connect(this, SIGNAL(windowStateChanged(MDIView*)),
|
||||||
view, SLOT(windowStateChanged(MDIView*)));
|
view, SLOT(windowStateChanged(MDIView*)));
|
||||||
|
|
||||||
|
@ -799,7 +799,7 @@ void MainWindow::removeWindow(Gui::MDIView* view)
|
||||||
{
|
{
|
||||||
// free all connections
|
// free all connections
|
||||||
disconnect(view, SIGNAL(message(const QString&, int)),
|
disconnect(view, SIGNAL(message(const QString&, int)),
|
||||||
statusBar(), SLOT(message(const QString&, int )));
|
this, SLOT(showMessage(const QString&, int )));
|
||||||
disconnect(this, SIGNAL(windowStateChanged(MDIView*)),
|
disconnect(this, SIGNAL(windowStateChanged(MDIView*)),
|
||||||
view, SLOT(windowStateChanged(MDIView*)));
|
view, SLOT(windowStateChanged(MDIView*)));
|
||||||
view->removeEventFilter(this);
|
view->removeEventFilter(this);
|
||||||
|
@ -1552,7 +1552,16 @@ void MainWindow::showMessage (const QString& message, int timeout)
|
||||||
{
|
{
|
||||||
QFontMetrics fm(statusBar()->font());
|
QFontMetrics fm(statusBar()->font());
|
||||||
QString msg = fm.elidedText(message, Qt::ElideMiddle, this->width()/2);
|
QString msg = fm.elidedText(message, Qt::ElideMiddle, this->width()/2);
|
||||||
|
#if QT_VERSION != 0x040801
|
||||||
this->statusBar()->showMessage(msg, timeout);
|
this->statusBar()->showMessage(msg, timeout);
|
||||||
|
#else
|
||||||
|
//#0000665: There is a crash under Ubuntu 12.04 (Qt 4.8.1)
|
||||||
|
QMetaObject::invokeMethod(statusBar(), "showMessage",
|
||||||
|
Qt::QueuedConnection,
|
||||||
|
QGenericReturnArgument(),
|
||||||
|
Q_ARG(QString,msg),
|
||||||
|
Q_ARG(int, timeout));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
|
|
|
@ -778,7 +778,7 @@ void ManualAlignment::continueAlignment()
|
||||||
grp.addToViewer(myViewer->getViewer(0));
|
grp.addToViewer(myViewer->getViewer(0));
|
||||||
grp.setAlignable(true);
|
grp.setAlignable(true);
|
||||||
|
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(tr("Please pick points in the left and right view"));
|
Gui::getMainWindow()->showMessage(tr("Please pick points in the left and right view"));
|
||||||
|
|
||||||
myViewer->getViewer(0)->setEditingCursor(QCursor(Qt::PointingHandCursor));
|
myViewer->getViewer(0)->setEditingCursor(QCursor(Qt::PointingHandCursor));
|
||||||
myViewer->getViewer(1)->setEditingCursor(QCursor(Qt::PointingHandCursor));
|
myViewer->getViewer(1)->setEditingCursor(QCursor(Qt::PointingHandCursor));
|
||||||
|
@ -838,7 +838,7 @@ void ManualAlignment::finish()
|
||||||
closeViewer();
|
closeViewer();
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(tr("The alignment has finished"));
|
Gui::getMainWindow()->showMessage(tr("The alignment has finished"));
|
||||||
|
|
||||||
// If an event receiver has been defined send the manual alignment finished event to it
|
// If an event receiver has been defined send the manual alignment finished event to it
|
||||||
emitFinished();
|
emitFinished();
|
||||||
|
@ -856,7 +856,7 @@ void ManualAlignment::cancel()
|
||||||
myTransform = Base::Placement();
|
myTransform = Base::Placement();
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(tr("The alignment has been canceled"));
|
Gui::getMainWindow()->showMessage(tr("The alignment has been canceled"));
|
||||||
|
|
||||||
// If an event receiver has been defined send the manual alignment cancelled event to it
|
// If an event receiver has been defined send the manual alignment cancelled event to it
|
||||||
emitCanceled();
|
emitCanceled();
|
||||||
|
@ -888,7 +888,7 @@ void ManualAlignment::align()
|
||||||
myAlignModel.activeGroup().removeFromViewer(myViewer->getViewer(0));
|
myAlignModel.activeGroup().removeFromViewer(myViewer->getViewer(0));
|
||||||
myAlignModel.activeGroup().setAlignable(false);
|
myAlignModel.activeGroup().setAlignable(false);
|
||||||
std::vector<App::DocumentObject*> pViews = myAlignModel.activeGroup().getViews();
|
std::vector<App::DocumentObject*> pViews = myAlignModel.activeGroup().getViews();
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(tr("Try to align group of views"));
|
Gui::getMainWindow()->showMessage(tr("Try to align group of views"));
|
||||||
|
|
||||||
// Compute alignment
|
// Compute alignment
|
||||||
bool ok = computeAlignment(myAlignModel.activeGroup().getPoints(), myFixedGroup.getPoints());
|
bool ok = computeAlignment(myAlignModel.activeGroup().getPoints(), myFixedGroup.getPoints());
|
||||||
|
@ -928,17 +928,17 @@ void ManualAlignment::showInstructions()
|
||||||
{
|
{
|
||||||
// Now we can start the actual alignment
|
// Now we can start the actual alignment
|
||||||
if (myAlignModel.activeGroup().countPoints() < myPickPoints) {
|
if (myAlignModel.activeGroup().countPoints() < myPickPoints) {
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(
|
Gui::getMainWindow()->showMessage(
|
||||||
tr("Too few points picked in the left view."
|
tr("Too few points picked in the left view."
|
||||||
" At least %1 points are needed.").arg(myPickPoints));
|
" At least %1 points are needed.").arg(myPickPoints));
|
||||||
}
|
}
|
||||||
else if (myFixedGroup.countPoints() < myPickPoints) {
|
else if (myFixedGroup.countPoints() < myPickPoints) {
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(
|
Gui::getMainWindow()->showMessage(
|
||||||
tr("Too few points picked in the right view."
|
tr("Too few points picked in the right view."
|
||||||
" At least %1 points are needed.").arg(myPickPoints));
|
" At least %1 points are needed.").arg(myPickPoints));
|
||||||
}
|
}
|
||||||
else if (myAlignModel.activeGroup().countPoints() != myFixedGroup.countPoints()) {
|
else if (myAlignModel.activeGroup().countPoints() != myFixedGroup.countPoints()) {
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(
|
Gui::getMainWindow()->showMessage(
|
||||||
tr("Different number of points picked in left and right view. "
|
tr("Different number of points picked in left and right view. "
|
||||||
"On the left view %1 points are picked, "
|
"On the left view %1 points are picked, "
|
||||||
"on the right view %2 points are picked.")
|
"on the right view %2 points are picked.")
|
||||||
|
@ -1146,13 +1146,13 @@ void ManualAlignment::probePickedCallback(void * ud, SoEventCallback * n)
|
||||||
self->applyPickedProbe(that, point);
|
self->applyPickedProbe(that, point);
|
||||||
|
|
||||||
const SbVec3f& vec = point->getPoint();
|
const SbVec3f& vec = point->getPoint();
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(
|
Gui::getMainWindow()->showMessage(
|
||||||
tr("Point picked at (%1,%2,%3)")
|
tr("Point picked at (%1,%2,%3)")
|
||||||
.arg(vec[0]).arg(vec[1]).arg(vec[2]));
|
.arg(vec[0]).arg(vec[1]).arg(vec[2]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(
|
Gui::getMainWindow()->showMessage(
|
||||||
tr("No point was picked"));
|
tr("No point was picked"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@ void Sequencer::showRemainingTime()
|
||||||
Q_ARG(QString,status));
|
Q_ARG(QString,status));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
getMainWindow()->statusBar()->showMessage(status);
|
getMainWindow()->showMessage(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ void Sequencer::resetData()
|
||||||
d->waitCursor = 0;
|
d->waitCursor = 0;
|
||||||
d->bar->leaveControlEvents();
|
d->bar->leaveControlEvents();
|
||||||
getMainWindow()->setPaneText(1, QString());
|
getMainWindow()->setPaneText(1, QString());
|
||||||
getMainWindow()->statusBar()->showMessage(QString());
|
getMainWindow()->showMessage(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
SequencerBase::resetData();
|
SequencerBase::resetData();
|
||||||
|
@ -313,7 +313,7 @@ void Sequencer::setText (const char* pszTxt)
|
||||||
Q_ARG(QString,d->text));
|
Q_ARG(QString,d->text));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
getMainWindow()->statusBar()->showMessage(d->text);
|
getMainWindow()->showMessage(d->text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -568,7 +568,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
,pp->getPoint()[1]
|
,pp->getPoint()[1]
|
||||||
,pp->getPoint()[2]);
|
,pp->getPoint()[2]);
|
||||||
|
|
||||||
getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000);
|
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -602,7 +602,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
||||||
,pp->getPoint()[1]
|
,pp->getPoint()[1]
|
||||||
,pp->getPoint()[2]);
|
,pp->getPoint()[2]);
|
||||||
|
|
||||||
getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000);
|
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1201,7 +1201,7 @@ void DocumentObjectItem::displayStatusInfo()
|
||||||
QString info = QString::fromAscii(Obj->getStatusString());
|
QString info = QString::fromAscii(Obj->getStatusString());
|
||||||
if ( Obj->mustExecute() == 1 )
|
if ( Obj->mustExecute() == 1 )
|
||||||
info += QString::fromAscii(" (but must be executed)");
|
info += QString::fromAscii(" (but must be executed)");
|
||||||
getMainWindow()->statusBar()->showMessage( info );
|
getMainWindow()->showMessage( info );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2081,7 +2081,7 @@ SoPath * View3DInventorViewer::pickFilterCB(void *viewer, const SoPickedPoint *
|
||||||
,pp->getPoint()[1]
|
,pp->getPoint()[1]
|
||||||
,pp->getPoint()[2]);
|
,pp->getPoint()[2]);
|
||||||
|
|
||||||
getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000);
|
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
|
||||||
}
|
}
|
||||||
return pp->getPath();
|
return pp->getPath();
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ void BrowserView::onLoadStarted()
|
||||||
QProgressBar* bar = Gui::Sequencer::instance()->getProgressBar();
|
QProgressBar* bar = Gui::Sequencer::instance()->getProgressBar();
|
||||||
bar->setRange(0, 100);
|
bar->setRange(0, 100);
|
||||||
bar->show();
|
bar->show();
|
||||||
Gui::getMainWindow()->statusBar()->showMessage(tr("Loading %1...").arg(view->url().toString()));
|
Gui::getMainWindow()->showMessage(tr("Loading %1...").arg(view->url().toString()));
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ void BrowserView::onLoadFinished(bool ok)
|
||||||
QProgressBar* bar = Sequencer::instance()->getProgressBar();
|
QProgressBar* bar = Sequencer::instance()->getProgressBar();
|
||||||
bar->setValue(100);
|
bar->setValue(100);
|
||||||
bar->hide();
|
bar->hide();
|
||||||
getMainWindow()->statusBar()->showMessage(QString());
|
getMainWindow()->showMessage(QString());
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user