* ./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
|
||||
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QSpinBox>
|
||||
|
@ -37,11 +38,12 @@ namespace Hurricane {
|
|||
|
||||
|
||||
BreakpointWidget::BreakpointWidget ( QWidget* parent )
|
||||
: QDialog (parent)
|
||||
, _message (new QLabel())
|
||||
, _stopLevel(new QSpinBox())
|
||||
: QDialog (parent)
|
||||
, _message (new QLabel())
|
||||
, _stopLevel (new QSpinBox())
|
||||
, _isFinished(false)
|
||||
{
|
||||
setModal ( true );
|
||||
setModal ( false );
|
||||
setWindowTitle ( "Breakpoint" );
|
||||
setToolTip ( "Crush the Mush to continue..." );
|
||||
|
||||
|
@ -70,6 +72,25 @@ namespace Hurricane {
|
|||
|
||||
connect ( ok , SIGNAL(clicked()) , this, SLOT(accept()) );
|
||||
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 )
|
||||
bpw = new BreakpointWidget ();
|
||||
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& );
|
||||
int getStopLevel () const;
|
||||
void setStopLevel ( int );
|
||||
int execNoModal ();
|
||||
public slots:
|
||||
void updateStopLevel ( int );
|
||||
protected slots:
|
||||
int raiseFinished ( int );
|
||||
|
||||
private:
|
||||
QLabel* _message;
|
||||
QSpinBox* _stopLevel;
|
||||
bool _isFinished;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue