1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 #include "browsedirtree.h"
26 BrowseOF::BrowseOF(QWidget
*parent
) : QDialog(parent
)
31 connect(ui
.browseOFButton
,SIGNAL(clicked()),this,SLOT(onBrowse()));
34 void BrowseOF::setFile(QString file
)
36 ui
.OFlineEdit
->setText(file
);
39 void BrowseOF::onBrowse()
41 BrowseDirtree
browser(this);
42 browser
.setFilter(QDir::Dirs
| QDir::Files
| QDir::NoDotAndDotDot
);
44 if(QFileInfo(ui
.OFlineEdit
->text()).exists())
46 browser
.setDir(ui
.OFlineEdit
->text());
49 if(browser
.exec() == QDialog::Accepted
)
51 qDebug() << browser
.getSelected();
52 setFile(browser
.getSelected());
56 QString
BrowseOF::getFile()
58 return ui
.OFlineEdit
->text();
61 void BrowseOF::accept()
64 setResult(QDialog::Accepted
);