9 #include <QFontMetrics>
10 #include <QHBoxLayout>
12 #include "GuiFilenameParameter.h"
14 #include "UserInterface.h"
30 int group,
int param) :
32 connect(p_lineEdit, SIGNAL(textChanged(
const QString &)),
this, SIGNAL(ValueChanged()));
33 grid->addWidget(p_lineEdit, param, 2);
35 grid->addWidget(p_fileButton, param, 3);
38 QString file =
FileName(
"$ISISROOT/appdata/images/icons/view_tree.png").
expanded();
39 action->setIcon(QPixmap(file));
40 connect(action, SIGNAL(triggered(
bool)),
this, SLOT(
SelectFile()));
42 p_fileButton->setIconSize(QSize(22, 22));
43 p_fileButton->setIcon(QPixmap(file));
44 p_fileButton->setDefaultAction(action);
45 p_fileButton->setToolTip(
"Select file");
46 QString fileButtonWhatsThisText =
"<p><b>Function:</b> \
47 Opens a file chooser window to select a file from</p>";
48 p_fileButton->setWhatsThis(fileButtonWhatsThisText);
51 grid->addWidget(
AddHelpers(p_lineEdit), param, 4);
57 p_type = FileNameWidget;
73 p_lineEdit->setText(newValue);
83 return p_lineEdit->text();
108 if((p_lineEdit->text().length() > 0) &&
113 else if(p_ui->
ParamPath(p_group, p_param).length() > 0) {
119 QString filter = p_ui->
ParamFilter(p_group, p_param);
120 if(filter.isEmpty()) {
124 filter +=
";;Any(*)";
128 QString fnameQString;
131 fnameQString = QFileDialog::getOpenFileName(p_fileButton,
"Select file", dir, filter);
143 fnameQString = QFileDialog::getSaveFileName(p_fileButton,
"Select file", dir, filter, 0, options);
145 if(fnameQString !=
"") {
147 if(fname.
dir() == QDir::currentPath()) {
148 fnameQString = fname.
name();