Skip to content

Commit cd74777

Browse files
committed
fix load dropdown for basic responses #402
1 parent 0f1f8f7 commit cd74777

File tree

3 files changed

+47
-41
lines changed

3 files changed

+47
-41
lines changed

src/settings.cpp

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -791,26 +791,6 @@ void Settings::loadTableHeaders()
791791
ui->displayOrderListTraffic->setAlternatingRowColors(true);
792792
}
793793

794-
void Settings::on_responsePacketBox_currentIndexChanged(const QString &arg1)
795-
{
796-
797-
Q_UNUSED(arg1);
798-
799-
Packet tempPacket;
800-
QString selectedName = ui->responsePacketBox->currentText();
801-
802-
//QDEBUGVAR(selectedName);
803-
foreach (tempPacket, packetsSaved) {
804-
if (tempPacket.name == selectedName) {
805-
ui->hexResponseEdit->setText(tempPacket.hexString);
806-
on_hexResponseEdit_textEdited(tempPacket.hexString);
807-
break;
808-
}
809-
810-
}
811-
812-
ui->responsePacketBox->setCurrentIndex(0);
813-
}
814794

815795
void Settings::on_defaultDisplayButton_clicked()
816796
{
@@ -1171,3 +1151,28 @@ void Settings::on_chooseLanguageButton_clicked()
11711151

11721152
}
11731153

1154+
1155+
1156+
void Settings::on_responsePacketBox_currentIndexChanged(int index)
1157+
{
1158+
1159+
Q_UNUSED(index);
1160+
QDEBUG();
1161+
1162+
Packet tempPacket;
1163+
QString selectedName = ui->responsePacketBox->currentText();
1164+
1165+
//QDEBUGVAR(selectedName);
1166+
foreach (tempPacket, packetsSaved) {
1167+
if (tempPacket.name == selectedName) {
1168+
ui->hexResponseEdit->setText(tempPacket.hexString);
1169+
on_hexResponseEdit_textEdited(tempPacket.hexString);
1170+
break;
1171+
}
1172+
1173+
}
1174+
1175+
ui->responsePacketBox->setCurrentIndex(0);
1176+
1177+
}
1178+

src/settings.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ class Settings : public QDialog
122122

123123
void on_hexResponseEdit_textEdited(const QString &arg1);
124124

125-
void on_responsePacketBox_currentIndexChanged(const QString &arg1);
126-
127125
void on_defaultDisplayButton_clicked();
128126

129127
void on_smartResponseEnableCheck_clicked();
@@ -149,7 +147,10 @@ class Settings : public QDialog
149147

150148
void on_chooseLanguageButton_clicked();
151149

152-
private:
150+
151+
void on_responsePacketBox_currentIndexChanged(int index);
152+
153+
private:
153154
QWidget *parentWidget;
154155
Ui::Settings *ui;
155156
QList<Packet> packetsSaved;

