Commit 4295388e authored by Dirk Wilden's avatar Dirk Wilden
Browse files

extended FileInterface

it is now possible to provide a special loadWidget/saveWidget for every nameFilter

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@2773 383ad7c9-94d9-4d36-a494-682f7c89f535
parent aeb507e9
......@@ -275,14 +275,22 @@ void FileTriangleMeshPlugin::saveIniFile( INIFile& _ini ,int _id) {
}
QWidget* FileTriangleMeshPlugin::saveOptionsWidget() {
return saveOptionsWidget("");
}
QWidget* FileTriangleMeshPlugin::saveOptionsWidget(QString _currentFilter) {
if (saveOptions_ == 0){
//generate widget
saveOptions_ = new QWidget();
QVBoxLayout* layout = new QVBoxLayout();
layout->setAlignment(Qt::AlignTop);
saveBinary_ = new QCheckBox("Save Binary");
layout->addWidget(saveBinary_);
if( ! _currentFilter.contains("Wavefront") ){ //dont add 'save binary' for obj
saveBinary_ = new QCheckBox("Save Binary");
layout->addWidget(saveBinary_);
}
saveColor_ = new QCheckBox("Save Colors");
layout->addWidget(saveColor_);
......@@ -293,8 +301,14 @@ QWidget* FileTriangleMeshPlugin::saveOptionsWidget() {
layout->addWidget(saveTexCoords_);
saveOptions_->setLayout(layout);
}else{
//adjust widget
if( _currentFilter.contains("Wavefront") ) //dont add 'save binary' for obj
saveBinary_->setVisible( false );
else
saveBinary_->setVisible( true );
}
return saveOptions_;
}
......@@ -302,5 +316,9 @@ QWidget* FileTriangleMeshPlugin::loadOptionsWidget() {
return 0;
}
QWidget* FileTriangleMeshPlugin::loadOptionsWidget(QString _currentFilter) {
return 0;
}
Q_EXPORT_PLUGIN2( filetrianglemeshplugin , FileTriangleMeshPlugin );
......@@ -99,7 +99,9 @@ class FileTriangleMeshPlugin : public QObject, BaseInterface, FileInterface, Loa
QString getLoadFilters();
QWidget* saveOptionsWidget();
QWidget* saveOptionsWidget(QString _currentFilter);
QWidget* loadOptionsWidget();
QWidget* loadOptionsWidget(QString _currentFilter);
private :
BaseObject* objectRoot_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment