Minor style stuff

parent c1c89622
......@@ -66,53 +66,39 @@ void RedstartRunCirculatingSourceDialog::Start()
try
{
CreateScene();
ui->pushButton_start->setEnabled( false );
ui->pushButton_stop->setEnabled( true );
ui->pushButton_run->setEnabled( false );
SetUIElementsEnabledWhenNotRunning( false );
StartUpdateTimer();
}
catch( CVAException& e )
{
QString sErrorMessage = QString( "Could not run scene: %1" ).arg( QString::fromStdString( e.ToString() ) );
QString sErrorMessage = QString( "Could not create circulating source example scene: %1" ).arg( QString::fromStdString( e.ToString() ) );
QErrorMessage oErrMsg;
oErrMsg.showMessage( sErrorMessage );
oErrMsg.exec();
}
}
void RedstartRunCirculatingSourceDialog::Stop()
void RedstartRunCirculatingSourceDialog::SetUIElementsEnabledWhenNotRunning( bool bYes )
{
StopUpdateTimer();
ui->pushButton_start->setEnabled( true );
ui->pushButton_stop->setEnabled( false );
ui->pushButton_run->setEnabled( true );
const bool bNo = !bYes;
ui->pushButton_start->setEnabled( bYes );
ui->pushButton_stop->setEnabled( bNo );
ui->pushButton_run->setEnabled( bYes );
ui->lineEdit_macro_DefaultHRIR->setEnabled( bYes );
ui->lineEdit_macro_DemoSound->setEnabled( bYes );
ui->checkBox_folders_as_search_path->setEnabled( bYes );
ui->doubleSpinBox_timeout->setEnabled( bYes );
}
void RedstartRunCirculatingSourceDialog::Run()
void RedstartRunCirculatingSourceDialog::Stop()
{
try
{
CreateScene();
}
catch( CVAException& e )
{
QString sErrorMessage = QString( "Could not create and run scene: %1" ).arg( QString::fromStdString( e.ToString() ) );
QErrorMessage oErrMsg;
oErrMsg.showMessage( sErrorMessage );
oErrMsg.exec();
return;
}
StartUpdateTimer();
StopUpdateTimer();
SetUIElementsEnabledWhenNotRunning( true );
}
void RedstartRunCirculatingSourceDialog::on_pushButton_run_clicked()
{
Run();
Start();
accept();
}
......@@ -201,10 +187,9 @@ void RedstartRunCirculatingSourceDialog::StopUpdateTimer()
}
catch( CVAException& e )
{
QString sErrorMessage = QString( "Could not delete scene: %1" ).arg( QString::fromStdString( e.ToString() ) );
QErrorMessage oErrMsg;
oErrMsg.showMessage( sErrorMessage );
oErrMsg.exec();
// Quietly hide that something went wrong. It is possible, that a reset has been triggered or any
// object managed by this dialog has been removed by another connection - we do not observer the scene, here.
return;
}
}
......
......@@ -35,7 +35,7 @@ public:
~RedstartRunCirculatingSourceDialog();
void SetVAInterface( IVAInterface* );
void Run();
void Start();
void Stop();
......@@ -69,6 +69,8 @@ private:
void CreateScene();
void DeleteScene();
void SetUIElementsEnabledWhenNotRunning( bool bNo );
};
#endif // IW_REDSTART_RUN_CIRCULATING_SOURCE_DIALOG
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>538</width>
<height>312</height>
<width>545</width>
<height>325</height>
</rect>
</property>
<property name="windowTitle">
......@@ -92,6 +92,9 @@
<property name="text">
<string>Runtime</string>
</property>
<property name="buddy">
<cstring>doubleSpinBox_runtime</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
......@@ -122,6 +125,9 @@
<property name="text">
<string>Update timeout</string>
</property>
<property name="buddy">
<cstring>doubleSpinBox_timeout</cstring>
</property>
</widget>
</item>
<item row="7" column="1">
......@@ -130,13 +136,13 @@
<number>4</number>
</property>
<property name="minimum">
<double>0.000100000000000</double>
<double>0.010000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="value">
<double>0.001000000000000</double>
<double>0.010000000000000</double>
</property>
</widget>
</item>
......@@ -159,6 +165,9 @@
<property name="text">
<string>Azimuth increment</string>
</property>
<property name="buddy">
<cstring>doubleSpinBox_azi_inc</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
......@@ -166,6 +175,9 @@
<property name="text">
<string>Elevation increment</string>
</property>
<property name="buddy">
<cstring>doubleSpinBox_ele_inc</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
......@@ -213,6 +225,9 @@
<property name="text">
<string>Radius</string>
</property>
<property name="buddy">
<cstring>doubleSpinBox_radius</cstring>
</property>
</widget>
</item>
<item row="5" column="2">
......@@ -247,11 +262,19 @@
</layout>
</widget>
<tabstops>
<tabstop>pushButton_start</tabstop>
<tabstop>pushButton_run</tabstop>
<tabstop>pushButton_BrowseDemoSound</tabstop>
<tabstop>pushButton_BrowseHRIR</tabstop>
<tabstop>lineEdit_macro_DemoSound</tabstop>
<tabstop>lineEdit_macro_DefaultHRIR</tabstop>
<tabstop>checkBox_folders_as_search_path</tabstop>
<tabstop>pushButton_BrowseHRIR</tabstop>
<tabstop>doubleSpinBox_azi_inc</tabstop>
<tabstop>doubleSpinBox_ele_inc</tabstop>
<tabstop>doubleSpinBox_radius</tabstop>
<tabstop>doubleSpinBox_runtime</tabstop>
<tabstop>doubleSpinBox_timeout</tabstop>
<tabstop>pushButton_stop</tabstop>
</tabstops>
<resources/>
<connections/>
......
......@@ -91,9 +91,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1085</width>
<height>736</height>
<y>-58</y>
<width>1071</width>
<height>788</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,2">
......@@ -488,6 +488,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Direct sound</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -495,6 +498,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Early reflections</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -502,6 +508,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Diffuse decay</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -509,6 +518,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Source directivity</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -516,6 +528,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Medium absorption</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -523,6 +538,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Temporal variations</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -530,6 +548,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Scattering</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -537,6 +558,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Diffraction</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -544,6 +568,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Near-field</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -551,6 +578,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Doppler</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -558,6 +588,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Spreading loss</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -565,6 +598,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Transmission</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
......@@ -572,6 +608,9 @@ background-color: rgb(208, 255, 188);</string>
<property name="text">
<string>Absorption</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment