#include "startupWindow.h" StartupWindow::StartupWindow() { // Initialize variable. cPanel = NULL; rConfig = new RadarConfig(); connect( rConfig, SIGNAL( configWindowAccepted( int, int ) ), this, SLOT( openControlPanel( int, int ) ) ); rConfig->setGeometry( 400, 300, 280, 100 ); rConfig->show(); } StartupWindow::~StartupWindow() { if( cPanel ) { delete cPanel; cPanel = NULL; } } void StartupWindow::openControlPanel( int radarNum, int channelNum ) { // Copy parameters to member variables. radarNumber = radarNum; channelNumber = channelNum; // Hide then close the radar configuration window. Delete the pointer and set it to NULL for safety. rConfig->hide(); rConfig->close(); delete rConfig; rConfig = NULL; cPanel = new ControlPanel( radarNum, channelNum, this ); // Create a new Control Panel window. connect( cPanel, SIGNAL( cpWindowClosed() ), this, SLOT( closeStartupWindow() ) ); // Connect the action of closing the Control Panel window to a function. // Show the control panel window. cPanel->showMaximized(); } void StartupWindow::closeStartupWindow() { this->close(); // Close the Startup window. } int StartupWindow::getRadarNumber() { return radarNumber; // Return the number of the radar. } int StartupWindow::getChannelNumber() { return channelNumber; // Return the number of the channels. }