Commit 4d92b1d3 authored by Don Gagne's avatar Don Gagne

Rename SettingsDialog->SerialSettingsDialog

This avoids collision with main app SettingsDialog class
parent 69d34ea8
......@@ -44,9 +44,9 @@ This file is part of the APM_PLANNER project
QT_USE_NAMESPACE
SettingsDialog::SettingsDialog(QWidget *parent) :
SerialSettingsDialog::SerialSettingsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SettingsDialog)
ui(new Ui::SerialSettingsDialog)
{
ui->setupUi(this);
......@@ -67,17 +67,17 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
updateSettings();
}
SettingsDialog::~SettingsDialog()
SerialSettingsDialog::~SerialSettingsDialog()
{
delete ui;
}
const SerialSettings& SettingsDialog::settings() const
const SerialSettings& SerialSettingsDialog::settings() const
{
return m_currentSettings;
}
void SettingsDialog::showPortInfo(int idx)
void SerialSettingsDialog::showPortInfo(int idx)
{
if (idx != -1) {
QStringList list = ui->serialPortInfoListBox->itemData(idx).toStringList();
......@@ -89,13 +89,13 @@ void SettingsDialog::showPortInfo(int idx)
}
}
void SettingsDialog::apply()
void SerialSettingsDialog::apply()
{
updateSettings();
hide();
}
void SettingsDialog::checkCustomBaudRatePolicy(int idx)
void SerialSettingsDialog::checkCustomBaudRatePolicy(int idx)
{
bool isCustomBaudRate = !ui->baudRateBox->itemData(idx).isValid();
ui->baudRateBox->setEditable(isCustomBaudRate);
......@@ -106,7 +106,7 @@ void SettingsDialog::checkCustomBaudRatePolicy(int idx)
}
}
void SettingsDialog::fillPortsParameters()
void SerialSettingsDialog::fillPortsParameters()
{
// fill baud rate (is not the entire list of available values,
// desired values??, add your independently)
......@@ -145,7 +145,7 @@ void SettingsDialog::fillPortsParameters()
ui->flowControlBox->addItem(QLatin1String("XON/XOFF"), QSerialPort::SoftwareControl);
}
void SettingsDialog::fillPortsInfo()
void SerialSettingsDialog::fillPortsInfo()
{
ui->serialPortInfoListBox->clear();
foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
......@@ -161,7 +161,7 @@ void SettingsDialog::fillPortsInfo()
}
}
void SettingsDialog::updateSettings()
void SerialSettingsDialog::updateSettings()
{
m_currentSettings.name = ui->serialPortInfoListBox->currentText();
......
......@@ -33,14 +33,14 @@ This file is part of the APM_PLANNER project
*
*/
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#ifndef SERIALSETTINGSDIALOG_H
#define SERIALSETTINGSDIALOG_H
#include <QDialog>
#include <QSerialPort>
namespace Ui {
class SettingsDialog;
class SerialSettingsDialog;
}
class QIntValidator;
......@@ -62,13 +62,13 @@ public:
QSerialPort::FlowControl flowControl;
};
class SettingsDialog : public QDialog
class SerialSettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit SettingsDialog(QWidget *parent = 0);
~SettingsDialog();
explicit SerialSettingsDialog(QWidget *parent = 0);
~SerialSettingsDialog();
const SerialSettings &settings() const;
......@@ -83,9 +83,9 @@ private:
void updateSettings();
private:
Ui::SettingsDialog *ui;
Ui::SerialSettingsDialog *ui;
SerialSettings m_currentSettings;
QIntValidator *m_intValidator;
};
#endif // SETTINGSDIALOG_H
#endif
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<class>SerialSettingsDialog</class>
<widget class="QDialog" name="SerialSettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
......
......@@ -66,7 +66,7 @@ TerminalConsole::TerminalConsole(QWidget *parent) :
layout->addWidget(m_statusBar);
m_serial = new QSerialPort(this);
m_settingsDialog = new SettingsDialog;
m_settingsDialog = new SerialSettingsDialog;
ui->connectButton->setEnabled(true);
ui->disconnectButton->setEnabled(false);
......
......@@ -88,7 +88,7 @@ private:
Console *m_console;
QStatusBar *m_statusBar;
SettingsDialog *m_settingsDialog;
SerialSettingsDialog *m_settingsDialog;
QSerialPort *m_serial;
SerialSettings m_settings;
ConsoleMode m_consoleMode;
......
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