29 #include <QFileDialog>
31 #include "../WQtGui.h"
32 #include "../WIconManager.h"
33 #include "../controlPanel/WQtPropertyGroupWidget.h"
35 #include "core/kernel/WDataModuleInputFilterFile.h"
36 #include "core/kernel/WDataModuleInputFile.h"
38 #include "WQtDataModuleInput.h"
44 setContentsMargins( QMargins( 0, 0, 0, 0 ) );
47 m_layout->setContentsMargins( QMargins( 0, 0, 0, 0 ) );
52 m_mainLayout->setContentsMargins( QMargins( 0, 0, 0, 0 ) );
70 m_clearButton->setToolTip(
"Clear the source and set no source." );
94 connect( changeAction, SIGNAL( triggered(
bool ) ),
this, SLOT(
onChange() ) );
95 connect( reloadAction, SIGNAL( triggered(
bool ) ),
this, SLOT(
onReload() ) );
96 connect( clearAction, SIGNAL( triggered(
bool ) ),
this, SLOT(
onClear() ) );
114 m_label->setToolTip( QString::fromStdString(
m_module->getInput()->getExtendedInfo() ) );
127 std::vector< WDataModuleInputFilter::ConstSPtr > filters =
m_module->getInputFilter();
128 for( std::vector< WDataModuleInputFilter::ConstSPtr >::const_iterator filterIter = filters.begin(); filterIter != filters.end();
134 QString description = QString::fromStdString( ff->getDescription() );
135 QString extension = QString::fromStdString( ff->getExtension() );
136 all += QString(
" *." ) + extension;
137 result += description + QString(
"(*." ) + extension + QString(
");;" );
141 result = QString(
"Known file types (" ) + all + QString(
");;" ) + result;
142 result += QString(
"Any files (*)" );
146 QString defaultPath =
"";
150 defaultPath = QString::fromStdString( p.parent_path().string() );
157 QString filename = QFileDialog::getOpenFileName(
this,
"Open Data", defaultPath, result );
164 boost::filesystem::path p( filename.toStdString() );
165 WQtGui::getSettings().setValue(
"LastOpenPath", QString::fromStdString( p.parent_path().string() ) );
std::shared_ptr< WDataModule > SPtr
Convenience typedef for a std::shared_ptr< WDataModule >.
QIcon getIcon(const std::string name)
Searches icons in the internal map and all modules for the given icon name.
static QSettings & getSettings()
Returns the settings object.
static WIconManager * getIconManager()
Get the icon manager of this gui instance.
static void execInGUIThreadAsync(boost::function< void(void) > functor, WCondition::SPtr notify=WCondition::SPtr())
Call a given function from within the GUI thread.
Special Label that can shrink and expand in a layout.
virtual void setText(const QString &text)
reimplemented function to setText