Skip to content

Commit

Permalink
small refactoring; update translations
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <[email protected]>
  • Loading branch information
Ho-Ro committed Mar 28, 2023
1 parent 2ea8261 commit 383ecd0
Show file tree
Hide file tree
Showing 13 changed files with 224 additions and 132 deletions.
2 changes: 1 addition & 1 deletion openhantek/src/exporting/exportcsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QFile *ExporterCSV::getFile() {

QFile *csvFile = new QFile( fileDialog.selectedFiles().first() );
if ( !csvFile->open( QIODevice::WriteOnly | QIODevice::Text ) ) {
QMessageBox::critical( nullptr, tr( "Error" ), csvFile->fileName() );
QMessageBox::critical( nullptr, QCoreApplication::applicationName(), tr( "Write error\n%1" ).arg( csvFile->fileName() ) );
return nullptr;
}
return csvFile;
Expand Down
2 changes: 1 addition & 1 deletion openhantek/src/exporting/exportjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ QFile *ExporterJSON::getFile() {

QFile *jsonFile = new QFile( fileDialog.selectedFiles().first() );
if ( !jsonFile->open( QIODevice::WriteOnly | QIODevice::Text ) ) {
QMessageBox::critical( nullptr, tr( "Error" ), jsonFile->fileName() );
QMessageBox::critical( nullptr, QCoreApplication::applicationName(), tr( "Write error\n%1" ).arg( jsonFile->fileName() ) );
return nullptr;
}
return jsonFile;
Expand Down
8 changes: 4 additions & 4 deletions openhantek/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ int main( int argc, char *argv[] ) {
if ( context )
libusb_exit( context );

if ( verboseLevel < 2 )
std::cerr << openHantekMainWindow.elapsedTime.elapsed() / 1000 << " s\n"; // last part
else
std::cerr << "OpenHantek6022 has stopped after " << openHantekMainWindow.elapsedTime.elapsed() / 1000 << " s\n";
if ( verboseLevel >= 2 )
std::cerr << "OpenHantek6022 has stopped after "; // part 1..4

std::cerr << openHantekMainWindow.elapsedTime.elapsed() / 1000 << " s\n"; // last part

return appStatus;
}
8 changes: 5 additions & 3 deletions openhantek/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ MainWindow::MainWindow( HantekDsoControl *dsoControl, DsoSettings *settings, Exp
.arg( this->dsoSettings->deviceFW, 4, 16,
QChar( '0' ) ); // FW version
QMessageBox::about(
this, QString( "OpenHantek6022 (%1)" ).arg( VERSION ),
this, QString( "%1 (%2)" ).arg( QCoreApplication::applicationName(), VERSION ),
QString( tr( "<p>Open source software for Hantek6022 USB oscilloscopes</p>"
"<p>Maintainer: Martin Homuth-Rosemann</p>"
"<p>Copyright &copy; 2010, 2011 Oliver Haag</p>"
Expand Down Expand Up @@ -623,7 +623,8 @@ void MainWindow::screenShot( screenshotType_t screenshotType, bool autoSafe ) {
fileName += ".png";
if ( autoSafe ) { // save under default name as PNG without asking
if ( !screenshot.save( fileName ) )
QMessageBox::critical( this, tr( "Error" ), QFileInfo{ fileName }.absoluteFilePath() );
QMessageBox::critical( this, QCoreApplication::applicationName(),
tr( "Write error\n%1" ).arg( QFileInfo{ fileName }.absoluteFilePath() ) );
return;
}
filters << tr( "Image (*.png *.jpg)" ) << tr( "Portable Document Format (*.pdf)" );
Expand All @@ -636,7 +637,8 @@ void MainWindow::screenShot( screenshotType_t screenshotType, bool autoSafe ) {
fileName = fileDialog.selectedFiles().first();
if ( filters.indexOf( fileDialog.selectedNameFilter() ) == 0 ) { // save as image
if ( !screenshot.save( fileName ) )
QMessageBox::critical( this, tr( "Error" ), QFileInfo{ fileName }.absoluteFilePath() );
QMessageBox::critical( this, QCoreApplication::applicationName(),
tr( "Write error\n%1" ).arg( QFileInfo{ fileName }.absoluteFilePath() ) );
return;
}

Expand Down
28 changes: 20 additions & 8 deletions openhantek/translations/openhantek_de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,14 @@
<message>
<location filename="../src/exporting/exportjson.cpp" line="47"/>
<location filename="../src/exporting/exportcsv.cpp" line="46"/>
<source>Write error
%1</source>
<translation>Schreibfehler
%1</translation>
</message>
<message>
<source>Error</source>
<translation>Fehler</translation>
<translation type="vanished">Fehler</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -1636,10 +1642,8 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="626"/>
<location filename="../src/mainwindow.cpp" line="639"/>
<source>Error</source>
<translation>Fehler</translation>
<translation type="vanished">Fehler</translation>
</message>
<message>
<source>&lt;p&gt;Open source software for Hantek6022 USB oscilloscopes&lt;/p&gt;&lt;p&gt;Maintainer: Martin Homuth-Rosemann&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2010, 2011 Oliver Haag&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2012-2022 OpenHantek community&lt;br/&gt;&lt;a href=&apos;https://github.com/OpenHantek&apos;&gt;https://github.com/OpenHantek&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Open source firmware copyright &amp;copy; 2019-2022 Ho-Ro&lt;br/&gt;&lt;a href=&apos;https://github.com/Ho-Ro/Hantek6022API&apos;&gt;https://github.com/Ho-Ro/Hantek6022API&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Device: %1 (%2), FW%3&lt;/p&gt;&lt;p&gt;Graphic: %4 - GLSL version %5&lt;/p&gt;&lt;p&gt;Qt version: %6&lt;/p&gt;</source>
Expand Down Expand Up @@ -1678,22 +1682,30 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="627"/>
<location filename="../src/mainwindow.cpp" line="641"/>
<source>Write error
%1</source>
<translation>Schreibfehler
%1</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Image (*.png *.jpg)</source>
<translation>Bild (*.png *.jpg)</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Portable Document Format (*.pdf)</source>
<translation>Portables Dokumentenformat (*.pdf)</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="630"/>
<location filename="../src/mainwindow.cpp" line="631"/>
<source>Save screenshot</source>
<translation>Screenshot speichen</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="662"/>
<location filename="../src/mainwindow.cpp" line="664"/>
<source>Print oscillograph</source>
<translation>Oszillogramm drucken</translation>
</message>
Expand Down
28 changes: 16 additions & 12 deletions openhantek/translations/openhantek_es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,10 @@
<message>
<location filename="../src/exporting/exportjson.cpp" line="47"/>
<location filename="../src/exporting/exportcsv.cpp" line="46"/>
<source>Error</source>
<translation></translation>
<source>Write error
%1</source>
<translation>Escribir error
%1</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -1380,12 +1382,6 @@
<source>&lt;p&gt;Graphic: %1 - GLSL version %2&lt;/p&gt;&lt;p&gt;Qt version: %3&lt;/p&gt;</source>
<translation>&lt;p&gt;Gráficos: %1 - Versión de GLSL %2&lt;/p&gt;&lt;p&gt;Versión de Qt: %3&lt;/p&gt;</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="626"/>
<location filename="../src/mainwindow.cpp" line="639"/>
<source>Error</source>
<translation></translation>
</message>
<message>
<source>&lt;p&gt;Open source software for Hantek6022 USB oscilloscopes&lt;/p&gt;&lt;p&gt;Maintainer: Martin Homuth-Rosemann&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2010, 2011 Oliver Haag&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2012-%7 OpenHantek community&lt;br/&gt;&lt;a href=&apos;https://github.com/OpenHantek&apos;&gt;https://github.com/OpenHantek&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Open source firmware copyright &amp;copy; 2019-%7 Ho-Ro&lt;br/&gt;&lt;a href=&apos;https://github.com/Ho-Ro/Hantek6022API&apos;&gt;https://github.com/Ho-Ro/Hantek6022API&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Device: %1 (%2), FW%3&lt;/p&gt;&lt;p&gt;Graphic: %4 - GLSL version %5&lt;/p&gt;&lt;p&gt;Qt version: %6&lt;/p&gt;</source>
<translation type="vanished">&lt;p&gt;Software de código abierto para osciloscopios USB Hantek6022&lt;/p&gt;&lt;p&gt;Mantenedor: Martin Homuth-Rosemann&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2010, 2011 Oliver Haag&lt;/p&gt;&lt;p&gt;Copyright &amp;copy; 2012-%7 OpenHantek community&lt;br/&gt;&lt;a href=&apos;https://github.com/OpenHantek&apos;&gt;https://github.com/OpenHantek&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Derechos de autor de firmware de código abierto &amp;copia; 2019-%7 Ho-Ro&lt;br/&gt;&lt;a href=&apos;https://github.com/Ho-Ro/Hantek6022API&apos;&gt;https://github.com/Ho-Ro/Hantek6022API&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Dispositivo: %1 (%2), FW%3&lt;/p&gt;&lt;p&gt;Graphic: %4 - GLSL version %5&lt;/p&gt;&lt;p&gt;Qt version: %6&lt;/p&gt;</translation>
Expand Down Expand Up @@ -1463,22 +1459,30 @@
<translation>yyyyMMdd_hhmmss</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="627"/>
<location filename="../src/mainwindow.cpp" line="641"/>
<source>Write error
%1</source>
<translation>Escribir error
%1</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Image (*.png *.jpg)</source>
<translation>Imagen (*.png *.jpg)</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Portable Document Format (*.pdf)</source>
<translation>Formato de Documento Portable (*.pdf)</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="630"/>
<location filename="../src/mainwindow.cpp" line="631"/>
<source>Save screenshot</source>
<translation>Guardar captura de pantalla</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="662"/>
<location filename="../src/mainwindow.cpp" line="664"/>
<source>Print oscillograph</source>
<translation>Imprimir oscilógrafo</translation>
</message>
Expand Down
26 changes: 18 additions & 8 deletions openhantek/translations/openhantek_fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,13 @@
<message>
<location filename="../src/exporting/exportjson.cpp" line="47"/>
<location filename="../src/exporting/exportcsv.cpp" line="46"/>
<source>Write error
%1</source>
<translation></translation>
</message>
<message>
<source>Error</source>
<translation>Erreur</translation>
<translation type="vanished">Erreur</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -1502,6 +1507,13 @@
<source>&lt;p&gt;Graphic: %1 - GLSL version %2&lt;/p&gt;&lt;p&gt;Qt version: %3&lt;/p&gt;</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="627"/>
<location filename="../src/mainwindow.cpp" line="641"/>
<source>Write error
%1</source>
<translation></translation>
</message>
<message>
<source>error</source>
<translation type="vanished">Erreur</translation>
Expand Down Expand Up @@ -1584,28 +1596,26 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="626"/>
<location filename="../src/mainwindow.cpp" line="639"/>
<source>Error</source>
<translation>Erreur</translation>
<translation type="vanished">Erreur</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Portable Document Format (*.pdf)</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="630"/>
<location filename="../src/mainwindow.cpp" line="631"/>
<source>Save screenshot</source>
<translation>Enregistrer la capture d&apos;écran</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="662"/>
<location filename="../src/mainwindow.cpp" line="664"/>
<source>Print oscillograph</source>
<translation>Imprimer l&apos;oscillographe</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="629"/>
<location filename="../src/mainwindow.cpp" line="630"/>
<source>Image (*.png *.jpg)</source>
<translation>Image (*.png *.jpg)</translation>
</message>
Expand Down
Loading

0 comments on commit 383ecd0

Please sign in to comment.