* ./hurricane/src/hviewer :

- Change: BreakpointWidget is no longer modal, need to replace the ::exec()
        by a custom made one.
This commit is contained in:
Jean-Paul Chaput 2009-01-19 12:48:53 +00:00
parent 3d486767eb
commit e507335c01
3 changed files with 31 additions and 5 deletions

View File

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

View File

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

View File

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