MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setWindowTitle(QString("XKSimulator %1").arg(getVersionString())); m_serial = new SerialPort(); connect(m_serial, SIGNAL(serialError(QString)), this, SLOT(serialError(QString))); connect(m_serial, SIGNAL(serialStatus(QString)), this, SLOT(serialStatus(QString))); m_error = new QLabel(""); statusBar()->addWidget(m_error); m_enum = new QextSerialEnumerator(); #ifdef Q_OS_WIN connect(m_enum, SIGNAL(deviceDiscovered(QextPortInfo)), this, SLOT(deviceDiscovered(QextPortInfo))); connect(m_enum, SIGNAL(deviceRemoved(QextPortInfo)), this, SLOT(deviceRemoved(QextPortInfo))); m_enum->setUpNotifications(); #endif m_gpsTimer = new QTimer(this); connect(m_gpsTimer, SIGNAL(timeout()), this, SLOT(gpsTimer())); // Load the application settings (not the command settings) loadAppSettings(); // Load the list of available serial ports loadComPorts(); m_serial->open(m_tty); // Open the selected serial port }
PuttySessions::PuttySessions(SessionType type) : QStringList() { switch (type) { case REGISTRY: loadRegSessions(); break; case FILESYSTEM: loadFsSessions(); break; case COMPORT: loadComPorts(); break; default: break; } }
void MainWindow::on_actionRefresh_triggered() { loadComPorts(); }