Fix warning message when TrimSP binary is not found.
This commit is contained in:
parent
3740a74381
commit
1e5806a520
@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'TrimSPGUI.ui'
|
||||
#
|
||||
# Created: Tue Feb 5 15:22:18 2013
|
||||
# Created: Tue Feb 5 15:53:55 2013
|
||||
# by: The PerlQt User Interface Compiler (puic)
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -2466,8 +2466,6 @@ sub CollectValues
|
||||
sub CreateInpFile
|
||||
{
|
||||
|
||||
# use lib '$ENV{HOME}/Projects/TrimSPGUI/Chem';
|
||||
# push @INC, "$ENV{HOME}/Projects/TrimSPGUI";
|
||||
use Chem;
|
||||
# The proper way I think is not to have scan sequences implimented here
|
||||
# but rather call this multiple times to generate the scan
|
||||
@ -2669,7 +2667,7 @@ sub StartSequenceOne
|
||||
if (!$ENV{'TRIMBIN'}) {
|
||||
# If trim.sp binary is not defined give warning and return
|
||||
my $Warning = Qt::MessageBox::information( this, "Warning",
|
||||
"Warning:\n TrimSP binary is not found.\n Define using environment variable, e.g.\n export TRIMBIN=/usr/local/bin/trimsp7l\n or use the Configuration tab.");
|
||||
"Warning:\n TrimSP binary is not found.\n Define using the Configuration tab.");
|
||||
return(0);
|
||||
|
||||
}
|
||||
@ -3126,15 +3124,16 @@ sub GUIPath
|
||||
|
||||
# If nothing is returned keep as is
|
||||
if ($FileBrowser eq "") {
|
||||
$FileBrowser="$ENV{'PERLLIB'}";
|
||||
$FileBrowser=$ENV{'PERLLIB'};
|
||||
} else {
|
||||
TrimGUIPath->setText($FileBrowser);
|
||||
$ENV{'PERLLIB'}=$FileBrowser;
|
||||
$ENV{'PERLLIB'}=$FileBrowser;
|
||||
}
|
||||
TrimGUIPath->setText($FileBrowser);
|
||||
# Return a string with the directory name
|
||||
return $FileBrowser ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub TrimBin
|
||||
@ -3148,11 +3147,12 @@ sub TrimBin
|
||||
"Select the Trim.SP binary file");
|
||||
|
||||
# If the user gave a valid filename try to read it
|
||||
if ($file ne "") {
|
||||
if ($file eq "") {
|
||||
$file=$ENV{'TRIMBIN'};
|
||||
} else {
|
||||
$ENV{'TRIMBIN'}=$file;
|
||||
TRIMBIN->setText($file);
|
||||
}
|
||||
|
||||
TRIMBIN->setText($file);
|
||||
return $file;
|
||||
|
||||
}
|
||||
|
@ -311,8 +311,6 @@ void TrimSPGUI::CollectValues()
|
||||
|
||||
void TrimSPGUI::CreateInpFile()
|
||||
{
|
||||
# use lib '$ENV{HOME}/Projects/TrimSPGUI/Chem';
|
||||
# push @INC, "$ENV{HOME}/Projects/TrimSPGUI";
|
||||
use Chem;
|
||||
# The proper way I think is not to have scan sequences implimented here
|
||||
# but rather call this multiple times to generate the scan
|
||||
@ -513,7 +511,7 @@ void TrimSPGUI::StartSequenceOne()
|
||||
if (!$ENV{'TRIMBIN'}) {
|
||||
# If trim.sp binary is not defined give warning and return
|
||||
my $Warning = Qt::MessageBox::information( this, "Warning",
|
||||
"Warning:\n TrimSP binary is not found.\n Define using environment variable, e.g.\n export TRIMBIN=/usr/local/bin/trimsp7l\n or use the Configuration tab.");
|
||||
"Warning:\n TrimSP binary is not found.\n Define using the Configuration tab.");
|
||||
return(0);
|
||||
|
||||
}
|
||||
@ -961,14 +959,35 @@ void TrimSPGUI::GUIPath()
|
||||
|
||||
# If nothing is returned keep as is
|
||||
if ($FileBrowser eq "") {
|
||||
$FileBrowser="$ENV{'PERLLIB'}";
|
||||
$FileBrowser=$ENV{'PERLLIB'};
|
||||
} else {
|
||||
TrimGUIPath->setText($FileBrowser);
|
||||
$ENV{'PERLLIB'}=$FileBrowser;
|
||||
$ENV{'PERLLIB'}=$FileBrowser;
|
||||
}
|
||||
TrimGUIPath->setText($FileBrowser);
|
||||
# Return a string with the directory name
|
||||
return $FileBrowser ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub TrimBin
|
||||
{
|
||||
|
||||
my $file=Qt::FileDialog::getOpenFileName(
|
||||
"$ENV{'TRIMBIN'}",
|
||||
"Trim.SP binary (.* *.* *)",
|
||||
this,
|
||||
"open file dialog",
|
||||
"Select the Trim.SP binary file");
|
||||
|
||||
# If the user gave a valid filename try to read it
|
||||
if ($file eq "") {
|
||||
$file=$ENV{'TRIMBIN'};
|
||||
} else {
|
||||
$ENV{'TRIMBIN'}=$file;
|
||||
}
|
||||
TRIMBIN->setText($file);
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
||||
@ -982,10 +1001,11 @@ void TrimSPGUI::TrimBin()
|
||||
"Select the Trim.SP binary file");
|
||||
|
||||
# If the user gave a valid filename try to read it
|
||||
if ($file ne "") {
|
||||
if ($file eq "") {
|
||||
$file=$ENV{'TRIMBIN'};
|
||||
} else {
|
||||
$ENV{'TRIMBIN'}=$file;
|
||||
TRIMBIN->setText($file);
|
||||
}
|
||||
|
||||
TRIMBIN->setText($file);
|
||||
return $file;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user