diff --git a/modules/gui/src/file_loader.cc b/modules/gui/src/file_loader.cc index 059f661c32f48ab032fa77cf5194c43b6a37d24b..31636340e150d1ed3c06284165bc2255789aeeb4 100644 --- a/modules/gui/src/file_loader.cc +++ b/modules/gui/src/file_loader.cc @@ -217,6 +217,12 @@ void FileLoader::HandleError(Message m, ErrorType type, const QString& filename, 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) @@ -361,9 +367,11 @@ void FileLoader::LoadPDB(const QString& filename, const QString& selection) conop::Conopology::Instance().ConnectAll(builder,ent,0); entities.append(ent); } - 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()))); try{ gfx::Scene::Instance().Add(gfx_ent); diff --git a/modules/gui/src/file_loader.hh b/modules/gui/src/file_loader.hh index 4bf5a8ad1fb59d6f83aba2a2791381109e335e9c..ea2d63e2d8e04eba39eddbff64dae637438fe77c 100644 --- a/modules/gui/src/file_loader.hh +++ b/modules/gui/src/file_loader.hh @@ -46,7 +46,8 @@ private: enum ErrorType { DEFAULT = 0, IO_LOADING, GFX_ADD, - GFX_MULTIPLE_ADD + GFX_MULTIPLE_ADD, + INFO }; FileLoader();