src/settings.ui

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<item>
1818
<widget class="QTabWidget" name="settingsTabWidget">
1919
<property name="currentIndex">
20-
<number>3</number>
20+
<number>0</number>
2121
</property>
2222
<widget class="QWidget" name="tab_2">
2323
<attribute name="title">
@@ -130,7 +130,7 @@
130130
<item>
131131
<widget class="QLineEdit" name="dtlsServerPortEdit">
132132
<property name="layoutDirection">
133-
<enum>Qt::LayoutDirection::LeftToRight</enum>
133+
<enum>Qt::LeftToRight</enum>
134134
</property>
135135
<property name="text">
136136
<string>0</string>
@@ -438,7 +438,7 @@
438438
<item>
439439
<spacer name="verticalSpacer">
440440
<property name="orientation">
441-
<enum>Qt::Orientation::Vertical</enum>
441+
<enum>Qt::Vertical</enum>
442442
</property>
443443
<property name="sizeHint" stdset="0">
444444
<size>
@@ -470,7 +470,7 @@
470470
<item>
471471
<spacer name="horizontalSpacer_4">
472472
<property name="orientation">
473-
<enum>Qt::Orientation::Horizontal</enum>
473+
<enum>Qt::Horizontal</enum>
474474
</property>
475475
<property name="sizeHint" stdset="0">
476476
<size>
@@ -533,7 +533,7 @@
533533
<item>
534534
<widget class="QTableWidget" name="httpCredentialTable">
535535
<property name="selectionBehavior">
536-
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
536+
<enum>QAbstractItemView::SelectRows</enum>
537537
</property>
538538
</widget>
539539
</item>
@@ -542,7 +542,7 @@
542542
<item>
543543
<spacer name="horizontalSpacer_3">
544544
<property name="orientation">
545-
<enum>Qt::Orientation::Horizontal</enum>
545+
<enum>Qt::Horizontal</enum>
546546
</property>
547547
<property name="sizeHint" stdset="0">
548548
<size>
@@ -633,7 +633,7 @@
633633
<item>
634634
<spacer name="verticalSpacer_4">
635635
<property name="orientation">
636-
<enum>Qt::Orientation::Vertical</enum>
636+
<enum>Qt::Vertical</enum>
637637
</property>
638638
<property name="sizeHint" stdset="0">
639639
<size>
@@ -717,7 +717,7 @@
717717
<item>
718718
<spacer name="verticalSpacer_6">
719719
<property name="orientation">
720-
<enum>Qt::Orientation::Vertical</enum>
720+
<enum>Qt::Vertical</enum>
721721
</property>
722722
<property name="sizeHint" stdset="0">
723723
<size>
@@ -730,7 +730,7 @@
730730
<item>
731731
<spacer name="horizontalSpacer_8">
732732
<property name="orientation">
733-
<enum>Qt::Orientation::Horizontal</enum>
733+
<enum>Qt::Horizontal</enum>
734734
</property>
735735
<property name="sizeHint" stdset="0">
736736
<size>
@@ -762,7 +762,7 @@
762762
<item>
763763
<spacer name="horizontalSpacer">
764764
<property name="orientation">
765-
<enum>Qt::Orientation::Horizontal</enum>
765+
<enum>Qt::Horizontal</enum>
766766
</property>
767767
<property name="sizeHint" stdset="0">
768768
<size>
@@ -1104,10 +1104,10 @@
11041104
<item>
11051105
<widget class="QFrame" name="frame">
11061106
<property name="frameShape">
1107-
<enum>QFrame::Shape::StyledPanel</enum>
1107+
<enum>QFrame::StyledPanel</enum>
11081108
</property>
11091109
<property name="frameShadow">
1110-
<enum>QFrame::Shadow::Raised</enum>
1110+
<enum>QFrame::Raised</enum>
11111111
</property>
11121112
<layout class="QVBoxLayout" name="verticalLayout_3">
11131113
<item>
@@ -1157,7 +1157,7 @@
11571157
<item>
11581158
<spacer name="horizontalSpacer_5">
11591159
<property name="orientation">
1160-
<enum>Qt::Orientation::Horizontal</enum>
1160+
<enum>Qt::Horizontal</enum>
11611161
</property>
11621162
<property name="sizeHint" stdset="0">
11631163
<size>
@@ -1198,7 +1198,7 @@
11981198
<item>
11991199
<spacer name="horizontalSpacer_6">
12001200
<property name="orientation">
1201-
<enum>Qt::Orientation::Horizontal</enum>
1201+
<enum>Qt::Horizontal</enum>
12021202
</property>
12031203
<property name="sizeHint" stdset="0">
12041204
<size>
@@ -1216,7 +1216,7 @@
12161216
<item>
12171217
<spacer name="verticalSpacer_2">
12181218
<property name="orientation">
1219-
<enum>Qt::Orientation::Vertical</enum>
1219+
<enum>Qt::Vertical</enum>
12201220
</property>
12211221
<property name="sizeHint" stdset="0">
12221222
<size>
@@ -1242,7 +1242,7 @@
12421242
<item>
12431243
<spacer name="horizontalSpacer_2">
12441244
<property name="orientation">
1245-
<enum>Qt::Orientation::Horizontal</enum>
1245+
<enum>Qt::Horizontal</enum>
12461246
</property>
12471247
<property name="sizeHint" stdset="0">
12481248
<size>
@@ -1255,10 +1255,10 @@
12551255
<item>
12561256
<widget class="QDialogButtonBox" name="buttonBox">
12571257
<property name="orientation">
1258-
<enum>Qt::Orientation::Horizontal</enum>
1258+
<enum>Qt::Horizontal</enum>
12591259
</property>
12601260
<property name="standardButtons">
1261-
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
1261+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
12621262
</property>
12631263
</widget>
12641264
</item>

0 commit comments

Comments
 (0)