Added save/load or an initialization file for GUI parameters.

This commit is contained in:
2010-08-06 09:12:51 +00:00
parent b8d6f23a80
commit 840273d9c1

View File

@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'TrimSPGUI.ui' # Form implementation generated from reading ui file 'TrimSPGUI.ui'
# #
# Created: Fri Aug 6 11:08:54 2010 # Created: Fri Aug 6 11:12:44 2010
# by: The PerlQt User Interface Compiler (puic) # by: The PerlQt User Interface Compiler (puic)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -2639,7 +2639,7 @@ sub OpenFile
this, this,
"open file dialog", "open file dialog",
"Choose an initialization file"); "Choose an initialization file");
print "Selected file: $file\n";
# If the user gave a valid filename try to read it # If the user gave a valid filename try to read it
if ($file ne "") { if ($file ne "") {
open (INF,q{<},"$file" ); open (INF,q{<},"$file" );
@ -2729,8 +2729,8 @@ STo=$All{'STo'}
SStep=$All{'SStep'} SStep=$All{'SStep'}
"; ";
# Save to default file name ".TriumSP" # Save to default file name "TriumSP.cfg"
my $file = ".TrimSP"; my $file = "TrimSP.cfg";
open (OUTF,q{>},"$file" ); open (OUTF,q{>},"$file" );
print OUTF (" $InitFile"); print OUTF (" $InitFile");
close(OUTF); close(OUTF);
@ -2796,8 +2796,8 @@ STo=$All{'STo'}
SStep=$All{'SStep'} SStep=$All{'SStep'}
"; ";
my $file=Qt::FileDialog::getSaveFileName( my $file=Qt::FileDialog::getSaveFileName(
".TrimSP", "TrimSP.cfg",
"TrimSP GUI Initialization file (* .* *.*)", "TrimSP GUI Initialization file (*.cfg)",
this, this,
"save file dialog", "save file dialog",
"Choose a filename to save under"); "Choose a filename to save under");