File tree Expand file tree Collapse file tree 3 files changed +49
-6
lines changed Expand file tree Collapse file tree 3 files changed +49
-6
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,10 @@ void DataTab::on_data_encodingSetButton_clicked()
122
122
newCodec = QTextCodec::codecForName (box->currentText ().toLatin1 ());
123
123
if (newCodec != nullptr )
124
124
{
125
- if (box->itemText (box->currentIndex ()) == box->currentText ()) // existing text
126
- dataEncodingId = box->currentIndex ();
127
125
if (RxDecoder != nullptr )
128
126
delete RxDecoder;
129
127
dataCodec = newCodec;
128
+ box->setCurrentText (dataCodec->name ());
130
129
emit setDataCodec (dataCodec);
131
130
RxDecoder = dataCodec->makeDecoder (); // clear state machine
132
131
emit setPlotDecoder (dataCodec->makeDecoder ());// clear state machine, standalone decoder for DataTab/PlotTab
@@ -137,7 +136,13 @@ void DataTab::on_data_encodingSetButton_clicked()
137
136
else
138
137
{
139
138
QMessageBox::information (this , tr (" Info" ), ui->data_encodingNameBox ->currentText () + " " + tr (" is not a valid encoding." ));
140
- box->setCurrentIndex (dataEncodingId);
139
+ if (dataCodec != nullptr )
140
+ box->setCurrentText (dataCodec->name ());
141
+ else
142
+ {
143
+ box->setCurrentText (" UTF-8" );
144
+ on_data_encodingSetButton_clicked ();
145
+ }
141
146
}
142
147
}
143
148
Original file line number Diff line number Diff line change @@ -79,8 +79,6 @@ private slots:
79
79
MySettings* settings;
80
80
QTimer* repeatTimer;
81
81
82
- int dataEncodingId = 0 ;
83
-
84
82
QScrollBar* RxSlider;
85
83
int currRxSliderPos = 0 ;
86
84
int userRequiredRxSliderPos = 0 ;
Original file line number Diff line number Diff line change @@ -510,14 +510,54 @@ margin-right:3em;
510
510
<string >UTF-8</string >
511
511
</property >
512
512
</item >
513
+ <item >
514
+ <property name =" text" >
515
+ <string >GB2312</string >
516
+ </property >
517
+ </item >
513
518
<item >
514
519
<property name =" text" >
515
520
<string >GB18030</string >
516
521
</property >
517
522
</item >
518
523
<item >
519
524
<property name =" text" >
520
- <string >BIG5</string >
525
+ <string >Big5</string >
526
+ </property >
527
+ </item >
528
+ <item >
529
+ <property name =" text" >
530
+ <string >windows-1252</string >
531
+ </property >
532
+ </item >
533
+ <item >
534
+ <property name =" text" >
535
+ <string >UTF-16LE</string >
536
+ </property >
537
+ </item >
538
+ <item >
539
+ <property name =" text" >
540
+ <string >UTF-16BE</string >
541
+ </property >
542
+ </item >
543
+ <item >
544
+ <property name =" text" >
545
+ <string >UTF-32LE</string >
546
+ </property >
547
+ </item >
548
+ <item >
549
+ <property name =" text" >
550
+ <string >UTF-32BE</string >
551
+ </property >
552
+ </item >
553
+ <item >
554
+ <property name =" text" >
555
+ <string >Shift_JIS</string >
556
+ </property >
557
+ </item >
558
+ <item >
559
+ <property name =" text" >
560
+ <string >EUC-KR</string >
521
561
</property >
522
562
</item >
523
563
</widget >
You can’t perform that action at this time.
0 commit comments