From 800e29d4db13fb247e446d3f8d298e167ef08317 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 3 Aug 2018 08:53:02 -0400 Subject: [PATCH] Fix two potential crash spots in packjt77. Add "Reset Defaults" to Colors tab. --- Configuration.cpp | 26 +++++++++ Configuration.ui | 119 ++++++++++++++++++++++------------------- lib/77bit/packjt77.f90 | 8 +-- 3 files changed, 94 insertions(+), 59 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index 9405b0225..9b53c5edf 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -448,6 +448,7 @@ private: Q_SLOT void on_pbNewCallBand_clicked(); Q_SLOT void on_pbNewGrid_clicked(); Q_SLOT void on_pbNewGridBand_clicked(); + Q_SLOT void on_pbResetDefaults_clicked(); Q_SLOT void on_cbFox_clicked (bool); Q_SLOT void on_cbHound_clicked (bool); Q_SLOT void on_cbx2ToneSpacing_clicked(bool); @@ -2177,6 +2178,31 @@ void Configuration::impl::on_pbNewGridBand_clicked() ui_->labNewGridBand->setStyleSheet(QString("background: %1").arg(next_color_NewGridBand_.name())); } } + +void Configuration::impl::on_pbResetDefaults_clicked() +{ + next_color_CQ_ = color_CQ_ = "#66ff66"; + next_color_MyCall_ = color_MyCall_ = "#ff6666"; + next_color_TxMsg_ = color_TxMsg_ = "#ffff00"; + next_color_DXCC_ = color_DXCC_ = "#ff00ff"; + next_color_DXCCband_ = color_DXCCband_ = "#ffaaff"; + next_color_NewCall_ = color_NewCall_ = "#00ffff"; + next_color_NewCallBand_ = color_NewCallBand_ = "#99ffff"; + next_color_NewGrid_ = color_NewGrid_ = "#ff80ff"; + next_color_NewGridBand_ = color_NewGridBand_ = "#ffcc99"; + + ui_->labCQ->setStyleSheet(QString("background: %1").arg(next_color_CQ_.name())); + ui_->labMyCall->setStyleSheet(QString("background: %1").arg(next_color_MyCall_.name())); + ui_->labTx->setStyleSheet(QString("background: %1").arg(next_color_TxMsg_.name())); + ui_->labDXCC->setStyleSheet(QString("background: %1").arg(next_color_DXCC_.name())); + ui_->labDXCCband->setStyleSheet(QString("background: %1").arg(next_color_DXCCband_.name())); + ui_->labNewCall->setStyleSheet(QString("background: %1").arg(next_color_NewCall_.name())); + ui_->labNewCallBand->setStyleSheet(QString("background: %1").arg(next_color_NewCallBand_.name())); + ui_->labNewGrid->setStyleSheet(QString("background: %1").arg(next_color_NewGrid_.name())); + ui_->labNewGridBand->setStyleSheet(QString("background: %1").arg(next_color_NewGridBand_.name())); + +} + void Configuration::impl::on_decoded_text_font_push_button_clicked () { next_decoded_text_font_ = QFontDialog::getFont (0, decoded_text_font_ , this diff --git a/Configuration.ui b/Configuration.ui index 9cdcd1d11..9eb94ee8e 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2176,6 +2176,59 @@ Right click for insert and delete options. + + + + QLabel{background-color: #99ffff} + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #ff8000} + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #ffaaff} + + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #ffcc99} + + + K1ABC + + + Qt::AlignCenter + + + @@ -2197,6 +2250,13 @@ Right click for insert and delete options. + + + + New Grid on Band + + + @@ -2357,63 +2417,10 @@ Right click for insert and delete options. - - + + - New Grid on Band - - - - - - - QLabel{background-color: #ffaaff} - - - - K1ABC - - - Qt::AlignCenter - - - - - - - QLabel{background-color: #99ffff} - - - K1ABC - - - Qt::AlignCenter - - - - - - - QLabel{background-color: #ff8000} - - - K1ABC - - - Qt::AlignCenter - - - - - - - QLabel{background-color: #ffcc99} - - - K1ABC - - - Qt::AlignCenter + Reset Defaults diff --git a/lib/77bit/packjt77.f90 b/lib/77bit/packjt77.f90 index 49037538b..68ddfc247 100644 --- a/lib/77bit/packjt77.f90 +++ b/lib/77bit/packjt77.f90 @@ -866,7 +866,8 @@ subroutine pack77_1(nwords,w,i3,n3,c77) trim(w(nwords)).ne.'RR73' .and. trim(w(nwords)).ne.'73') return if(c1.eq.'+' .or. c1.eq.'-') then ir=0 - read(w(nwords),*) irpt + write(81,*) nwords,w(1:nwords); flush(81) + read(w(nwords),*,err=900) irpt irpt=irpt+35 else if(c2.eq.'R+' .or. c2.eq.'R-') then ir=1 @@ -922,8 +923,9 @@ subroutine pack77_1(nwords,w,i3,n3,c77) endif write(c77,1000) n28a,ipa,n28b,ipb,ir,igrid4,i3 1000 format(2(b28.28,b1),b1,b15.15,b3.3) - return + +900 return end subroutine pack77_1 @@ -983,7 +985,7 @@ subroutine pack77_3(nwords,w,i3,n3,c77) call pack28(w(2+itu),n28b) ir=0 if(w(3+itu)(1:2).eq.'R ') ir=1 - read(w(3+itu+ir),*) irpt + read(w(3+itu+ir),*,err=900) irpt irpt=(irpt-509)/10 - 2 if(irpt.lt.0) irpt=0 if(irpt.gt.7) irpt=7