BOOL LoginDialog::onCommand(UINT controlID, UINT notificationID) { switch (controlID) { case IDC_CSERVER: switch (notificationID) { case CBN_DROPDOWN: updateHistory(); break; // select item in ComboBox with list of history case CBN_SELENDOK: { int selectedItemIndex = m_server.getSelectedItemIndex(); if (selectedItemIndex < 0) { return FALSE; } StringStorage server; m_server.getItemText(selectedItemIndex, &server); ConnectionConfigSM ccsm(RegistryPaths::VIEWER_PATH, server.getString()); m_connectionConfig.loadFromStorage(&ccsm); break; } } enableConnect(); break; // click "Connect" case IDOK: onConnect(); kill(0); break; // cancel connection case IDCANCEL: kill(0); break; case IDC_BCONFIGURATION: onConfiguration(); break; case IDC_BOPTIONS: return onOptions(); case IDC_LISTENING: onListening(); kill(0); break; case IDC_ORDER_SUPPORT_BUTTON: onOrder(); break; case IDC_BABOUT: onAbout(); break; default: _ASSERT(true); return FALSE; } return TRUE; }
SyntroDB::SyntroDB() : QMainWindow() { m_startingUp = true; ui.setupUi(this); m_storeStreamDlg = NULL; connect(ui.actionExit, SIGNAL(triggered()), this, SLOT(close())); connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(onAbout())); connect(ui.actionBasicSetup, SIGNAL(triggered()), this, SLOT(onBasicSetup())); connect(ui.actionConfiguration, SIGNAL(triggered()), this, SLOT(onConfiguration())); initStatusBar(); initDisplayStats(); restoreWindowState(); SyntroUtils::syntroAppInit(); startControlServer(); setWindowTitle(QString("%1 - %2") .arg(SyntroUtils::getAppType()) .arg(SyntroUtils::getAppName())); m_storeClient = new StoreClient(this); connect(this, SIGNAL(refreshStreamSource(int)), m_storeClient, SLOT(refreshStreamSource(int)), Qt::QueuedConnection); connect(m_storeClient, SIGNAL(running()), this, SLOT(storeRunning()), Qt::QueuedConnection); m_storeClient->resumeThread(); m_CFSClient = new CFSClient(this); m_CFSClient->resumeThread(); QSettings *settings = SyntroUtils::getSettings(); settings->beginReadArray(SYNTRODB_PARAMS_STREAM_SOURCES); for (int index = 0; index < SYNTRODB_MAX_STREAMS; index++) { settings->setArrayIndex(index); QString source = settings->value(SYNTRODB_PARAMS_STREAM_SOURCE).toString(); m_rxStreamTable->item(index, SYNTRODB_COL_STREAM)->setText(source); if (source.length() > 0) { if (settings->value(SYNTRODB_PARAMS_INUSE, SYNTRO_PARAMS_FALSE).toString() == SYNTRO_PARAMS_TRUE) m_useBox[index]->setCheckState(Qt::Checked); else m_useBox[index]->setCheckState(Qt::Unchecked); } else { m_useBox[index]->setCheckState(Qt::Unchecked); } } settings->endArray(); m_startingUp = false; delete settings; m_timerId = startTimer(2000); }