Commit da4a77c9 authored by Claes Sjöfors's avatar Claes Sjöfors

Xtt history export, in filename and default filename in proview.cnf curveExportfile

parent c1b17057
......@@ -115,14 +115,8 @@ void GeCurve::activate_export()
pwr_tFileName dir;
// Get directory from proview.cnf
if ( cnf_get_value( "curveExportDirectory", dir, sizeof(dir))) {
strcpy( filename, dir);
if ( filename[strlen(filename)-1] != '/')
strcat( filename, "/");
}
else
strcpy( filename, "~/");
strcat( filename, "history.txt");
if ( !cnf_get_value( "curveExportFile", filename, sizeof(filename)))
strcpy( filename, "~/history.txt");
grow_MeasureWindow( growcurve_ctx, &ll_x, &ll_y, &ur_x, &ur_y);
......
......@@ -895,7 +895,23 @@ int XttSevHist::sevhist_export_cb( void *ctx, pwr_tTime *from, pwr_tTime *to, in
FILE *fp;
pwr_tOName oname;
dcli_translate_filename( fname, filename);
// Replace $date with date
strncpy( fname, filename, sizeof(fname));
char *s1 = strstr( fname, "$date");
if ( s1) {
char timstr[40];
pwr_tFileName str;
sts = time_AtoAscii( 0, time_eFormat_FileDateAndTime,
timstr, sizeof(timstr));
strncpy( str, s1 + strlen("$date"), sizeof(str));
*s1 = 0;
strncat( fname, timstr, sizeof(fname));
strncat( fname, str, sizeof(fname));
}
dcli_translate_filename( fname, fname);
if ( idx == -1) {
// Export all attributes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment