Skip to content
Snippets Groups Projects
Commit 06a0b0ae authored by stefan's avatar stefan
Browse files

FileLoader, Informationmessage when no entities found in pdb

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2362 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 4738ec02
Branches
Tags
No related merge requests found
...@@ -217,6 +217,12 @@ void FileLoader::HandleError(Message m, ErrorType type, const QString& filename, ...@@ -217,6 +217,12 @@ void FileLoader::HandleError(Message m, ErrorType type, const QString& filename,
break; break;
} }
} }
else if(type==INFO){
QMessageBox message_box(QMessageBox::Information,
"Information", m._mesg.c_str());
message_box.setStandardButtons( QMessageBox::Ok);
message_box.exec();
}
} }
gfx::GfxObjP FileLoader::TryLoadEntity(const QString& filename, io::EntityIOHandlerP handler, const QString& selection) gfx::GfxObjP FileLoader::TryLoadEntity(const QString& filename, io::EntityIOHandlerP handler, const QString& selection)
...@@ -361,9 +367,11 @@ void FileLoader::LoadPDB(const QString& filename, const QString& selection) ...@@ -361,9 +367,11 @@ void FileLoader::LoadPDB(const QString& filename, const QString& selection)
conop::Conopology::Instance().ConnectAll(builder,ent,0); conop::Conopology::Instance().ConnectAll(builder,ent,0);
entities.append(ent); entities.append(ent);
} }
QFileInfo file_info(filename); QFileInfo file_info(filename);
if(entities.size()==1){ if(entities.empty()){
FileLoader::HandleError(Message(QString("No entities found in file: "+ filename).toStdString()),INFO,filename);
}
else if(entities.size()==1){
gfx::EntityP gfx_ent(new gfx::Entity(file_info.baseName().toStdString(),entities.first(),mol::Query(selection.toStdString()))); gfx::EntityP gfx_ent(new gfx::Entity(file_info.baseName().toStdString(),entities.first(),mol::Query(selection.toStdString())));
try{ try{
gfx::Scene::Instance().Add(gfx_ent); gfx::Scene::Instance().Add(gfx_ent);
......
...@@ -46,7 +46,8 @@ private: ...@@ -46,7 +46,8 @@ private:
enum ErrorType { DEFAULT = 0, enum ErrorType { DEFAULT = 0,
IO_LOADING, IO_LOADING,
GFX_ADD, GFX_ADD,
GFX_MULTIPLE_ADD GFX_MULTIPLE_ADD,
INFO
}; };
FileLoader(); FileLoader();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment