mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-05 03:26:53 -04:00
Cleaner scheme for reading optional palette RGB valuess.
Add "S" to freqRead button when "Split Tx" has been selected. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3508 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
c15f2e6c38
commit
a90d9e2829
@ -2980,12 +2980,15 @@ void MainWindow::rigOpen()
|
|||||||
} else {
|
} else {
|
||||||
ui->readFreq->setStyleSheet("QPushButton{background-color: orange; \
|
ui->readFreq->setStyleSheet("QPushButton{background-color: orange; \
|
||||||
border-width: 0px; border-radius: 5px;}");
|
border-width: 0px; border-radius: 5px;}");
|
||||||
}
|
}
|
||||||
|
if(m_bSplit) ui->readFreq->setText("S");
|
||||||
|
if(!m_bSplit) ui->readFreq->setText("");
|
||||||
} else {
|
} else {
|
||||||
if(m_CATerror) ui->readFreq->setStyleSheet("QPushButton{background-color: red; \
|
if(m_CATerror) ui->readFreq->setStyleSheet("QPushButton{background-color: red; \
|
||||||
border-width: 0px; border-radius: 5px;}");
|
border-width: 0px; border-radius: 5px;}");
|
||||||
if(!m_CATerror) ui->readFreq->setStyleSheet("");
|
if(!m_CATerror) ui->readFreq->setStyleSheet("");
|
||||||
}
|
ui->readFreq->setText("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionAllow_multiple_instances_triggered(bool checked)
|
void MainWindow::on_actionAllow_multiple_instances_triggered(bool checked)
|
||||||
|
33
plotter.cpp
33
plotter.cpp
@ -488,28 +488,29 @@ void CPlotter::setPalette(QString palette) //setPalette()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE* fp=NULL;
|
QFile f;
|
||||||
if(palette=="Blue") fp=fopen("blue.dat","r");
|
if(palette=="Blue") f.setFileName("blue.dat");
|
||||||
if(palette=="AFMHot") fp=fopen("afmhot.dat","r");
|
if(palette=="AFMHot") f.setFileName("afmhot.dat");
|
||||||
if(palette=="Gray1") fp=fopen("gray1.dat","r");
|
if(palette=="Gray1") f.setFileName("gray1.dat");
|
||||||
if(fp==NULL) {
|
if(f.open(QIODevice::ReadOnly)) {
|
||||||
|
QTextStream in(&f);
|
||||||
|
int n,r,g,b;
|
||||||
|
float xr,xg,xb;
|
||||||
|
for(int i=0; i<256; i++) {
|
||||||
|
in >> n >> xr >> xg >> xb;
|
||||||
|
r=255.0*xr + 0.5;
|
||||||
|
g=255.0*xg + 0.5;
|
||||||
|
b=255.0*xb + 0.5;
|
||||||
|
m_ColorTbl[i].setRgb(r,g,b);
|
||||||
|
}
|
||||||
|
f.close();
|
||||||
|
} else {
|
||||||
QMessageBox msgBox0;
|
QMessageBox msgBox0;
|
||||||
QString t="Error: Cannot find requested palette file.";
|
QString t="Error: Cannot find requested palette file.";
|
||||||
msgBox0.setText(t);
|
msgBox0.setText(t);
|
||||||
msgBox0.exec();
|
msgBox0.exec();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int n,r,g,b;
|
|
||||||
float xr,xg,xb;
|
|
||||||
for(int i=0; i<256; i++) {
|
|
||||||
int nn=fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb);
|
|
||||||
r=255.0*xr + 0.5;
|
|
||||||
g=255.0*xg + 0.5;
|
|
||||||
b=255.0*xb + 0.5;
|
|
||||||
m_ColorTbl[i].setRgb(r,g,b);
|
|
||||||
if(nn==-999999) i++; //Silence compiler warning
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double CPlotter::fGreen()
|
double CPlotter::fGreen()
|
||||||
|
1174
portaudio.h
Normal file
1174
portaudio.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user