Commit f2cbf7bc authored by Michael Carpenter's avatar Michael Carpenter

Simplified Serial port selection window

parent 78c4673f
...@@ -68,11 +68,18 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn ...@@ -68,11 +68,18 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn
ui.connectionType->setEnabled(false); ui.connectionType->setEnabled(false);
ui.linkType->setEnabled(false); ui.linkType->setEnabled(false);
ui.protocolGroupBox->setVisible(false); ui.protocolGroupBox->setVisible(false);
ui.protocolTypeGroupBox->setVisible(false);
// Connect UI element visibility to checkbox // Connect UI element visibility to checkbox
connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool))); //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool)));
connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool))); //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool)));
connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool))); //connect(ui.advancedOptionsCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool)));
ui.advancedOptionsCheckBox->setVisible(false);
//connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.advancedOptionsCheckBox,SLOT(setChecked(bool)));
connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.protocolTypeGroupBox,SLOT(setVisible(bool)));
connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.connectionType, SLOT(setEnabled(bool)));
connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.linkType, SLOT(setEnabled(bool)));
connect(ui.advCheckBox, SIGNAL(clicked(bool)), ui.protocolGroupBox, SLOT(setVisible(bool)));
// add link types // add link types
ui.linkType->addItem(tr("Serial"), QGC_LINK_SERIAL); ui.linkType->addItem(tr("Serial"), QGC_LINK_SERIAL);
......
...@@ -6,76 +6,15 @@ ...@@ -6,76 +6,15 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>413</width> <width>770</width>
<height>373</height> <height>563</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="1,1,1,100,100,1"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin"> <item>
<number>6</number>
</property>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Link Type</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="linkType"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Protocol</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="connectionType">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="advancedOptionsCheckBox">
<property name="text">
<string>Advanced Options</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="linkGroupBox"> <widget class="QGroupBox" name="linkGroupBox">
<property name="title"> <property name="title">
<string>Link</string> <string>Link</string>
...@@ -97,8 +36,8 @@ ...@@ -97,8 +36,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>393</width> <width>748</width>
<height>76</height> <height>97</height>
</rect> </rect>
</property> </property>
</widget> </widget>
...@@ -107,7 +46,65 @@ ...@@ -107,7 +46,65 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2"> <item>
<widget class="QCheckBox" name="advCheckBox">
<property name="text">
<string>Show Advanced Protocol Options</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="protocolTypeGroupBox">
<property name="title">
<string>GroupBox</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Link Type</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="linkType"/>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="connectionType">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="advancedOptionsCheckBox">
<property name="text">
<string>Advanced Options</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Protocol</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="protocolGroupBox"> <widget class="QGroupBox" name="protocolGroupBox">
<property name="title"> <property name="title">
<string>Protocol</string> <string>Protocol</string>
...@@ -129,8 +126,8 @@ ...@@ -129,8 +126,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>393</width> <width>748</width>
<height>76</height> <height>96</height>
</rect> </rect>
</property> </property>
</widget> </widget>
...@@ -139,20 +136,20 @@ ...@@ -139,20 +136,20 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item>
<widget class="QLabel" name="connectionStatusLabel"> <spacer name="verticalSpacer">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <enum>Qt::Vertical</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text"> <property name="sizeHint" stdset="0">
<string>Disconnected</string> <size>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</widget> </spacer>
</item> </item>
<item row="5" column="1"> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
<number>12</number> <number>12</number>
...@@ -189,6 +186,19 @@ ...@@ -189,6 +186,19 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<widget class="QLabel" name="connectionStatusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Disconnected</string>
</property>
</widget>
</item>
</layout> </layout>
<action name="actionDelete"> <action name="actionDelete">
<property name="text"> <property name="text">
...@@ -214,6 +224,14 @@ ...@@ -214,6 +224,14 @@
<string>Close the configuration window</string> <string>Close the configuration window</string>
</property> </property>
</action> </action>
<zorder>line</zorder>
<zorder>linkGroupBox</zorder>
<zorder>protocolGroupBox</zorder>
<zorder>connectionStatusLabel</zorder>
<zorder>advCheckBox</zorder>
<zorder>protocolTypeGroupBox</zorder>
<zorder>label_5</zorder>
<zorder>verticalSpacer</zorder>
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
......
...@@ -129,6 +129,9 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge ...@@ -129,6 +129,9 @@ SerialConfigurationWindow::SerialConfigurationWindow(LinkInterface* link, QWidge
connect(ui.parEven, SIGNAL(toggled(bool)), this, SLOT(setParityEven(bool))); connect(ui.parEven, SIGNAL(toggled(bool)), this, SLOT(setParityEven(bool)));
connect(ui.dataBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setDataBits(int))); connect(ui.dataBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setDataBits(int)));
connect(ui.stopBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setStopBits(int))); connect(ui.stopBitsSpinBox, SIGNAL(valueChanged(int)), this->link, SLOT(setStopBits(int)));
connect(ui.advCheckBox,SIGNAL(clicked(bool)),ui.advGroupBox,SLOT(setShown(bool)));
ui.advCheckBox->setChecked(false);
ui.advGroupBox->setVisible(false);
//connect(this->link, SIGNAL(connected(bool)), this, SLOT()); //connect(this->link, SIGNAL(connected(bool)), this, SLOT());
ui.portName->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow); ui.portName->setSizeAdjustPolicy(QComboBox::AdjustToContentsOnFirstShow);
......
This diff is collapsed.
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