# HG changeset patch # User Roeland Merks # Date 2010-11-24 18:24:58 # Node ID f563ace402633a152a5b8641a53a0f88187aae45 # Parent 6bcb69712a0e3af00a7ffed1166d5c09a359131a In response to referee's comment "I am also afraid that the ‘snapshot’ and the ‘Export cell data’ functions do not seem to work very well in my hands, could the program be changed so that the correct file extension (.jpg, .tif, .txt, .dat, .xls, .csv…) is given automatically." I corrected the "exportCellData()" function in canvas.cpp. It did not actually call exportCellData(filename) after the user entered a filename (logic after calling QMessageBox was incorrect). -- user: Roeland Merks branch 'default' changed src/canvas.cpp diff --git a/src/canvas.cpp b/src/canvas.cpp --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -1381,6 +1381,9 @@ xmlNode *Main::XMLSettingsTree(void) return settings; } + +#define QDEBUG + void Main::exportCellData(QString fileName) { #ifdef QDEBUG @@ -1406,7 +1409,7 @@ void Main::exportCellData() { if ( fd->exec() == QDialog::Accepted ) { fileName = fd->selectedFile(); if ( QFile::exists( fileName ) && - !QMessageBox::question( + !QMessageBox::question( this, tr("Overwrite File? -- Cell Data"), tr("A file called %1 already exists." @@ -1414,7 +1417,9 @@ void Main::exportCellData() { .arg( fileName ), tr("&Yes"), tr("&No"), QString::null, 1, 1 ) ) { - this->exportCellData(fileName); + return exportCellData(); + } else { + exportCellData(fileName); } } }