* ./hurricane/src/hviewer :
- Change: BreakpointWidget is no longer modal, need to replace the ::exec() by a custom made one.
This commit is contained in:
parent
3d486767eb
commit
e507335c01
|
@ -23,6 +23,7 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
|
@ -37,11 +38,12 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
BreakpointWidget::BreakpointWidget ( QWidget* parent )
|
BreakpointWidget::BreakpointWidget ( QWidget* parent )
|
||||||
: QDialog (parent)
|
: QDialog (parent)
|
||||||
, _message (new QLabel())
|
, _message (new QLabel())
|
||||||
, _stopLevel(new QSpinBox())
|
, _stopLevel (new QSpinBox())
|
||||||
|
, _isFinished(false)
|
||||||
{
|
{
|
||||||
setModal ( true );
|
setModal ( false );
|
||||||
setWindowTitle ( "Breakpoint" );
|
setWindowTitle ( "Breakpoint" );
|
||||||
setToolTip ( "Crush the Mush to continue..." );
|
setToolTip ( "Crush the Mush to continue..." );
|
||||||
|
|
||||||
|
@ -70,6 +72,25 @@ namespace Hurricane {
|
||||||
|
|
||||||
connect ( ok , SIGNAL(clicked()) , this, SLOT(accept()) );
|
connect ( ok , SIGNAL(clicked()) , this, SLOT(accept()) );
|
||||||
connect ( _stopLevel, SIGNAL(valueChanged(int)), this, SLOT(updateStopLevel(int)) );
|
connect ( _stopLevel, SIGNAL(valueChanged(int)), this, SLOT(updateStopLevel(int)) );
|
||||||
|
connect ( this , SIGNAL(finished(int)) , this, SLOT(raiseFinished(int)) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int BreakpointWidget::execNoModal ()
|
||||||
|
{
|
||||||
|
if ( isVisible() ) return -1;
|
||||||
|
|
||||||
|
_isFinished = false;
|
||||||
|
show ();
|
||||||
|
while ( !_isFinished )
|
||||||
|
QApplication::processEvents ();
|
||||||
|
return result();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int BreakpointWidget::raiseFinished ( int )
|
||||||
|
{
|
||||||
|
_isFinished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -280,8 +280,9 @@ namespace Hurricane {
|
||||||
if ( !bpw )
|
if ( !bpw )
|
||||||
bpw = new BreakpointWidget ();
|
bpw = new BreakpointWidget ();
|
||||||
bpw->setMessage ( message.c_str() );
|
bpw->setMessage ( message.c_str() );
|
||||||
|
bpw->execNoModal ();
|
||||||
|
|
||||||
return ( bpw->exec() == QDialog::Accepted );
|
return ( bpw->result() == QDialog::Accepted );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,12 +43,16 @@ namespace Hurricane {
|
||||||
void setMessage ( const QString& );
|
void setMessage ( const QString& );
|
||||||
int getStopLevel () const;
|
int getStopLevel () const;
|
||||||
void setStopLevel ( int );
|
void setStopLevel ( int );
|
||||||
|
int execNoModal ();
|
||||||
public slots:
|
public slots:
|
||||||
void updateStopLevel ( int );
|
void updateStopLevel ( int );
|
||||||
|
protected slots:
|
||||||
|
int raiseFinished ( int );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel* _message;
|
QLabel* _message;
|
||||||
QSpinBox* _stopLevel;
|
QSpinBox* _stopLevel;
|
||||||
|
bool _isFinished;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue