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)
|
||||
{
|
||||
if (getMainWindow()->activeWindow()) {
|
||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Printing..."));
|
||||
getMainWindow()->showMessage(QObject::tr("Printing..."));
|
||||
getMainWindow()->activeWindow()->print();
|
||||
}
|
||||
}
|
||||
|
@ -670,7 +670,7 @@ StdCmdPrintPdf::StdCmdPrintPdf()
|
|||
void StdCmdPrintPdf::activated(int iMsg)
|
||||
{
|
||||
if (getMainWindow()->activeWindow()) {
|
||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Exporting PDF..."));
|
||||
getMainWindow()->showMessage(QObject::tr("Exporting PDF..."));
|
||||
getMainWindow()->activeWindow()->printPdf();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -508,7 +508,7 @@ bool Document::save(void)
|
|||
/// Save the document under a new file name
|
||||
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 fn = QFileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe),
|
||||
|
@ -554,7 +554,7 @@ bool Document::saveAs(void)
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
getMainWindow()->statusBar()->showMessage(QObject::tr("Saving aborted"), 2000);
|
||||
getMainWindow()->showMessage(QObject::tr("Saving aborted"), 2000);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -734,7 +734,7 @@ void MainWindow::addWindow(MDIView* view)
|
|||
#endif
|
||||
#endif
|
||||
connect(view, SIGNAL(message(const QString&, int)),
|
||||
statusBar(), SLOT(showMessage(const QString&, int)));
|
||||
this, SLOT(showMessage(const QString&, int)));
|
||||
connect(this, SIGNAL(windowStateChanged(MDIView*)),
|
||||
view, SLOT(windowStateChanged(MDIView*)));
|
||||
|
||||
|
@ -799,7 +799,7 @@ void MainWindow::removeWindow(Gui::MDIView* view)
|
|||
{
|
||||
// free all connections
|
||||
disconnect(view, SIGNAL(message(const QString&, int)),
|
||||
statusBar(), SLOT(message(const QString&, int )));
|
||||
this, SLOT(showMessage(const QString&, int )));
|
||||
disconnect(this, SIGNAL(windowStateChanged(MDIView*)),
|
||||
view, SLOT(windowStateChanged(MDIView*)));
|
||||
view->removeEventFilter(this);
|
||||
|
@ -1552,7 +1552,16 @@ void MainWindow::showMessage (const QString& message, int timeout)
|
|||
{
|
||||
QFontMetrics fm(statusBar()->font());
|
||||
QString msg = fm.elidedText(message, Qt::ElideMiddle, this->width()/2);
|
||||
#if QT_VERSION != 0x040801
|
||||
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.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(1)->setEditingCursor(QCursor(Qt::PointingHandCursor));
|
||||
|
@ -838,7 +838,7 @@ void ManualAlignment::finish()
|
|||
closeViewer();
|
||||
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
|
||||
emitFinished();
|
||||
|
@ -856,7 +856,7 @@ void ManualAlignment::cancel()
|
|||
myTransform = Base::Placement();
|
||||
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
|
||||
emitCanceled();
|
||||
|
@ -888,7 +888,7 @@ void ManualAlignment::align()
|
|||
myAlignModel.activeGroup().removeFromViewer(myViewer->getViewer(0));
|
||||
myAlignModel.activeGroup().setAlignable(false);
|
||||
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
|
||||
bool ok = computeAlignment(myAlignModel.activeGroup().getPoints(), myFixedGroup.getPoints());
|
||||
|
@ -928,17 +928,17 @@ void ManualAlignment::showInstructions()
|
|||
{
|
||||
// Now we can start the actual alignment
|
||||
if (myAlignModel.activeGroup().countPoints() < myPickPoints) {
|
||||
Gui::getMainWindow()->statusBar()->showMessage(
|
||||
Gui::getMainWindow()->showMessage(
|
||||
tr("Too few points picked in the left view."
|
||||
" At least %1 points are needed.").arg(myPickPoints));
|
||||
}
|
||||
else if (myFixedGroup.countPoints() < myPickPoints) {
|
||||
Gui::getMainWindow()->statusBar()->showMessage(
|
||||
Gui::getMainWindow()->showMessage(
|
||||
tr("Too few points picked in the right view."
|
||||
" At least %1 points are needed.").arg(myPickPoints));
|
||||
}
|
||||
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. "
|
||||
"On the left view %1 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);
|
||||
|
||||
const SbVec3f& vec = point->getPoint();
|
||||
Gui::getMainWindow()->statusBar()->showMessage(
|
||||
Gui::getMainWindow()->showMessage(
|
||||
tr("Point picked at (%1,%2,%3)")
|
||||
.arg(vec[0]).arg(vec[1]).arg(vec[2]));
|
||||
}
|
||||
}
|
||||
else {
|
||||
Gui::getMainWindow()->statusBar()->showMessage(
|
||||
Gui::getMainWindow()->showMessage(
|
||||
tr("No point was picked"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,7 +252,7 @@ void Sequencer::showRemainingTime()
|
|||
Q_ARG(QString,status));
|
||||
}
|
||||
else {
|
||||
getMainWindow()->statusBar()->showMessage(status);
|
||||
getMainWindow()->showMessage(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ void Sequencer::resetData()
|
|||
d->waitCursor = 0;
|
||||
d->bar->leaveControlEvents();
|
||||
getMainWindow()->setPaneText(1, QString());
|
||||
getMainWindow()->statusBar()->showMessage(QString());
|
||||
getMainWindow()->showMessage(QString());
|
||||
}
|
||||
|
||||
SequencerBase::resetData();
|
||||
|
@ -313,7 +313,7 @@ void Sequencer::setText (const char* pszTxt)
|
|||
Q_ARG(QString,d->text));
|
||||
}
|
||||
else {
|
||||
getMainWindow()->statusBar()->showMessage(d->text);
|
||||
getMainWindow()->showMessage(d->text);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -568,7 +568,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action)
|
|||
,pp->getPoint()[1]
|
||||
,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()[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());
|
||||
if ( Obj->mustExecute() == 1 )
|
||||
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()[2]);
|
||||
|
||||
getMainWindow()->statusBar()->showMessage(QString::fromAscii(buf),3000);
|
||||
getMainWindow()->showMessage(QString::fromAscii(buf),3000);
|
||||
}
|
||||
return pp->getPath();
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ void BrowserView::onLoadStarted()
|
|||
QProgressBar* bar = Gui::Sequencer::instance()->getProgressBar();
|
||||
bar->setRange(0, 100);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ void BrowserView::onLoadFinished(bool ok)
|
|||
QProgressBar* bar = Sequencer::instance()->getProgressBar();
|
||||
bar->setValue(100);
|
||||
bar->hide();
|
||||
getMainWindow()->statusBar()->showMessage(QString());
|
||||
getMainWindow()->showMessage(QString());
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user